private static Set<DOMRpcIdentifier> createDomRpcIdentifiers(final Set<SchemaPath> rpcs, final Collection<YangInstanceIdentifier> paths) { final Set<DOMRpcIdentifier> ret = new HashSet<>(); for (final YangInstanceIdentifier path : paths) { for (final SchemaPath rpc : rpcs) { ret.add(DOMRpcIdentifier.create(rpc, path)); } } return ret; }
@Override public DOMRpcIdentifier apply(final RpcDefinition input) { // TODO add support for routed rpcs ... is it necessary in this case ? return DOMRpcIdentifier.create(input.getPath()); } };
RoutedDOMRpcRoutingTableEntry(final RpcDefinition def, final YangInstanceIdentifier keyId, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) { super(def.getPath(), impls); this.keyId = Preconditions.checkNotNull(keyId); this.globalRpcId = DOMRpcIdentifier.create(def.getPath()); }
/** * Add all the locally registered RPCs in the clustered routing table */ private void announceSupportedRpcs(){ LOG.debug("Adding all supported rpcs to routing table"); final Set<RpcDefinition> currentlySupportedRpc = schemaContext.getOperations(); final List<DOMRpcIdentifier> rpcs = new ArrayList<>(); for (final RpcDefinition rpcDef : currentlySupportedRpc) { rpcs.add(DOMRpcIdentifier.create(rpcDef.getPath())); } if(!rpcs.isEmpty()) { rpcListener.onRpcAvailable(rpcs); } }
public static DOMRpcIdentifier fromMdsal(final org.opendaylight.mdsal.dom.api.DOMRpcIdentifier mdsal) { return create(mdsal.getType(), mdsal.getContextReference()); }
GlobalDOMRpcRoutingTableEntry(final RpcDefinition def, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) { super(def.getPath(), impls); this.rpcId = DOMRpcIdentifier.create(def.getPath()); }
private void registerRoutedRpcDelegate() { final Set<DOMRpcIdentifier> rpcIdentifiers = new HashSet<>(); final Set<Module> modules = schemaContext.getModules(); for(final Module module : modules){ for(final RpcDefinition rpcDefinition : module.getRpcs()){ if(RpcRoutingStrategy.from(rpcDefinition).isContextBasedRouted()) { LOG.debug("Adding routed rpcDefinition for path {}", rpcDefinition.getPath()); rpcIdentifiers.add(DOMRpcIdentifier.create(rpcDefinition.getPath(), YangInstanceIdentifier.EMPTY)); } } } rpcProvisionRegistry.registerRpcImplementation(rpcImplementation, rpcIdentifiers); }