Add getDataBroker to NetworkTransactionService 49/94549/7
authormanuedelf <emmanuelle.delfour@orange.com>
Mon, 30 Nov 2020 09:02:17 +0000 (10:02 +0100)
committermanuedelf <emmanuelle.delfour@orange.com>
Sat, 9 Jan 2021 14:41:35 +0000 (15:41 +0100)
In order to prepare flexgrid add getDataBroker method to be able to
retrieve version of PceOpticalNode.

JIRA: TRNSPRTPCE-230
Signed-off-by: manuedelf <emmanuelle.delfour@orange.com>
Change-Id: Ica0a27cdf7d4ded89b89642f70b0ca4677fe4fbd

common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionImpl.java
common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionService.java
common/src/main/java/org/opendaylight/transportpce/common/network/RequestProcessor.java

index 11a1898b2dba4ef9c4c7b583020ce742f5ce5d5f..3f39eb110345ba48d7ac113b0fec817e51f7ae0b 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.transportpce.common.network;
 import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.ListenableFuture;
 import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -60,5 +61,15 @@ public class NetworkTransactionImpl implements NetworkTransactionService {
         requestProcessor.merge(store, path, data);
     }
 
+    /*
+    * (non-Javadoc)
+    *
+    * @see org.opendaylight.transportpce.common.network.NetworkTransactionService#getDataBroker()
+    */
+    @Override
+    public DataBroker getDataBroker() {
+        return requestProcessor.getDataBroker();
+    }
+
 
 }
index 4fe79f3cf40511e84200685e90247e59b71ecbd1..af75889fe4a9e82eb8cd47c23bdaea6ce9753f82 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Optional;
 import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -33,4 +34,10 @@ public interface NetworkTransactionService {
     FluentFuture<? extends @NonNull CommitInfo> commit();
 
     void close();
+
+    /**
+     * the Databroker related to NetworkTransactionService.
+     * @return the Databroker related to NetworkTransactionService.
+     */
+    DataBroker getDataBroker();
 }
index 54a88c5afed759ca94c8cb1e593973ab71bdda52..810902dd42dc775c2e27e8450dbe614aaf60e7c2 100644 (file)
@@ -130,4 +130,12 @@ public class RequestProcessor {
         rwTx = dataBroker.newReadWriteTransaction();
         return rwTx;
     }
+
+    /**
+     * Return the dataBroker related to RequestProcessor.
+     * @return the dataBroker
+     */
+    public DataBroker getDataBroker() {
+        return dataBroker;
+    }
 }