@Override public Set<String> getGlobalRpc() { RoutingTable table = getLocalData(); Set<String> globalRpc = new HashSet<>(table.getRoutes().size()); for (DOMRpcIdentifier route : table.getRoutes()) { if (route.getContextReference().isEmpty()) { globalRpc.add(route.getType().toString()); } } log.debug("Locally registered global RPCs {}", globalRpc); return globalRpc; }
/** * Search if the routing table route type contains name. */ private static Map<String, String> getRpcMemberMapByName(final RoutingTable table, final String name, final String address) { Set<DOMRpcIdentifier> routes = table.getRoutes(); Map<String, String> rpcMap = new HashMap<>(routes.size()); for (DOMRpcIdentifier route : routes) { if (!route.getContextReference().isEmpty()) { String type = route.getType().toString(); if (type.contains(name)) { rpcMap.put(ROUTE_CONSTANT + route.getContextReference() + NAME_CONSTANT + type, address); } } } return rpcMap; }
@Override boolean registerNotificationTopic(SchemaPath notificationPath, TopicId topicId) { if (!checkNotificationPath(notificationPath)) { LOG.debug("Bad SchemaPath for notification try to register"); return false; } activateNotificationSource(); if (!isActive()) { LOG.warn("Stream {} is not active, listener for notification {} is not registered.", getStreamName(), notificationPath.toString()); return false; } ListenerRegistration<DOMNotificationListener> registration = mountPoint.registerNotificationListener(netconfEventSource, notificationPath); notificationRegistrationMap.put(notificationPath, registration); Set<TopicId> topicIds = getTopicsForNotification(notificationPath); topicIds.add(topicId); notificationTopicMap.put(notificationPath, topicIds); return true; }