Interface RpcHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Core interface representing the handling of an RPC call.
Generally, this should not be implemented directly - instead, use RpcDelegate to make your standard Java
interface into an RPC interface.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable StringThe identifier that will be looked up in the project's permissions system to determine if the caller has permission to invoke this function.@Nullable Objecthandle(@NotNull RpcContext context, @NotNull List<Object> parameters) Does the actual work of the RPC call.default booleandefault @NotNull MutabilityMode
-
Method Details
-
handle
@Nullable @Nullable Object handle(@NotNull @NotNull RpcContext context, @NotNull @NotNull List<Object> parameters) throws Throwable Does the actual work of the RPC call.- Returns:
- Some arbtirary return value, to be serialized and written back to the invoker via the
GatewayRpcSerializer. Ifhandlereturns null, the serializer will not be invoked, and you must useRpcContext.response()to send a response manually. - Throws:
Throwable- if any error occurs during the handling of the RPC call. This will be caught and sent back to the client.
-
isActiveNodeRequired
default boolean isActiveNodeRequired()- Returns:
- true if the gateway handling this RPC call has to be an 'active' node (Master or Independent).
- See Also:
-
clientPermissionId
The identifier that will be looked up in the project's permissions system to determine if the caller has permission to invoke this function.The default value is
null, meaning the function can only be invoked by a Designer.Return
ClientPermissionsConstants.UNRESTRICTEDto allow any client to invoke this function.- See Also:
-
requiredMutabilityMode
- Returns:
- The minimum mutability mode the session must have for this RPC handler to be invoked. The default value is OFF, meaning a session with any mutability mode is allowed to invoke, but you can tighten that restriction as appropriate.
- See Also:
-