Class LoggingRequestFilter

java.lang.Object
org.odpi.openmetadata.userauthn.auth.LoggingRequestFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class LoggingRequestFilter extends Object implements jakarta.servlet.Filter
LoggingRequestFilter is setting up additional diagnostics using the Mapped Diagnostic Context (MDC) service. It inherits from Filter which is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    doFilter(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse, jakarta.servlet.FilterChain filterChain)
    Request to provide filtering.
    void
    init(jakarta.servlet.FilterConfig filterConfig)
    Called by the web container to indicate to a filter that it is being placed into service.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LoggingRequestFilter

      public LoggingRequestFilter(String path)
      Constructor.
      Parameters:
      path - path to provide filtering on
  • Method Details

    • init

      public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException
      Called by the web container to indicate to a filter that it is being placed into service. The servlet container calls the init method exactly once after instantiating the filter. The init method must complete successfully before the filter is asked to do any filtering work.
      Specified by:
      init in interface jakarta.servlet.Filter
      Parameters:
      filterConfig - The configuration information associated with the filter instance being initialised
      Throws:
      jakarta.servlet.ServletException - problem with servlet
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse, jakarta.servlet.FilterChain filterChain) throws IOException, jakarta.servlet.ServletException
      Request to provide filtering. The doFilter method of the Filter interface is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. The FilterChain passed in to this method allows the Filter to pass on the request and response to the next entity in the chain.
      Specified by:
      doFilter in interface jakarta.servlet.Filter
      Parameters:
      servletRequest - The request to process
      servletResponse - The response associated with the request
      filterChain - Provides access to the next filter in the chain for this filter to pass the request and response to for further processing
      Throws:
      IOException - if an I/O error occurs during this filter's processing of the request
      jakarta.servlet.ServletException - if the processing fails for any other reason
    • destroy

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