Class HeliumRpcProviderRegistry

    • Method Detail

      • addRoutedRpcImplementation

        public <T extends RpcServiceBindingAwareBroker.RoutedRpcRegistration<T> addRoutedRpcImplementation​(Class<T> type,
                                                                                                             T impl)
                                                                                                      throws IllegalStateException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: RpcProviderRegistry
        Registers an implementation of the given routed RPC service interface.

        See the class documentation for information and example on how to use routed RPCs.

        Specified by:
        addRoutedRpcImplementation in interface RpcProviderRegistry
        Parameters:
        type - the YANG-generated interface of the RPC Service for which to register.
        impl - the implementation instance to register.
        Returns:
        a RoutedRpcRegistration instance which can be used to register paths for the RPC implementation via invoking RoutedRpcRegistration#registerPath(Class, InstanceIdentifer). BindingAwareBroker.RpcRegistration.close() should be called to unregister the implementation and all previously registered paths when no longer needed.
        Throws:
        IllegalStateException - if the supplied RPC interface is not a routed RPC type.
      • getRpcService

        public <T extends RpcService> T getRpcService​(Class<T> type)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: RpcConsumerRegistry
        Returns an implementation of a requested RPC service.

        The returned instance is not an actual implementation of the RPC service interface, but a proxy implementation of the interface that forwards to an actual implementation, if any.

        The following describes the behavior of the proxy when invoking RPC methods:

        • If an actual implementation is registered with the MD-SAL, all invocations are forwarded to the registered implementation.
        • If no actual implementation is registered, all invocations will fail by throwing IllegalStateException.
        • Prior to invoking the actual implementation, the method arguments are are validated. If any are invalid, an IllegalArgumentException is thrown.

        The returned proxy is automatically updated with the most recent registered implementation. final Future<RpcResult<SomeRpcOutput>> future = someRpcService.someRpc( ... ); Futures.addCallback(future, new FutureCallback<RpcResult<SomeRpcOutput>>() { public void onSuccess(RpcResult<SomeRpcOutput> result) { // process result ... } public void onFailure(Throwable t) { // RPC failed } });

        Specified by:
        getRpcService in interface RpcConsumerRegistry
        Parameters:
        type - the interface of the RPC Service. Typically this is an interface generated from a YANG model.
        Returns:
        the proxy for the requested RPC service. This method never returns null.