Class HTTPRequestHeadersFilter

java.lang.Object
org.odpi.openmetadata.tokenmanager.http.HTTPRequestHeadersFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class HTTPRequestHeadersFilter extends Object implements jakarta.servlet.Filter
HTTPRequestHeadersFilter is a Java Servlet Filter that receives a list of http header names which are then saved from the request in HTTPHeadersThreadLocal.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doFilter(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse, jakarta.servlet.FilterChain filterChain)
    This call is run during the processing of an HTTP request.
    void
    init(jakarta.servlet.FilterConfig filterConfig)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface jakarta.servlet.Filter

    destroy
  • Constructor Details

    • HTTPRequestHeadersFilter

      public HTTPRequestHeadersFilter(List<String> headerNames)
      Constructor
      Parameters:
      headerNames - list of http header names
  • Method Details

    • init

      public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Filter
      Throws:
      jakarta.servlet.ServletException
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse, jakarta.servlet.FilterChain filterChain) throws IOException, jakarta.servlet.ServletException
      This call is run during the processing of an HTTP request. It copies the authorization headers into ThreadLocal storage.
      Specified by:
      doFilter in interface jakarta.servlet.Filter
      Parameters:
      servletRequest - the ServletRequest object contains the client's request
      servletResponse - the ServletResponse object contains the filter's response
      filterChain - the FilterChain for invoking the next filter or the resource
      Throws:
      IOException - problem accessing the http request
      jakarta.servlet.ServletException - problem with the servlet