X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2Fregistry%2Fmbeans%2FRemoteActionRegistryMXBeanImpl.java;h=8314b13b70c61c8f53ca58792aa5bb21799dc83c;hb=HEAD;hp=cc117bd167f90562828c3a34676c47a1a059e7d2;hpb=927bce5688e4b9d33d3e5e9b769d8a0dba5ccdd4;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteActionRegistryMXBeanImpl.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteActionRegistryMXBeanImpl.java index cc117bd167..8314b13b70 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteActionRegistryMXBeanImpl.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteActionRegistryMXBeanImpl.java @@ -19,11 +19,9 @@ import org.opendaylight.controller.remote.rpc.registry.gossip.Bucket; import org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreAccess; import org.opendaylight.mdsal.dom.api.DOMActionInstance; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; public class RemoteActionRegistryMXBeanImpl extends AbstractRegistryMXBean implements RemoteActionRegistryMXBean { - public RemoteActionRegistryMXBeanImpl(final BucketStoreAccess actionRegistryAccess, final Timeout timeout) { super("RemoteActionRegistry", "RemoteActionBroker", actionRegistryAccess, timeout); } @@ -33,12 +31,9 @@ public class RemoteActionRegistryMXBeanImpl extends AbstractRegistryMXBean routedAction = new HashSet<>(table.getItems().size()); for (DOMActionInstance route : table.getItems()) { - if (route.getType().getLastComponent() != null) { - final YangInstanceIdentifier actionPath = YangInstanceIdentifier.create( - new NodeIdentifier(route.getType().getLastComponent())); - if (!actionPath.isEmpty()) { - routedAction.add(ROUTE_CONSTANT + actionPath + NAME_CONSTANT + route.getType()); - } + final YangInstanceIdentifier actionPath = YangInstanceIdentifier.of(route.getType().lastNodeIdentifier()); + if (!actionPath.isEmpty()) { + routedAction.add(ROUTE_CONSTANT + actionPath + NAME_CONSTANT + route.getType()); } } @@ -86,14 +81,11 @@ public class RemoteActionRegistryMXBeanImpl extends AbstractRegistryMXBean routes = table.getItems(); Map actionMap = new HashMap<>(routes.size()); for (DOMActionInstance route : routes) { - if (route.getType().getLastComponent() != null) { - final YangInstanceIdentifier actionPath = YangInstanceIdentifier.create( - new NodeIdentifier(route.getType().getLastComponent())); - if (!actionPath.isEmpty()) { - String routeString = actionPath.toString(); - if (routeString.contains(routeName)) { - actionMap.put(ROUTE_CONSTANT + routeString + NAME_CONSTANT + route.getType(), address); - } + final YangInstanceIdentifier actionPath = YangInstanceIdentifier.of(route.getType().lastNodeIdentifier()); + if (!actionPath.isEmpty()) { + String routeString = actionPath.toString(); + if (routeString.contains(routeName)) { + actionMap.put(ROUTE_CONSTANT + routeString + NAME_CONSTANT + route.getType(), address); } } } @@ -108,14 +100,11 @@ public class RemoteActionRegistryMXBeanImpl extends AbstractRegistryMXBean routes = table.getItems(); Map actionMap = new HashMap<>(routes.size()); for (DOMActionInstance route : routes) { - if (route.getType().getLastComponent() != null) { - final YangInstanceIdentifier actionPath = YangInstanceIdentifier.create( - new NodeIdentifier(route.getType().getLastComponent())); - if (!actionPath.isEmpty()) { - String type = route.getType().toString(); - if (type.contains(name)) { - actionMap.put(ROUTE_CONSTANT + actionPath + NAME_CONSTANT + type, address); - } + final YangInstanceIdentifier actionPath = YangInstanceIdentifier.of(route.getType().lastNodeIdentifier()); + if (!actionPath.isEmpty()) { + String type = route.getType().toString(); + if (type.contains(name)) { + actionMap.put(ROUTE_CONSTANT + actionPath + NAME_CONSTANT + type, address); } } }