Class ServerServicesInterceptorRequestWrapper

java.lang.Object
com.esri.arcgis.enterprise.interceptor.server.ServerServicesInterceptorRequestWrapper
All Implemented Interfaces:
IInterceptorRequest

public class ServerServicesInterceptorRequestWrapper extends Object implements IInterceptorRequest
The ServerServicesInterceptorRequestWrapper class is an implementation of the IInterceptorRequest interface that wraps an underlying HttpServletRequest.

This wrapper delegates all request-related operations to the underlying HttpServletRequest, enabling interceptors to interact with HTTP request data in a consistent and framework-agnostic manner. It also provides access to the original IInterceptorRequest and uses reflection to extract the underlying servlet request when necessary.

Typical usage includes:

  • Accessing HTTP headers, parameters, and request metadata
  • Retrieving multipart request parts
  • Obtaining input streams and readers for request data
  • Chaining and unwrapping nested interceptor requests
  • Constructor Details

    • ServerServicesInterceptorRequestWrapper

      public ServerServicesInterceptorRequestWrapper(IInterceptorRequest interceptorRequest)
  • Method Details

    • getHeader

      public String getHeader(String name)
      Description copied from interface: IInterceptorRequest
      Returns the value of the specified request header as a String
      Specified by:
      getHeader in interface IInterceptorRequest
      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

      public Enumeration<String> getHeaders(String name)
      Description copied from interface: IInterceptorRequest
      Returns all the values of the specified request header as an Enumeration of String objects.
      Specified by:
      getHeaders in interface IInterceptorRequest
      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

      public Enumeration<String> getHeaderNames()
      Description copied from interface: IInterceptorRequest
      Gets the names of the headers of this request.
      Specified by:
      getHeaderNames in interface IInterceptorRequest
      Returns:
      a Collection of the names of the headers of this request
    • getMethod

      public String getMethod()
      Description copied from interface: IInterceptorRequest
      Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
      Specified by:
      getMethod in interface IInterceptorRequest
      Returns:
      a String specifying the name of the method with which this request was made
    • getParts

      public Collection<jakarta.servlet.http.Part> getParts() throws IOException, jakarta.servlet.ServletException
      Description copied from interface: IInterceptorRequest
      Gets all the Part components of this request
      Specified by:
      getParts in interface IInterceptorRequest
      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

      public jakarta.servlet.http.Part getPart(String name) throws IOException, jakarta.servlet.ServletException
      Description copied from interface: IInterceptorRequest
      Gets the Part with the given name.
      Specified by:
      getPart in interface IInterceptorRequest
      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

      public String getRequestURI()
      Description copied from interface: IInterceptorRequest
      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
      Specified by:
      getRequestURI in interface IInterceptorRequest
      Returns:
      a String containing the part of the URL from the protocol name up to the query string
    • getInputStream

      public jakarta.servlet.ServletInputStream getInputStream() throws IOException
      Description copied from interface: IInterceptorRequest
      Retrieves the body of the request as binary data using a ServletInputStream.
      Specified by:
      getInputStream in interface IInterceptorRequest
      Returns:
      a ServletInputStream object containing the body of the request
      Throws:
      IOException
    • getReader

      public BufferedReader getReader() throws IOException
      Description copied from interface: IInterceptorRequest
      Retrieves the body of the request as binary data using a BufferedReader.
      Specified by:
      getReader in interface IInterceptorRequest
      Returns:
      a BufferedReader object containing the body of the request
      Throws:
      IOException
    • getParameterMap

      public Map<String,String[]> getParameterMap()
      Description copied from interface: IInterceptorRequest
      Returns a java.util.Map of the parameters of this request.
      Specified by:
      getParameterMap in interface IInterceptorRequest
      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

      public String getParameter(String name)
      Description copied from interface: IInterceptorRequest
      Returns the value of a request parameter as a String, or null if the parameter does not exist
      Specified by:
      getParameter in interface IInterceptorRequest
      Parameters:
      name - - a String specifying the name of the parameter
      Returns:
      a String representing the single value of the parameter
    • getParameterValues

      public String[] getParameterValues(String name)
      Description copied from interface: IInterceptorRequest
      Returns an array of String objects containing all the values the given request parameter has, or null if the parameter does not exist.
      Specified by:
      getParameterValues in interface IInterceptorRequest
      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

      public Enumeration<String> getParameterNames()
      Description copied from interface: IInterceptorRequest
      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.
      Specified by:
      getParameterNames in interface IInterceptorRequest
      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

      public String getCharacterEncoding()
      Description copied from interface: IInterceptorRequest
      Method to fetch character encoding
      Specified by:
      getCharacterEncoding in interface IInterceptorRequest
      Returns:
      A String that indicates the character encoding
    • getContentLength

      public int getContentLength()
      Description copied from interface: IInterceptorRequest
      Method to get length of the content in the request
      Specified by:
      getContentLength in interface IInterceptorRequest
      Returns:
      An int value of the length of request contents
    • getContentLengthLong

      public long getContentLengthLong()
      Description copied from interface: IInterceptorRequest
      Method to get length of the content in the request
      Specified by:
      getContentLengthLong in interface IInterceptorRequest
      Returns:
      Long value of the length of request contents
    • getContentType

      public String getContentType()
      Description copied from interface: IInterceptorRequest
      Method to fetch content-type of the request
      Specified by:
      getContentType in interface IInterceptorRequest
      Returns:
      String that indicates the type of the request contents
    • getScheme

      public String getScheme()
      Description copied from interface: IInterceptorRequest
      Method to fetch scheme of the request
      Specified by:
      getScheme in interface IInterceptorRequest
      Returns:
      A String that indicates the scheme of the request
    • getAppInterceptorRequest

      public IInterceptorRequest getAppInterceptorRequest()