RemoteRpcRegistryMXBeanImpl extends AbstractRegistryMXBean<RoutingTable, DOMRpcIdentifier> implements RemoteRpcRegistryMXBean { @Override public Map<String, String> findRpcByRoute(final String routeId) { RoutingTable localTable = localData(); Map<String, String> rpcMap = new HashMap<>(getRpcMemberMapByRoute(localTable, routeId, LOCAL_CONSTANT)); Map<Address, Bucket<RoutingTable>> buckets = remoteBuckets(); for (Entry<Address, Bucket<RoutingTable>> entry : buckets.entrySet()) { RoutingTable table = entry.getValue().getData(); rpcMap.putAll(getRpcMemberMapByRoute(table, routeId, entry.getKey().toString())); } log.debug("list of RPCs {} searched by route {}", rpcMap, routeId); return rpcMap; } RemoteRpcRegistryMXBeanImpl(final BucketStoreAccess rpcRegistryAccess, final Timeout timeout); @Override Set<String> getGlobalRpc(); @Override Set<String> getLocalRegisteredRoutedRpc(); @Override Map<String, String> findRpcByName(final String name); @Override Map<String, String> findRpcByRoute(final String routeId); @Override String getBucketVersions();  }
@Test public void testFindRpcByRoute() { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Map<String, String> rpcByRoute = mxBean.findRpcByRoute(""); assertNotNull(rpcByRoute); assertEquals(1, rpcByRoute.size()); assertTrue(rpcByRoute.containsValue(LOCAL_QNAME.getLocalName())); }
@Test public void testFindRpcByRouteEmptyBuckets() { final Map<String, String> rpcByRoute = mxBean.findRpcByRoute(""); assertNotNull(rpcByRoute); assertTrue(rpcByRoute.isEmpty()); }