Interface RpcSingleClient<S>

Type Parameters:
S - The node data service interface, i.e., the methods offered by the node model to the node dialog/view to retrieve data.
All Superinterfaces:
RpcClient
All Known Implementing Classes:
AbstractRpcSingleClient, JsonRpcSingleClient

@Deprecated(forRemoval=true) public interface RpcSingleClient<S> extends RpcClient
Deprecated, for removal: This API element is subject to removal in a future version.
can be removed since we don't need a java-based RpcClient anymore once the Remote Workflow Editor becomes obsolete
Convenience specialization of RpcClient for the case where there is only node data service interface, which the user then doesn't have to specify on every call.
Since:
4.3
Author:
Martin Horn, KNIME GmbH, Konstanz, Germany, Carl Witt, KNIME AG, Zurich, Switzerland
  • Method Details

    • callServiceWithRes

      <R> Future<R> callServiceWithRes(Function<S,R> serviceEvaluator)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Used to call a method on the node model's data service interface and retrieve the result. Example usage:
       RpcClient m_rpcClient = ...
       Future<List<SomeType>> future =
            m_rpcClient.callServiceWithRes(nodeDataService -> nodeDataService.getSomeData(someParameter));
       try {
           List<SomeType> results = future.get(3, TimeUnit.SECONDS);
       } catch (TimeoutException timeoutException) {
           ...
       
      Type Parameters:
      R - the result type of the invoked method.
      Parameters:
      serviceEvaluator - the service evaluator is given an implementation of the node model's data service. It then calls one of the methods on the node model's service interface and returns the result.
      Returns:
      a Future containing the result of the invoked method.
    • callServiceWithRes

      default <S2, R> Future<R> callServiceWithRes(Class<S2> serviceInterface, String serviceName, Function<S2,R> serviceEvaluator)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: RpcClient
      Calls a method on the node model's data service implementation of the given interface registered under the given name and returns the result. Example usage:
       RpcClient m_rpcClient = ...
       Future<List<SomeType>> future =
            m_rpcClient.callServiceWithRes(MyService.class, "MyServiceInstance3", s -> s.getSomeData(someParameter));
       try {
           List<SomeType> results = future.get(3, TimeUnit.SECONDS);
       } catch (TimeoutException timeoutException) {
           ...
       
      Specified by:
      callServiceWithRes in interface RpcClient
      Type Parameters:
      S2 - the interface type of the service to use
      R - the result type of the invoked method
      Parameters:
      serviceInterface - the interface of the service to call to
      serviceName - the name under which the service interface is registered at the server, see RpcServer.getHandler(String)
      serviceEvaluator - the service evaluator is given an implementation of the node model's data service. It then calls one of the methods on the node model's service interface and returns the result.
      Returns:
      the result
    • callService

      Future<Void> callService(Consumer<S> serviceConsumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Similar to callServiceWithRes(Function) but for void methods. For instance: Future<Void> future = m_rpcClient.callService(nodeDataService -> nodeDataService.sendSomeData(someData));
      Parameters:
      serviceConsumer - used to invoke the method on the service interface
      Returns:
      an empty future
    • callService

      default <S2> Future<Void> callService(Class<S2> serviceInterface, String serviceName, Consumer<S2> serviceConsumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: RpcClient
      Specified by:
      callService in interface RpcClient
      Type Parameters:
      S2 - the interface type of the service to use
      Parameters:
      serviceInterface - the interface of the service to call
      serviceName - the name under which the service interface is registered at the server, see RpcServer.getHandler(String)
      serviceConsumer - used to invoke the method on the service interface
      Returns:
      an empty future
    • getService

      S getService()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gives direct access to the service implementation. Please note that a call to the service might block for a while (in case the rpc request is send to the server). It is always advisable to run service calls in an extra thread to not block the ui!
      Parameters:
      serviceInterface - the interface to get the service implementation for
      Returns:
      the service implementation
    • getService

      default <S2> S2 getService(Class<S2> serviceInterface, String serviceName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: RpcClient
      Specified by:
      getService in interface RpcClient
      Returns:
      the service implementation