Interface CometDRequest


public interface CometDRequest

An abstraction over HTTP requests.

This abstraction allows CometD to be independent from Servlet, or server-specific HTTP APIs.

  • Method Details

    • getMethod

      String getMethod()
      Returns:
      the HTTP method
    • getProtocol

      String getProtocol()
      Returns:
      the HTTP protocol version
    • getParameterValues

      List<String> getParameterValues(String name)
      Parameters:
      name - the query parameter name
      Returns:
      the values of the given query parameter
    • getCharacterEncoding

      String getCharacterEncoding()
      Returns:
      the charset of the request body
    • getCookie

      String getCookie(String name)
      Returns:
      the value of the request cookie with the given name, or null if there is no such cookie
    • getInput

      Returns:
      the input to read the request body from
    • getAttribute

      Object getAttribute(String name)
      Parameters:
      name - the attribute name
      Returns:
      the value of the attribute with the given name, or null if not such attribute exists
    • setAttribute

      void setAttribute(String name, Object value)
      Parameters:
      name - the attribute name
      value - the attribute value
    • addFailureHandler

      void addFailureHandler(Consumer<Throwable> handler)

      Adds the given handler function to be invoked when a failure is detected for this request.

      Parameters:
      handler - the failure handler function