Interface HttpUserRequest

All Known Implementing Classes:
DefaultHttpUserRequest, ServletApiHttpUserRequest

public interface HttpUserRequest
Representation of the HTTP request message that is received by the SignService application/frontend.

In cases where the SignService deployment is a combined front- and backend the HttpUserRequest will be a direct mapping of the incoming HTTP request. If the SignService deployment consists of a frontend and a backend, the frontend application needs to translate the incoming HTTP request into a HttpUserRequest instance that can be transfered between the front- and backend (for example in a REST API-call).

  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the client IP address.
    Gets the value of the specified request header.
    Gets a map of all request headers where the map entry key is the header name and the map entry value is the header value(s).
    Gets the HTTP method with which this request was made (i.e., GET, POST, PUT, ...).
    Gets the value of a request parameter as a string, or null if the parameter does not exist.
    Gets a map of all request parameters, where the map entry key is the parameter name and the map entry value(s) is the parameter value.
    Gets the complete request URL of the user HTTP request that was received by the frontend.
    Gets the frontend "server base URL", which is the protocol, host and context path.
    Gets the part of this request's URL that calls the frontend's servlet.
  • Method Details

    • getMethod

      @Nonnull String getMethod()
      Gets the HTTP method with which this request was made (i.e., GET, POST, PUT, ...).
      Returns:
      name of HTTP method used to send the request
    • getRequestUrl

      @Nonnull String getRequestUrl()
      Gets the complete request URL of the user HTTP request that was received by the frontend. This includes the protocol, host, (port), context path and servlet path. This string does not include any potential query parameters.
      Returns:
      complete request URL
    • getServerBaseUrl

      @Nonnull String getServerBaseUrl()
      Gets the frontend "server base URL", which is the protocol, host and context path.
      Returns:
      the frontend server base URL
    • getServerServletPath

      @Nonnull String getServerServletPath()
      Gets the part of this request's URL that calls the frontend's servlet. This path starts with a "/" character and includes either the servlet name or a path to the servlet, but does not include any extra path information or a query string.

      This method will return an empty string ("") if the servlet used to process this request was matched using the "/*" pattern.

      Returns:
      the frontend's servlet path that matched this request
    • getClientIpAddress

      @Nonnull String getClientIpAddress()
      Gets the client IP address.
      Returns:
      the client IP addres
    • getParameter

      @Nullable String getParameter(@Nonnull String name)
      Gets the value of a request parameter as a string, or null if the parameter does not exist.

      Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

      In case you know, or want to be sure, that the parameter contains multiple values, use getParameters().

      Parameters:
      name - the parameter name
      Returns:
      the parameter value, or null if it does not exist
      See Also:
    • getParameters

      @Nonnull Map<String,String[]> getParameters()
      Gets a map of all request parameters, where the map entry key is the parameter name and the map entry value(s) is the parameter value.

      Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

      Returns:
      a map (possibly empty) of parameter names and values
      See Also:
    • getHeader

      @Nullable String getHeader(@Nonnull String name)
      Gets the value of the specified request header. If the request did not include a header of the specified name, this method returns null.

      If there are multiple headers with the same name, this method returns the first header value in the request.

      Note: The header name is case insensitive.

      Parameters:
      name - the header name
      Returns:
      the header value, or null
      See Also:
    • getHeaders

      @Nonnull Map<String,String[]> getHeaders()
      Gets a map of all request headers where the map entry key is the header name and the map entry value is the header value(s).
      Returns:
      a (possibly empty) map of header names and values
      See Also: