Class TLcdHttpServletRequestKVPRequestWrapper

java.lang.Object
com.luciad.ogc.common.TLcdHttpServletRequestKVPRequestWrapper
All Implemented Interfaces:
ILcdRequest

public class TLcdHttpServletRequestKVPRequestWrapper extends Object implements ILcdRequest
A wrapper for HttpServletRequest objects.
  • Constructor Details

    • TLcdHttpServletRequestKVPRequestWrapper

      public TLcdHttpServletRequestKVPRequestWrapper(jakarta.servlet.http.HttpServletRequest aHttpServletRequest)
      Creates a wrapper object for KVP requests.
      Parameters:
      aHttpServletRequest - The HttpServletRequest object around which to build a wrapper.
  • Method Details

    • getParameter

      public String getParameter(String aParameterName)
      Returns the value of the parameter with the given name. Only valid for KVP requests.
      Specified by:
      getParameter in interface ILcdRequest
      Parameters:
      aParameterName - the parameter name
      Returns:
      the value of the specified parameter or null if the parameter was not specified
    • getParameterNames

      public List<String> getParameterNames()
      Returns an unmodifiable list containing the names of all the parameters that are specified in this request. Only valid for KVP requests.
      Specified by:
      getParameterNames in interface ILcdRequest
      Returns:
      a list of parameter names.
    • getParameterIgnoreCase

      public String getParameterIgnoreCase(String aParameterName)
      A case-insensitive version of getParameter(). Only valid for KVP requests.
      Specified by:
      getParameterIgnoreCase in interface ILcdRequest
      Parameters:
      aParameterName - the parameter name
      Returns:
      the value of the specified parameter or null if the parameter was not specified
    • getProtocol

      public String getProtocol()
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      getProtocol in interface ILcdRequest
    • getScheme

      public String getScheme()
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      getScheme in interface ILcdRequest
    • getServerName

      public String getServerName()
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      getServerName in interface ILcdRequest
    • getServerPort

      public int getServerPort()
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      getServerPort in interface ILcdRequest
    • getContextPath

      public String getContextPath()
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      getContextPath in interface ILcdRequest
    • getApplicationPath

      public String getApplicationPath()
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      getApplicationPath in interface ILcdRequest
    • getAttribute

      public Object getAttribute(String aAttributeName)
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      getAttribute in interface ILcdRequest
      Parameters:
      aAttributeName - the name of the attribute.
      Returns:
      the attribute value.
    • getAttributeNames

      public Enumeration<String> getAttributeNames()
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      getAttributeNames in interface ILcdRequest
      Returns:
      an Enumeration of strings containing the names of the request's attributes
    • removeAttribute

      public void removeAttribute(String aAttributeName)
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      removeAttribute in interface ILcdRequest
      Parameters:
      aAttributeName - the name of the attribute.
    • setAttribute

      public void setAttribute(String aAttributeName, Object aAttributeObject)
      Delegates to the corresponding method in HttpServletRequest.
      Specified by:
      setAttribute in interface ILcdRequest
      Parameters:
      aAttributeName - the name of the attribute.
      aAttributeObject - the value of the attribute.
    • getHeader

      public String getHeader(String aName)
      Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. The header name is case insensitive. You can use this method with any request header.
      Specified by:
      getHeader in interface ILcdRequest
      Parameters:
      aName - a String specifying the header name
      Returns:
      a String containing the value of the requested header, or null if the request does not have a header of that name
    • getHeaders

      public Enumeration getHeaders(String aName)
      Returns all the values of the specified request header as an Enumeration of String objects.

      Some headers, such as Accept-Language can be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.

      If the request did not include any headers of the specified name, this method returns an empty Enumeration. The header name is case insensitive. You can use this method with any request header.

      Parameters:
      aName - a String specifying the header name
      Returns:
      an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null
    • getHeaderNames

      public Enumeration getHeaderNames()
      Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration.

      Some servlet containers do not allow do not allow servlets to access headers using this method, in which case this method returns null

      Returns:
      an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the servlet container does not allow servlets to use this method, null
    • getIntHeader

      public int getIntHeader(String aName)
      Returns the value of the specified request header as an int. If the request does not have a header of the specified name, this method returns -1. If the header cannot be converted to an integer, this method throws a NumberFormatException.

      The header name is case insensitive.

      Parameters:
      aName - a String specifying the name of a request header
      Returns:
      an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
      Throws:
      NumberFormatException - If the header value can't be converted to an int
    • getDateHeader

      public long getDateHeader(String aName)
      Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such as If-Modified-Since.

      The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.

      If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException.

      Specified by:
      getDateHeader in interface ILcdRequest
      Parameters:
      aName - a String specifying the name of the header
      Returns:
      a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the reqest
      Throws:
      IllegalArgumentException - If the header value can't be converted to a date
    • getUserPrincipal

      public Principal getUserPrincipal()
      Description copied from interface: ILcdRequest
      Returns a java.security.Principal object containing the name of the current authenticated user. If the user has not been authenticated, the method returns null.
      Specified by:
      getUserPrincipal in interface ILcdRequest
      Returns:
      a java.security.Principal containing the name of the user making this request; null if the user has not been authenticated
      See Also:
      • HttpServletRequest.getUserPrincipal()
    • isUserInRole

      public boolean isUserInRole(String aRole)
      Description copied from interface: ILcdRequest
      Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and role membership can be defined using deployment descriptors. If the user has not been authenticated, the method returns false.
      Specified by:
      isUserInRole in interface ILcdRequest
      Parameters:
      aRole - a String specifying the name of the role
      Returns:
      a boolean indicating whether the user making this request belongs to a given role; false if the user has not been authenticated
      See Also:
      • HttpServletRequest.isUserInRole(String)
    • getContentType

      public String getContentType()
      Description copied from interface: ILcdRequest
      Returns the MIME type of the body of the request, or null if the type is not known.
      Specified by:
      getContentType in interface ILcdRequest
      Returns:
      the String with the MIME type of the request, or null if the type is not known.
      See Also:
    • getInputStream

      public InputStream getInputStream() throws IOException
      Description copied from interface: ILcdRequest
      Returns the body of the request as an input stream. The returned input stream must support the method InputStream.mark(int) and thus return true for InputStream.markSupported().

      This is important as the command dispatcher needs to take a peek into the request to determine which request handler knows to deal with the client request.

      Specified by:
      getInputStream in interface ILcdRequest
      Returns:
      the body of the request as an input stream.
      Throws:
      IOException - if an input exception occurs.
    • getHttpServletRequest

      public jakarta.servlet.http.HttpServletRequest getHttpServletRequest()