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.

@FunctionalInterface public interface RpcHandler
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 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. If handle returns null, the serializer will not be invoked, and you must use RpcContext.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

      @Nullable default @Nullable String 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.UNRESTRICTED to allow any client to invoke this function.

      See Also:
    • requiredMutabilityMode

      @NotNull default @NotNull MutabilityMode 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: