Package com.oorian

Interface OorianHttpRequest

All Known Implementing Classes:
JakartaHttpRequest, MockOorianHttpRequest, TestHttpRequest

public interface OorianHttpRequest
Abstraction layer for HTTP request access, decoupling framework code from servlet API specifics.

This interface wraps the subset of HTTP request methods used by the Oorian framework, allowing the core library to operate without direct servlet API dependencies. Implementations are provided by the thin Jakarta and J2EE libraries.

Since:
2.1
Version:
1.0
Author:
Marvin P. Warble Jr.
  • Method Details

    • getHeader

      String getHeader(String name)
      Returns the value of the specified request header.
      Parameters:
      name - the header name
      Returns:
      the header value, or null if not present
    • getPathInfo

      String getPathInfo()
      Returns the path info portion of the request URL.
      Returns:
      the path info, or null if none
    • getQueryString

      String getQueryString()
      Returns the query string portion of the request URL.
      Returns:
      the query string, or null if none
    • getRequestURL

      StringBuffer getRequestURL()
      Returns the request URL as a StringBuffer.
      Returns:
      the request URL
    • getRequestURI

      String getRequestURI()
      Returns the request URI.
      Returns:
      the request URI
    • getServletPath

      String getServletPath()
      Returns the servlet path portion of the request URL.
      Returns:
      the servlet path
    • getParameter

      String getParameter(String name)
      Returns the value of a request parameter.
      Parameters:
      name - the parameter name
      Returns:
      the parameter value, or null if not present
    • getParameterMap

      Map<String,String[]> getParameterMap()
      Returns a map of all request parameters.
      Returns:
      the parameter map
    • getContentType

      String getContentType()
      Returns the content type of the request body.
      Returns:
      the content type, or null if not specified
    • getCharacterEncoding

      String getCharacterEncoding()
      Returns the character encoding of the request body.
      Returns:
      the character encoding, or null if not specified
    • getRemoteAddr

      String getRemoteAddr()
      Returns the IP address of the client that sent the request.
      Returns:
      the remote address
    • getContextPath

      String getContextPath()
      Returns the context path of the web application.
      Returns:
      the context path
    • getCookies

      OorianCookie[] getCookies()
      Returns the cookies sent with this request.
      Returns:
      an array of cookies, or null if no cookies were sent
    • getParts

      Returns the multipart parts of this request.
      Returns:
      a collection of upload parts
      Throws:
      IOException - if an I/O error occurs
    • getSession

      OorianHttpSession getSession(boolean create)
      Returns the session associated with this request.
      Parameters:
      create - whether to create a new session if one doesn't exist
      Returns:
      the web session, or null if create is false and no session exists
    • getServerName

      String getServerName()
      Returns the name of the server that received the request.
      Returns:
      the server name
    • getMethod

      String getMethod()
      Returns the HTTP method of this request (GET, POST, PUT, DELETE, etc.).
      Returns:
      the HTTP method name
    • getReader

      BufferedReader getReader() throws IOException
      Returns a BufferedReader for reading the request body as character data.
      Returns:
      a BufferedReader for reading the request body
      Throws:
      IOException - if an I/O error occurs
    • getInputStream

      InputStream getInputStream() throws IOException
      Returns an input stream for reading the request body as binary data.
      Returns:
      the input stream
      Throws:
      IOException - if an I/O error occurs
    • getScheme

      String getScheme()
      Returns the scheme (protocol) used for the request (e.g., "http" or "https").
      Returns:
      the scheme
    • getServerPort

      int getServerPort()
      Returns the port number on which the request was received.
      Returns:
      the server port
    • isSecure

      boolean isSecure()
      Returns whether this request was made using a secure channel (HTTPS).
      Returns:
      true if the request is secure
    • getHeaderNames

      Enumeration<String> getHeaderNames()
      Returns an enumeration of all header names in this request.
      Returns:
      an enumeration of header names
    • getHeaders

      Enumeration<String> getHeaders(String name)
      Returns all values of the specified request header as an enumeration.
      Parameters:
      name - the header name
      Returns:
      an enumeration of header values
    • getContentLength

      int getContentLength()
      Returns the length of the request body in bytes, or -1 if not known.
      Returns:
      the content length, or -1
    • getAttribute

      Object getAttribute(String name)
      Returns the value of the specified request attribute.
      Parameters:
      name - the attribute name
      Returns:
      the attribute value, or null if not set
    • setAttribute

      void setAttribute(String name, Object value)
      Sets a request attribute.
      Parameters:
      name - the attribute name
      value - the attribute value
    • getLocale

      Locale getLocale()
      Returns the preferred locale of the client, based on the Accept-Language header.
      Returns:
      the preferred locale
    • changeSessionId

      String changeSessionId()
      Changes the session ID associated with this request.

      This method generates a new session ID for the current session while preserving all session attributes. It is used for session fixation protection after authentication.

      Returns:
      the new session ID