Introduce CREATE_SUBSCRIPTION_RPC_PATH 87/83987/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 26 Aug 2019 12:49:34 +0000 (14:49 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 26 Aug 2019 14:00:29 +0000 (16:00 +0200)
This path is used multiple times, it does not really make sense
to create it each and every time.

Change-Id: Iabca29c2745cd046fc54c0b768fd675a25f6b493
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java

index 3746412774bc880109d966225e7dd02292825222..cdb3d92c3e5b7205076f59a2b06af7496c1288b9 100644 (file)
@@ -200,7 +200,7 @@ public class NetconfDevice
         // Perhaps add a default schema context to support create-subscription if the model was not provided
         // (same as what we do for base netconf operations in transformer)
         final ListenableFuture<DOMRpcResult> rpcResultListenableFuture = deviceRpc.invokeRpc(
-                NetconfMessageTransformUtil.toPath(NetconfMessageTransformUtil.CREATE_SUBSCRIPTION_RPC_QNAME),
+                NetconfMessageTransformUtil.CREATE_SUBSCRIPTION_RPC_PATH,
                 NetconfMessageTransformUtil.CREATE_SUBSCRIPTION_RPC_CONTENT);
 
         final NotificationHandler.NotificationFilter filter = new NotificationHandler.NotificationFilter() {
index 5900befdb530e40dc73ce666a9671bcd589cddd3..2987e253a76933a2c3d223b1b204b7a11adeea95 100644 (file)
@@ -206,6 +206,8 @@ public final class NetconfMessageTransformUtil {
     public static final ContainerNode CREATE_SUBSCRIPTION_RPC_CONTENT = Builders.containerBuilder()
             .withNodeIdentifier(NodeIdentifier.create(CREATE_SUBSCRIPTION_RPC_QNAME)).build();
 
+    public static final SchemaPath CREATE_SUBSCRIPTION_RPC_PATH = toPath(CREATE_SUBSCRIPTION_RPC_QNAME);
+
     public static final NodeIdentifier NETCONF_FILTER_NODEID = NodeIdentifier.create(NETCONF_FILTER_QNAME);
 
     public static final DataContainerChild<?, ?> EMPTY_FILTER;