@Override public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T implementation) throws IllegalStateException { return getSALService(RpcProviderRegistry.class).addRoutedRpcImplementation(type, implementation); }
@Override public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T implementation) throws IllegalStateException { return getSALService(RpcProviderRegistry.class).addRoutedRpcImplementation(type, implementation); }
@Override public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> serviceInterface, final T implementation) throws IllegalStateException { return service(RpcProviderRegistry.class).addRoutedRpcImplementation(serviceInterface, implementation); }
@Override public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> type, final T implementation) throws IllegalStateException { return getRpcRegistryChecked().addRoutedRpcImplementation(type, implementation); }
@Override public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> type, final T implementation) throws IllegalStateException { return getRpcRegistryChecked().addRoutedRpcImplementation(type, implementation); }
private void registerRpcService(InstanceIdentifier<Node> path) { if(!rpcRegistrations.containsKey(path)) { try { BindingAwareBroker.RoutedRpcRegistration<OpenflowFeatureService> registration = rpcRegistry.addRoutedRpcImplementation(OpenflowFeatureService.class, this); registration.registerPath(NodeContext.class, path); rpcRegistrations.put(path, registration); } catch (IllegalStateException e) { LOG.error("Failed to register RPC for node: {}", path, e); } } }
/** * Register the given routed RPC service. * * @param rpcReg A {@link RpcProviderRegistry} service instance. * @param clz A class corresponding to routed RPC service. * @param impl This instance must be specified. * @param <T> The type of routed RPC service. */ private <T extends RpcService> void register( RpcProviderRegistry rpcReg, Class<T> clz, T impl) { RoutedRpcRegistration<T> reg = rpcReg.addRoutedRpcImplementation(clz, impl); reg.registerPath(NodeContext.class, nodePath); registrations.add(reg); }
/*** * Registers a routed RPC service (aka driver) * * @param driverInterface * The RPC service interface * @param driverImplementation * The RPC service implementation * @param path * The path to the node which the RPCs apply to * @return */ private BindingAwareBroker.RoutedRpcRegistration<RpcService> registerRpcService( Class<? extends RpcService> driverInterface, RpcService driverImplementation, InstanceIdentifier<Node> path) { LOG.info("Registering RPC {} as {}", driverImplementation, driverInterface); BindingAwareBroker.RoutedRpcRegistration<RpcService> registration = null; try { registration = rpcRegistry.addRoutedRpcImplementation((Class<RpcService>) driverInterface, driverImplementation); registration.registerPath(NodeContext.class, path); } catch (IllegalStateException e) { LOG.info("Failed to register {} as {}", driverImplementation, driverInterface, e); } return registration; }
/** * @see org.opendaylight.ocpplugin.api.ocp.rpc.RpcContext#registerRpcServiceImplementation(java.lang.Class, * org.opendaylight.yangtools.yang.binding.RpcService) */ @Override public <S extends RpcService> void registerRpcServiceImplementation(final Class<S> serviceClass, final S serviceInstance) { final RoutedRpcRegistration<S> routedRpcReg = rpcProviderRegistry.addRoutedRpcImplementation(serviceClass, serviceInstance); routedRpcReg.registerPath(NodeContext.class, deviceContext.getDeviceState().getNodeInstanceIdentifier()); rpcRegistrations.add(routedRpcReg); LOG.debug("Registration of service {} for device {}.", serviceClass, deviceContext.getDeviceState().getNodeInstanceIdentifier()); }
public void register(final EventSource eventSource){ final NodeKey nodeKey = eventSource.getSourceNodeKey(); final KeyedInstanceIdentifier<Node, NodeKey> sourcePath = EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, nodeKey); final RoutedRpcRegistration<EventSourceService> reg = rpcRegistry.addRoutedRpcImplementation(EventSourceService.class, eventSource); reg.registerPath(NodeContext.class, sourcePath); routedRpcRegistrations.put(nodeKey,reg); insert(sourcePath); }
implementation, rpcInterface); return rpcRegistry.addRoutedRpcImplementation(rpcInterface, (RpcService)implementation); } catch (final ComponentDefinitionException e) { throw e;
implementation, rpcInterface); return rpcRegistry.addRoutedRpcImplementation(rpcInterface, (RpcService)implementation); } catch(ComponentDefinitionException e) { throw e;
final RoutedRpcRegistration<SalFlowService> flowRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalFlowService.class, this); flowRegistration.registerPath(NodeContext.class, getIdentifier()); builder.add(flowRegistration); final RoutedRpcRegistration<SalPortService> portRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalPortService.class, this); portRegistration.registerPath(NodeContext.class, getIdentifier()); builder.add(portRegistration); final RoutedRpcRegistration<SalMeterService> meterRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalMeterService.class, this); meterRegistration.registerPath(NodeContext.class, getIdentifier()); builder.add(meterRegistration); final RoutedRpcRegistration<SalGroupService> groupRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalGroupService.class, this); groupRegistration.registerPath(NodeContext.class, getIdentifier()); builder.add(groupRegistration); final RoutedRpcRegistration<SalTableService> tableRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalTableService.class, this); tableRegistration.registerPath(NodeContext.class, getIdentifier()); builder.add(tableRegistration); final RoutedRpcRegistration<PacketProcessingService> packetRegistration = rpcProviderRegistry.addRoutedRpcImplementation(PacketProcessingService.class, this); packetRegistration.registerPath(NodeContext.class, getIdentifier()); builder.add(packetRegistration); final RoutedRpcRegistration<OpendaylightFlowStatisticsService> flowStatisticsRegistration = rpcProviderRegistry.addRoutedRpcImplementation(OpendaylightFlowStatisticsService.class, this); flowStatisticsRegistration.registerPath(NodeContext.class, getIdentifier()); builder.add(flowStatisticsRegistration); final RoutedRpcRegistration<OpendaylightGroupStatisticsService> groupStatisticsRegistration = rpcProviderRegistry.addRoutedRpcImplementation(OpendaylightGroupStatisticsService.class, this);
public static PCEPTopologyProvider create(final PCEPDispatcher dispatcher, final InetSocketAddress address, final Optional<KeyMapping> keys, final InstructionScheduler scheduler, final DataBroker dataBroker, final RpcProviderRegistry rpcRegistry, final InstanceIdentifier<Topology> topology, final TopologySessionListenerFactory listenerFactory, final Optional<PCEPTopologyProviderRuntimeRegistrator> runtimeRootRegistrator, final int rpcTimeout) throws InterruptedException, ExecutionException, ReadFailedException, TransactionCommitFailedException { List<PCEPCapability> capabilities = dispatcher.getPCEPSessionNegotiatorFactory().getPCEPSessionProposalFactory().getCapabilities(); boolean statefulCapability = false; for (final PCEPCapability capability : capabilities) { if (capability.isStateful()) { statefulCapability = true; break; } } if (!statefulCapability && listenerFactory != null) { throw new IllegalStateException("Stateful capability not defined, aborting PCEP Topology Provider instantiation"); } final ServerSessionManager manager = new ServerSessionManager(dataBroker, topology, listenerFactory, rpcTimeout); if (runtimeRootRegistrator.isPresent()) { manager.registerRuntimeRootRegistartion(runtimeRootRegistrator.get()); } final ChannelFuture f = dispatcher.createServer(address, keys, manager, manager); f.get(); final BindingAwareBroker.RoutedRpcRegistration<NetworkTopologyPcepService> element = rpcRegistry.addRoutedRpcImplementation( NetworkTopologyPcepService.class, new TopologyRPCs(manager)); element.registerPath(NetworkTopologyContext.class, topology); final BindingAwareBroker.RoutedRpcRegistration<NetworkTopologyPcepProgrammingService> network = rpcRegistry.addRoutedRpcImplementation( NetworkTopologyPcepProgrammingService.class, new TopologyProgramming(scheduler, manager)); network.registerPath(NetworkTopologyContext.class, topology); return new PCEPTopologyProvider(f.channel(), topology, manager, element, network); }
GlobalBindingRTCServer server = new GlobalBindingRTCServer(); RoutedRpcRegistration<RpcbenchPayloadService> routedReg = providerRegistry.addRoutedRpcImplementation(RpcbenchPayloadService.class, server);
GlobalBindingRTCServer server = new GlobalBindingRTCServer(); RoutedRpcRegistration<RpcbenchPayloadService> routedReg = providerRegistry.addRoutedRpcImplementation(RpcbenchPayloadService.class, server);
this.rpcRegistration = this.rpcRegistry.addRoutedRpcImplementation(BgpPeerRpcService.class, new BgpPeerRpc(session, this.tables)); final KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.bgp.rib.rib.Peer, PeerKey> path = this.rib.getInstanceIdentifier().child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.bgp.rib.rib.Peer.class, new PeerKey(peerId));
@Override public java.lang.AutoCloseable createInstance() { final PCEPTunnelTopologyProvider ttp = PCEPTunnelTopologyProvider.create(getDataProviderDependency(), getSourceTopologyDependency().getInstanceIdentifier(), getTopologyId()); final NetworkTopologyPcepService ntps = getRpcRegistryDependency().getRpcService(NetworkTopologyPcepService.class); final TunnelProgramming tp = new TunnelProgramming(getSchedulerDependency(), getDataProviderDependency(), ntps); final BindingAwareBroker.RoutedRpcRegistration<TopologyTunnelPcepProgrammingService> reg = getRpcRegistryDependency().addRoutedRpcImplementation( TopologyTunnelPcepProgrammingService.class, tp); final InstanceIdentifier<Topology> topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(getTopologyId())).build(); reg.registerPath(NetworkTopologyContext.class, topology); final class TunnelTopologyReferenceCloseable extends DefaultTopologyReference implements AutoCloseable { public TunnelTopologyReferenceCloseable(final InstanceIdentifier<Topology> instanceIdentifier) { super(instanceIdentifier); } @Override public void close() { reg.close(); tp.close(); ttp.close(); } } return new TunnelTopologyReferenceCloseable(ttp.getTopologyReference().getInstanceIdentifier()); } }