Package org.apache.storm.daemon.drpc.webapp

# Class ReqContextFilter

java.lang.Object
org.apache.storm.daemon.drpc.webapp.ReqContextFilter

All Implemented Interfaces:
  `jakarta.servlet.Filter`

@Provider @PreMatching public class ReqContextFilter extends Object implements jakarta.servlet.Filter

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReqContextFilter(IHttpCredentialsPlugin httpCredsHandler)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `destroy()`
  `void`
  `doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain)`
  A filter which populates the request if it is null and then passes it on to the next entity in the chain.
  `void`
  `handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain chain)`
  A method used by doFilter which populates the request if it is null and then passes it on to the next entity in the chain.
  `void`
  `init(jakarta.servlet.FilterConfig config)`
  `void`
  `populateContext(jakarta.servlet.http.HttpServletRequest request)`
  Populate the Storm RequestContext from an servlet request.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ReqContextFilter

    public ReqContextFilter(IHttpCredentialsPlugin httpCredsHandler)

- ## Method Details

  - ### populateContext

    public void populateContext(jakarta.servlet.http.HttpServletRequest request)
    Populate the Storm RequestContext from an servlet request. This should be called in each handler
    Parameters:
      `request` - the request to populate

  - ### init

    public void init(jakarta.servlet.FilterConfig config) throws jakarta.servlet.ServletException
    Specified by:
      `init` in interface `jakarta.servlet.Filter`
    Throws:
      `jakarta.servlet.ServletException`

  - ### doFilter

    public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
    A filter which populates the request if it is null and then passes it on to the next entity in the chain.
    Specified by:
      `doFilter` in interface `jakarta.servlet.Filter`
    Parameters:
      `request` - the request to populate
      `response` - the response to populate
      `chain` - the next chain of entities to pass the object to
    Throws:
      `IOException`
      `jakarta.servlet.ServletException`

  - ### handle

    public void handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
    A method used by doFilter which populates the request if it is null and then passes it on to the next entity in the chain.
    Parameters:
      `request` - the request to populate
      `response` - the response to populate
      `chain` - the next chain of entities to pass the object to
    Throws:
      `IOException`
      `jakarta.servlet.ServletException`

  - ### destroy

    public void destroy()
    Specified by:
      `destroy` in interface `jakarta.servlet.Filter`