Example #1
0
 public CheckedFuture<Void, TransactionCommitFailedException> commitConfigurationDataDelete(
     final DOMMountPoint mountPoint, final YangInstanceIdentifier path) {
   final Optional<DOMDataBroker> domDataBrokerService = mountPoint.getService(DOMDataBroker.class);
   if (domDataBrokerService.isPresent()) {
     return deleteDataViaTransaction(
         domDataBrokerService.get().newWriteOnlyTransaction(), CONFIGURATION, path);
   }
   final String errMsg = "DOM data broker service isn't available for mount point " + path;
   LOG.warn(errMsg);
   throw new RestconfDocumentedException(errMsg);
 }
Example #2
0
 public NormalizedNode<?, ?> readConfigurationData(
     final DOMMountPoint mountPoint, final YangInstanceIdentifier path) {
   final Optional<DOMDataBroker> domDataBrokerService = mountPoint.getService(DOMDataBroker.class);
   if (domDataBrokerService.isPresent()) {
     return readDataViaTransaction(
         domDataBrokerService.get().newReadOnlyTransaction(), CONFIGURATION, path);
   }
   final String errMsg = "DOM data broker service isn't available for mount point " + path;
   LOG.warn(errMsg);
   throw new RestconfDocumentedException(errMsg);
 }
Example #3
0
 public CheckedFuture<Void, TransactionCommitFailedException> commitConfigurationDataPost(
     final DOMMountPoint mountPoint,
     final YangInstanceIdentifier path,
     final NormalizedNode<?, ?> payload) {
   final Optional<DOMDataBroker> domDataBrokerService = mountPoint.getService(DOMDataBroker.class);
   if (domDataBrokerService.isPresent()) {
     return postDataViaTransaction(
         domDataBrokerService.get().newReadWriteTransaction(),
         CONFIGURATION,
         path,
         payload,
         mountPoint.getSchemaContext());
   }
   final String errMsg = "DOM data broker service isn't available for mount point " + path;
   LOG.warn(errMsg);
   throw new RestconfDocumentedException(errMsg);
 }