Class TableServletBase

    • Method Detail

      • get

        public void get​(String pathInfo,
                        RequestParameters parameters,
                        UnaryOperator<String> requestHeaders,
                        OutputStream out,
                        Consumer<String> contentTypeConsumer,
                        Consumer<String> fileName,
                        Consumer<Integer> httpStatus)
        GET handler lists all rows.

        The return is JSON encoded, unless the "Accept" request header, or the "Accept" request parameter, is "text/csv", in which case CSV is returned.

        Parameters:
        pathInfo - The URL path.
        parameters - Request parameter map.
        requestHeaders - Access to HTTP request headers.
        out - Response body output stream.
        contentTypeConsumer - Receives the content type for specification in the response headers.
        fileName - Receives the filename for specification in the response headers.
        httpStatus - Receives the response status code, in case or error.
      • post

        public void post​(InputStream requestBody,
                         UnaryOperator<String> requestHeaders,
                         OutputStream out,
                         Consumer<String> contentTypeConsumer,
                         Consumer<Integer> httpStatus)
        POST handler - add a new row.
        Parameters:
        requestBody - Stream containing the request body.
        requestHeaders - Access to HTTP request headers.
        out - Response body output stream.
        contentTypeConsumer - Receives the content type for specification in the response headers.
        httpStatus - Receives the response status code, in case or error.
      • put

        public void put​(InputStream requestBody,
                        OutputStream out,
                        Consumer<String> contentTypeConsumer,
                        Consumer<Integer> httpStatus)
        PUT handler - update an existing row.
        Parameters:
        requestBody - Stream supplying the body of the request.
        out - Stream for writing the response.
        contentTypeConsumer - Consumer for receiving the output content type..
        httpStatus - Receives the response status code, in case or error.
      • delete

        public void delete​(String pathInfo,
                           OutputStream out,
                           Consumer<String> contentTypeConsumer,
                           Consumer<Integer> httpStatus)
        DELETE handler - remove existing row.
        Parameters:
        pathInfo - The URL path.
        out - Response body output stream.
        contentTypeConsumer - Receives the content type for specification in the response headers.
        httpStatus - Receives the response status code, in case or error.