Class RequestDetails

java.lang.Object
org.apache.guacamole.net.RequestDetails

public class RequestDetails extends Object
A copy of the details of an HTTP request. The values within this object can be accessed even when outside the scope of the specific request represented.
  • Constructor Details

    • RequestDetails

      public RequestDetails(javax.servlet.http.HttpServletRequest request)
      Creates a new RequestDetails that copies the details of the given HTTP request. The provided request may safely go out of scope and be reused for future requests without rendering the content of this RequestDetails invalid or inaccessible.

      Though an HttpSession will be retrieved from the given request if the HttpSession already exists on the request, no HttpSession will be created through invoking this constructor.

      Parameters:
      request - The HTTP request to copy the details of.
    • RequestDetails

      public RequestDetails(RequestDetails requestDetails)
      Creates a new RequestDetails that copies the details of the given RequestDetails.
      Parameters:
      requestDetails - The RequestDetails to copy.
  • Method Details

    • getHeader

      public String getHeader(String name)
      Returns the value of the HTTP header having the given name. Header names are case-insensitive. If no such header was present, null is returned. If the header had multiple values, the first value is returned.
      Parameters:
      name - The name of the header to retrieve. This name is case-insensitive.
      Returns:
      The first value of the HTTP header with the given name, or null if there is no such header.
    • getHeaders

      public List<String> getHeaders(String name)
      Returns an unmodifiable List of all values of the HTTP header having the given name. Header names are case-insensitive. If no such header was present, the returned List will be empty.
      Parameters:
      name - The name of the header to retrieve. This name is case-insensitive.
      Returns:
      An unmodifiable List of all values of the HTTP header with the given name, or an empty List if there is no such header.
    • getHeaderNames

      public Set<String> getHeaderNames()
      Returns an unmodifiable Set of the names of all HTTP headers present on the request. If there are no headers, this set will be empty. Header names are case-insensitive, and the returned Set will perform lookups in a case-insensitive manner.
      Returns:
      An unmodifiable Set of the names of all HTTP headers present on the request.
    • getHeaders

      public Map<String,List<String>> getHeaders()
      Returns an unmodifiable Map of all values of all HTTP headers on the request, where each Map key is a header name. Each Map value is an unmodifiable List of all values provided for the associated header and will contain at least one value. Header names are case-insensitive, and the returned map will perform lookups in a case-insensitive manner.
      Returns:
      An unmodifiable Map of all values of all HTTP headers on the request.
    • getParameter

      public String getParameter(String name)
      Returns the value of the HTTP parameter having the given name. Parameter names are case-sensitive. If no such parameter was present, null is returned. If the parameter had multiple values, the first value is returned.
      Parameters:
      name - The name of the parameter to retrieve. This name is case-sensitive.
      Returns:
      The first value of the HTTP parameter with the given name, or null if there is no such parameter.
    • getParameters

      public List<String> getParameters(String name)
      Returns an unmodifiable List of all values of the HTTP parameter having the given name. Parameter names are case-sensitive. If no such parameter was present, the returned List will be empty.
      Parameters:
      name - The name of the parameter to retrieve. This name is case-sensitive.
      Returns:
      An unmodifiable List of all values of the HTTP parameter with the given name, or an empty List if there is no such parameter.
    • getParameterNames

      public Set<String> getParameterNames()
      Returns an unmodifiable Set of the names of all HTTP parameters present on the request. If there are no parameters, this set will be empty. Parameter names are case-sensitive, and the returned Set will perform lookups in a case-sensitive manner.
      Returns:
      An unmodifiable Set of the names of all HTTP parameters present on the request.
    • getParameters

      public Map<String,List<String>> getParameters()
      Returns an unmodifiable Map of all values of all HTTP parameters on the request, where each Map key is a parameter name. Each Map value is an unmodifiable List of all values provided for the associated parameter and will contain at least one value. Parameter names are case-sensitive, and the returned map will perform lookups in a case-sensitive manner.
      Returns:
      An unmodifiable Map of all values of all HTTP parameters on the request.
    • getCookies

      public List<javax.servlet.http.Cookie> getCookies()
      Returns an unmodifiable List of all cookies in the request. If no cookies are present, the returned List will be empty.
      Returns:
      An unmodifiable List of all cookies in the request, which may an empty List.
    • getSession

      public javax.servlet.http.HttpSession getSession()
      Returns the HttpSession associated with the request, if any.

      NOTE: Guacamole itself does not use the HttpSession. The extension subsystem does not provide access to the session object used by Guacamole, which is considered internal. Access to an HttpSession is only of use if you have another application in place that does use HttpSession and needs to be considered.

      Returns:
      The HttpSession associated with the request, or null if there is no HttpSession.
    • getRemoteAddress

      public String getRemoteAddress()
      Returns the address of the client that sent the associated request.
      Returns:
      The address of the client that sent the request.
    • getRemoteHostname

      public String getRemoteHostname()
      Returns the hostname of the client that sent the associated request, if known. If the hostname of the client cannot be determined, the address will be returned instead.
      Returns:
      The hostname or address of the client that sent the request.