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;
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) {
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) {
}
}
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) {
}
- 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);