Class LoggingRequestFilter
java.lang.Object
org.odpi.openmetadata.userauthn.auth.LoggingRequestFilter
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
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.
-
Constructor Details
-
LoggingRequestFilter
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 interfacejakarta.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 interfacejakarta.servlet.Filter
- Parameters:
servletRequest
- The request to processservletResponse
- The response associated with the requestfilterChain
- 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 requestjakarta.servlet.ServletException
- if the processing fails for any other reason
-
destroy
public void destroy()- Specified by:
destroy
in interfacejakarta.servlet.Filter
-