Interface IInterceptorRequest

All Known Implementing Classes:
ServerServicesInterceptorRequestWrapper

public interface IInterceptorRequest
The IInterceptorRequest interface defines a contract for accessing and manipulating HTTP request data in an interceptor context. It provides methods to retrieve request headers, parameters, body content, multipart data, and metadata such as method, URI, and content type.

Implementations of this interface allow interceptors to inspect and interact with HTTP requests in a framework-agnostic manner.

Typical usage includes:

  • Reading request headers and parameters
  • Accessing multipart form data
  • Retrieving the request body as a stream or reader
  • Obtaining request metadata such as method, URI, and content type
  • Method Details

    • getHeader

      String getHeader(String name)
      Returns the value of the specified request header as a String
      Parameters:
      name - - 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

      Enumeration<String> getHeaders(String name)
      Returns all the values of the specified request header as an Enumeration of String objects.
      Parameters:
      name - - 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
    • getHeaderNames

      Enumeration<String> getHeaderNames()
      Gets the names of the headers of this request.
      Returns:
      a Collection of the names of the headers of this request
    • getMethod

      String getMethod()
      Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
      Returns:
      a String specifying the name of the method with which this request was made
    • getParts

      Collection<jakarta.servlet.http.Part> getParts() throws IOException, jakarta.servlet.ServletException
      Gets all the Part components of this request
      Returns:
      Collection of the Part components of this request
      Throws:
      IOException - if an I/O error occurred during the retrieval of the Part components of this request
      jakarta.servlet.ServletException - if this request is not of type multipart/form-data
    • getPart

      jakarta.servlet.http.Part getPart(String name) throws IOException, jakarta.servlet.ServletException
      Gets the Part with the given name.
      Parameters:
      name - - the name of the requested Part
      Returns:
      The Part with the given name
      Throws:
      IOException - if an I/O error occurred during the retrieval of the requested Part
      jakarta.servlet.ServletException - if this request is not of type multipart/form-data
    • getRequestURI

      String getRequestURI()
      Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request
      Returns:
      a String containing the part of the URL from the protocol name up to the query string
    • getInputStream

      jakarta.servlet.ServletInputStream getInputStream() throws IOException
      Retrieves the body of the request as binary data using a ServletInputStream.
      Returns:
      a ServletInputStream object containing the body of the request
      Throws:
      IOException
    • getReader

      BufferedReader getReader() throws IOException
      Retrieves the body of the request as binary data using a BufferedReader.
      Returns:
      a BufferedReader object containing the body of the request
      Throws:
      IOException
    • getParameterMap

      Map<String,String[]> getParameterMap()
      Returns a java.util.Map of the parameters of this request.
      Returns:
      an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
    • getParameter

      String getParameter(String name)
      Returns the value of a request parameter as a String, or null if the parameter does not exist
      Parameters:
      name - - a String specifying the name of the parameter
      Returns:
      a String representing the single value of the parameter
    • getParameterValues

      String[] getParameterValues(String name)
      Returns an array of String objects containing all the values the given request parameter has, or null if the parameter does not exist.
      Parameters:
      name - - a String containing the name of the parameter whose value is requested
      Returns:
      an array of String objects containing the parameter's values
    • getParameterNames

      Enumeration<String> getParameterNames()
      Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration.
      Returns:
      an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters
    • getCharacterEncoding

      String getCharacterEncoding()
      Method to fetch character encoding
      Returns:
      A String that indicates the character encoding
    • getContentLength

      int getContentLength()
      Method to get length of the content in the request
      Returns:
      An int value of the length of request contents
    • getContentLengthLong

      long getContentLengthLong()
      Method to get length of the content in the request
      Returns:
      Long value of the length of request contents
    • getContentType

      String getContentType()
      Method to fetch content-type of the request
      Returns:
      String that indicates the type of the request contents
    • getScheme

      String getScheme()
      Method to fetch scheme of the request
      Returns:
      A String that indicates the scheme of the request