BUG-1092: adjust to YangInstanceIdentifier
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / impl / RoutedRpcSelector.java
index a22aed7ab16aeea03fb5967f8b08572956ea9326..19ff03b7d2ca14fa4facb72d855bbf2b14f77b7d 100644 (file)
@@ -22,7 +22,7 @@ import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.SimpleNode;
 
 import com.google.common.collect.ImmutableSet;
@@ -33,7 +33,7 @@ class RoutedRpcSelector implements RpcImplementation, AutoCloseable, Identifiabl
     private final RpcRoutingStrategy strategy;
     private final Set<QName> supportedRpcs;
     private final RpcRoutingContext identifier;
-    final ConcurrentMap<InstanceIdentifier, RoutedRpcRegImpl> implementations = new ConcurrentHashMap<>();
+    final ConcurrentMap<YangInstanceIdentifier, RoutedRpcRegImpl> implementations = new ConcurrentHashMap<>();
     private final SchemaAwareRpcBroker router;
 
     public RoutedRpcSelector(final RpcRoutingStrategy strategy, final SchemaAwareRpcBroker router) {
@@ -70,7 +70,7 @@ class RoutedRpcSelector implements RpcImplementation, AutoCloseable, Identifiabl
         SimpleNode<?> routeContainer = inputContainer.getFirstSimpleByName(strategy.getLeaf());
         checkArgument(routeContainer != null, "Leaf %s must be set with value", strategy.getLeaf());
         Object route = routeContainer.getValue();
-        checkArgument(route instanceof InstanceIdentifier,
+        checkArgument(route instanceof YangInstanceIdentifier,
                       "The routed node %s is not an instance identifier", route);
         RpcImplementation potential = null;
         if (route != null) {
@@ -80,13 +80,13 @@ class RoutedRpcSelector implements RpcImplementation, AutoCloseable, Identifiabl
             }
         }
         if (potential == null) {
-            return router.invokeRpc(rpc, (InstanceIdentifier) route, input);
+            return router.invokeRpc(rpc, (YangInstanceIdentifier) route, input);
         }
         checkState(potential != null, "No implementation is available for rpc:%s path:%s", rpc, route);
         return potential.invokeRpc(rpc, input);
     }
 
-    public void addPath(final QName context, final InstanceIdentifier path, final RoutedRpcRegImpl routedRpcRegImpl) {
+    public void addPath(final QName context, final YangInstanceIdentifier path, final RoutedRpcRegImpl routedRpcRegImpl) {
         //checkArgument(strategy.getContext().equals(context),"Supplied context is not supported.");
         RoutedRpcRegImpl previous = implementations.put(path, routedRpcRegImpl);
         if (previous == null) {
@@ -95,7 +95,7 @@ class RoutedRpcSelector implements RpcImplementation, AutoCloseable, Identifiabl
 
     }
 
-    public void removePath(final QName context, final InstanceIdentifier path, final RoutedRpcRegImpl routedRpcRegImpl) {
+    public void removePath(final QName context, final YangInstanceIdentifier path, final RoutedRpcRegImpl routedRpcRegImpl) {
         boolean removed = implementations.remove(path, routedRpcRegImpl);
         if (removed) {
             router.notifyPathWithdrawal(context, strategy.getIdentifier(), path);