java.lang.Object
com.yahoo.application.container.handler.Request

public class Request extends Object
A request for use with JDisc.handleRequest(Request).
Author:
Einar M R Rosenvinge
See Also:
  • Constructor Details

    • Request

      public Request(String uri)
      Creates a Request with an empty body.
      Parameters:
      uri - the URI of the request
    • Request

      public Request(String uri, byte[] body)
      Creates a GET Request with a message body.
      Parameters:
      uri - the URI of the request
      body - the body of the request
    • Request

      public Request(String uri, String body)
      Creates a GET Request with a message body.
      Parameters:
      uri - the URI of the request
      body - the body of the request as a UTF-8 string
    • Request

      public Request(String uri, byte[] body, Request.Method method)
      Creates a Request with a message body.
      Parameters:
      uri - the URI of the request
      body - the body of the request
    • Request

      public Request(String uri, byte[] body, Request.Method method, Principal principal)
      Creates a Request with a message body, method and user principal.
      Parameters:
      uri - the URI of the request
      body - the body of the request
      method - the method of the request
      principal - the user principal of the request
    • Request

      public Request(String uri, byte[] body, Request.Method method, Principal principal, SocketAddress remoteAddress)
      Creates a Request with a message body, method and user principal.
      Parameters:
      uri - the URI of the request
      body - the body of the request
      method - the method of the request
      principal - the user principal of the request
      remoteAddress - the remote address of the request
    • Request

      public Request(String uri, String body, Request.Method method)
      Creates a Request with a message body.
      Parameters:
      uri - the URI of the request
      body - the body of the request as a UTF-8 string
  • Method Details

    • getHeaders

      public Headers getHeaders()
      Returns a mutable multi-map of headers for this Request.
      Returns:
      a mutable multi-map of headers for this Request
    • getBody

      public byte[] getBody()
      Returns the body of this Request.
      Returns:
      the body of this Request
    • getUri

      public String getUri()
      Returns the URI of this Request.
      Returns:
      the URI of this Request
    • getAttributes

      public Map<String,Object> getAttributes()
      Returns:
      a mutable attribute map for this request.
    • remoteAddress

      public Optional<SocketAddress> remoteAddress()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getMethod

      public Request.Method getMethod()
    • getUserPrincipal

      public Optional<Principal> getUserPrincipal()