Class RestRequest

java.lang.Object
com.codingchili.core.listener.transport.RestRequest
All Implemented Interfaces:
Messageable, Request

public class RestRequest extends Object implements Request
HTTP/REST request object.
  • Constructor Details

    • RestRequest

      public RestRequest(io.vertx.ext.web.RoutingContext context, ListenerSettings settings)
      Parameters:
      context - the routing context for the request.
      settings - listener settings for the listener that created the request.
  • Method Details

    • connection

      public Connection connection()
      Specified by:
      connection in interface Request
      Returns:
      the underlying connection of the request, may be called multiple times per request returning the same connection object.
    • write

      public void write(Object message)
      Description copied from interface: Messageable
      Writes an object to the connection that backs the current request.
      Specified by:
      write in interface Messageable
      Parameters:
      message - the object to be written.
    • data

      public io.vertx.core.json.JsonObject data()
      Description copied from interface: Request
      Get the raw data of the request as a json object
      Specified by:
      data in interface Request
      Returns:
      the raw data of the request
    • timeout

      public int timeout()
      Description copied from interface: Request
      Get the request timeout which indicates how long the sender is waiting until the request is considered to have timed out.

      defaults to #ListenerSettings.DEFAULT_TIMEOUT

      Specified by:
      timeout in interface Request
      Returns:
      milliseconds specifying the timeout of the request
    • size

      public int size()
      Specified by:
      size in interface Request
      Returns:
      the size of the request in bytes.
    • maxSize

      public int maxSize()
      Description copied from interface: Request
      Specified by:
      maxSize in interface Request
      Returns:
      the maximum number of bytes allowed in a single request.
    • send

      protected void send(ResponseStatus status, Throwable e)
    • send

      protected void send(ResponseStatus status)