Interface RestRequestService


  • public interface RestRequestService
    RestRequestService defines a service that handles RestRequest. Typically, a RestRequestService is expected to receive requests and handle them as required and either send a response (if immediately available) or pass control to another component that does further handling and generates a response. Most operations are performed async and responses are therefore queued asynchronously instead of being available at the end of the function call. Implementations are expected to be thread-safe.
    • Method Detail

      • start

        void start()
            throws java.lang.InstantiationException
        Does startup tasks for the RestRequestService. When the function returns, startup is FULLY complete.
        Throws:
        java.lang.InstantiationException - if RestRequestService is unable to start.
      • shutdown

        void shutdown()
        Does shutdown tasks for the RestRequestService. When the function returns, shutdown is FULLY complete.
      • handleGet

        void handleGet​(RestRequest restRequest,
                       RestResponseChannel restResponseChannel)
        Handles a GET operation.

        The restRequest provided will have both metadata and any content associated with the request. The restResponseChannel can be used to send responses to the client.

        Parameters:
        restRequest - the RestRequest that needs to be handled.
        restResponseChannel - the RestResponseChannel over which response to restRequest can be sent.
      • handlePost

        void handlePost​(RestRequest restRequest,
                        RestResponseChannel restResponseChannel)
        Handles a POST operation.

        The restRequest provided will have both metadata and any content associated with the request. The restResponseChannel can be used to send responses to the client.

        Parameters:
        restRequest - the RestRequest that needs to be handled.
        restResponseChannel - the RestResponseChannel over which response to restRequest can be sent.
      • handlePut

        void handlePut​(RestRequest restRequest,
                       RestResponseChannel restResponseChannel)
        Handles a PUT operation.

        The restRequest provided will have both metadata and any content associated with the request. The restResponseChannel can be used to send responses to the client.

        Parameters:
        restRequest - the RestRequest that needs to be handled.
        restResponseChannel - the RestResponseChannel over which response to restRequest can be sent.
      • handleDelete

        void handleDelete​(RestRequest restRequest,
                          RestResponseChannel restResponseChannel)
        Handles a DELETE operation.

        The restRequest provided will have both metadata and any content associated with the request. The restResponseChannel can be used to send responses to the client.

        Parameters:
        restRequest - the RestRequest that needs to be handled.
        restResponseChannel - the RestResponseChannel over which response to restRequest can be sent.
      • handleHead

        void handleHead​(RestRequest restRequest,
                        RestResponseChannel restResponseChannel)
        Handles a HEAD operation.

        The restRequest provided will have both metadata and any content associated with the request. The restResponseChannel can be used to send responses to the client.

        Parameters:
        restRequest - the RestRequest that needs to be handled.
        restResponseChannel - the RestResponseChannel over which response to restRequest can be sent.
      • handleOptions

        void handleOptions​(RestRequest restRequest,
                           RestResponseChannel restResponseChannel)
        Handles an OPTIONS request.

        The restRequest provided will have both metadata and any content associated with the request. The restResponseChannel can be used to send responses to the client.

        Parameters:
        restRequest - the RestRequest that needs to be handled.
        restResponseChannel - the RestResponseChannel over which response to restRequest can be sent.