Package org.knime.core.webui.data.rpc
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, 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 Summary
Modifier and TypeMethodDescriptioncallService(Class<S2> serviceInterface, String serviceName, Consumer<S2> serviceConsumer) Deprecated, for removal: This API element is subject to removal in a future version.callService(Consumer<S> serviceConsumer) Deprecated, for removal: This API element is subject to removal in a future version.Similar tocallServiceWithRes(Function)but for void methods.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.Calls a method on the node model's data service implementation of the given interface registered under the given name and returns the result.<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.Deprecated, for removal: This API element is subject to removal in a future version.Gives direct access to the service implementation.default <S2> S2getService(Class<S2> serviceInterface, String serviceName) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from interface org.knime.core.webui.data.rpc.RpcClient
callService, callServiceWithRes, getService, isConnectedRemotely
-
Method Details
-
callServiceWithRes
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
Futurecontaining 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:RpcClientCalls 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:
callServiceWithResin interfaceRpcClient- Type Parameters:
S2- the interface type of the service to useR- the result type of the invoked method- Parameters:
serviceInterface- the interface of the service to call toserviceName- the name under which the service interface is registered at the server, seeRpcServer.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
Deprecated, for removal: This API element is subject to removal in a future version.Similar tocallServiceWithRes(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:
callServicein interfaceRpcClient- Type Parameters:
S2- the interface type of the service to use- Parameters:
serviceInterface- the interface of the service to callserviceName- the name under which the service interface is registered at the server, seeRpcServer.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
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:RpcClient- Specified by:
getServicein interfaceRpcClient- Returns:
- the service implementation
-