Interface ILcdRequest

All Known Implementing Classes:
TLcdHttpServletRequestKVPRequestWrapper

public interface ILcdRequest
An interface for web server requests.

This interface must not be implemented by users. It may be subject to change.

The class TLcdServletUtil contains some utility methods related to this ILcdRequest interface. It has convenience methods to see if a request is a request using XML or KVP based on the content type.

  • Method Details

    • getProtocol

      String getProtocol()
      Returns the name and version of the protocol the request uses.
    • getScheme

      String getScheme()
      Returns the name of the scheme used to make this request, for example, http, https, or ftp.
    • getServerName

      String getServerName()
      Returns the host name of the server that received the request.
    • getServerPort

      int getServerPort()
      Returns the port number on which this request was received.
    • getContextPath

      String getContextPath()
      Returns the portion of the request URI that indicates the context of the request.
    • getApplicationPath

      String getApplicationPath()
      Returns the part of this request's URL that calls the servlet.
    • getAttribute

      Object getAttribute(String aAttributeName)
      Returns the attribute value.
      Parameters:
      aAttributeName - the name of the attribute.
      Returns:
      the attribute value.
      Since:
      2017.0
    • getAttributeNames

      Enumeration<String> getAttributeNames()
      Returns an Enumeration containing the names of the attributes available to this request. This method returns an empty Enumeration if the request has no attributes available to it.
      Returns:
      an Enumeration of strings containing the names of the request's attributes
      Since:
      2017.0
    • removeAttribute

      void removeAttribute(String aAttributeName)
      Removes an attribute from this request.
      Parameters:
      aAttributeName - the name of the attribute.
    • setAttribute

      void setAttribute(String aAttributeName, Object aAttributeObject)
      Stores an attribute in this request.
      Parameters:
      aAttributeName - the name of the attribute.
      aAttributeObject - the value of the attribute.
    • getUserPrincipal

      Principal getUserPrincipal()
      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.
      Returns:
      a java.security.Principal containing the name of the user making this request; null if the user has not been authenticated
      Since:
      2017.0
      See Also:
      • HttpServletRequest.getUserPrincipal()
    • isUserInRole

      boolean isUserInRole(String aRole)
      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.
      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
      Since:
      2017.0
      See Also:
      • HttpServletRequest.isUserInRole(String)
    • getParameterNames

      List<String> getParameterNames()
      Returns an unmodifiable list containing the names of all the parameters that are specified in this request.
      Returns:
      a list of parameter names.
      Since:
      2017.0
    • getParameter

      String getParameter(String aParameterName)
      Returns the value of the parameter with the given name.
      Parameters:
      aParameterName - the parameter name
      Returns:
      the value of the specified parameter or null if the parameter was not specified
      Since:
      2017.0
    • getParameterIgnoreCase

      String getParameterIgnoreCase(String aParameterName)
      A case-insensitive version of getParameter().
      Parameters:
      aParameterName - the parameter name
      Returns:
      the value of the specified parameter or null if the parameter was not specified
      Since:
      2017.0
    • getContentType

      String getContentType()
      Returns the MIME type of the body of the request, or null if the type is not known.
      Returns:
      the String with the MIME type of the request, or null if the type is not known.
      Since:
      2017.0
      See Also:
    • getInputStream

      InputStream getInputStream() throws IOException
      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.

      Returns:
      the body of the request as an input stream.
      Throws:
      IOException - if an input exception occurs.
      Since:
      2017.0
    • getDateHeader

      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.

      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
      Since:
      2017.0
    • getHeader

      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.
      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
      Since:
      2017.0