Interface RequestWrapper

All Superinterfaces:
Messageable, Request

public interface RequestWrapper extends Request
Wraps a request to allow decorating request objects without re-initializing the source request. Implement by handler-specific request classes.
  • Field Summary

    Fields inherited from interface com.codingchili.core.listener.Request

    TARGET_UNDEFINED
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Accepts the request indicating that it was processed successfully but that there is no response.
    default Connection
     
    default io.vertx.core.json.JsonObject
    Get the raw data of the request as a json object
    default void
    error​(Throwable exception)
    Write an error and code to the response.
    default int
     
    default String
    Get the route from the request, the route specifies with method that should be invoked.
    default int
     
    default String
    The target node of the request.
    default int
    Get the request timeout which indicates how long the sender is waiting until the request is considered to have timed out.
    default Token
    Get the request token sent with the request.
    default void
    write​(Object object)
    Writes an object to the connection that backs the current request.

    Methods inherited from interface com.codingchili.core.listener.Request

    result
  • Method Details

    • request

      Request request()
      Returns:
      the wrapped request.
    • write

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

      default void accept()
      Description copied from interface: Request
      Accepts the request indicating that it was processed successfully but that there is no response.
      Specified by:
      accept in interface Request
    • error

      default void error(Throwable exception)
      Description copied from interface: Request
      Write an error and code to the response.
      Specified by:
      error in interface Request
      Parameters:
      exception - the exception that caused the error.
    • route

      default String route()
      Description copied from interface: Request
      Get the route from the request, the route specifies with method that should be invoked.
      Specified by:
      route in interface Request
      Returns:
      the requested route
    • target

      default String target()
      Description copied from interface: Request
      The target node of the request. The target specifies which service or which sub-service that the requested route resides in.
      Specified by:
      target in interface Request
      Returns:
      the target node
    • token

      default Token token()
      Description copied from interface: Request
      Get the request token sent with the request.
      Specified by:
      token in interface Request
      Returns:
      the requests token
    • connection

      default 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.
    • data

      default 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

      default 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

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

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