Class WsInfoRequestHandler

  • All Implemented Interfaces:
    com.thetransactioncompany.jsonrpc2.server.RequestHandler

    public class WsInfoRequestHandler
    extends Object
    implements com.thetransactioncompany.jsonrpc2.server.RequestHandler
    Handles JSON-RPC 2.0 requests for general information about a web service. The init(com.nimbusds.common.jsonrpc2.WsInfo) method must be called before servicing requests.

    List of the handled requests:

    • ws.getName Reports the web service name (as a string).
    • ws.getVersion Reports the web service version (as a string).
    • ws.getTime Reports the local server time (as a string).
    • Method Detail

      • init

        public void init​(WsInfo wsInfo)
        Initialises this WS info request handler.
        Parameters:
        wsInfo - The web service name and version to report. Must not be null.
      • handledRequests

        public String[] handledRequests()
        Lists the JSON-RPC 2.0 request method names that this handler processes.
        Specified by:
        handledRequests in interface com.thetransactioncompany.jsonrpc2.server.RequestHandler
        Returns:
        The method names of the served JSON-RPC 2.0 requests.
      • process

        public com.thetransactioncompany.jsonrpc2.JSONRPC2Response process​(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request,
                                                                           com.thetransactioncompany.jsonrpc2.server.MessageContext requestCtx)
        Processes JSON-RPC 2.0 requests for general information about this web service.
        Specified by:
        process in interface com.thetransactioncompany.jsonrpc2.server.RequestHandler
        Parameters:
        request - The JSON-RPC 2.0 request.
        requestCtx - Additional information about the request.
        Returns:
        The JSON-RPC 2.0 response.