+ YangInstanceIdentifier path = listener.getPath();
+ final ListenerRegistration<DOMDataChangeListener> registration = domDataBroker.registerDataChangeListener(
+ datastore, path, listener, scope);
+
+ listener.setRegistration(registration);
+ }
+
+ private NormalizedNode<?, ?> readDataViaTransaction(final DOMDataReadTransaction transaction,
+ LogicalDatastoreType datastore, YangInstanceIdentifier path) {
+ LOG.trace("Read " + datastore.name() + " via Restconf: {}", path);
+ final ListenableFuture<Optional<NormalizedNode<?, ?>>> listenableFuture = transaction.read(datastore, path);
+ if (listenableFuture != null) {
+ Optional<NormalizedNode<?, ?>> optional;
+ try {
+ LOG.debug("Reading result data from transaction.");
+ optional = listenableFuture.get();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RestconfDocumentedException("Problem to get data from transaction.", e.getCause());
+
+ }
+ if (optional != null) {
+ if (optional.isPresent()) {
+ return optional.get();
+ }
+ }
+ }