Interface RequestHandler<S extends ServerConnection<S>>

Type Parameters:
S - server connection type
All Known Implementing Classes:
ControlMessageHandler, FailingRequestHandler, ServerAuthenticationHandler

public interface RequestHandler<S extends ServerConnection<S>>
Note that if a handler maintains any internal state, the state will be disposed if the handler on the connection changes. So handler should not maintain state.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(S connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender)
    Handle request of given type (rpcType) with message (pBody) and optional data (dBody) on the connection, and return the appropriate response.
  • Method Details

    • handle

      void handle(S connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) throws RpcException
      Handle request of given type (rpcType) with message (pBody) and optional data (dBody) on the connection, and return the appropriate response. The method must do one of three things: + use send the response + throw UserRpcException, in which case a response will be sent using send + throw an Exception, in which case, the connection will be dropped
      Parameters:
      connection - remote connection
      rpcType - rpc type
      pBody - message
      dBody - data, maybe null
      sender - used to send the response
      Throws:
      RpcException