Package net.shibboleth.idp.conf.impl
Class SLF4JMDCServletFilter
java.lang.Object
net.shibboleth.shared.servlet.AbstractConditionalFilter
net.shibboleth.idp.conf.impl.SLF4JMDCServletFilter
- All Implemented Interfaces:
Filter,ChainableFilter,Ordered
Servlet filter that sets some interesting MDC attributes as the request comes in and clears the MDC as the response
is returned.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.shibboleth.shared.spring.servlet.ChainableFilter
ChainableFilter.FilterOrder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMDC attribute name for client address.private booleanWhether to create a session if it doesn't already exist.Map of attribute/header pairs to inject.static final StringMDC attribute name for container session ID.static final StringMDC attribute name for host name of the server to which the current request was sent.static final StringMDC attribute name for port number to which the current request was sent.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidrunFilter(ServletRequest request, ServletResponse response, FilterChain chain) voidsetCreateSession(boolean flag) Sets whether to create a session if one does not exist.voidsetHeaderMap(Map<String, String> map) Set a map of MDC attribute names to header names to add to context.Methods inherited from class net.shibboleth.shared.servlet.AbstractConditionalFilter
destroy, doFilter, getActivationCondition, init, setActivationConditionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.spring.servlet.ChainableFilter
getOrder
-
Field Details
-
SERVER_ADDRESS_MDC_ATTRIBUTE
MDC attribute name for host name of the server to which the current request was sent.- See Also:
-
SERVER_PORT_MDC_ATTRIBUTE
MDC attribute name for port number to which the current request was sent.- See Also:
-
CLIENT_ADDRESS_MDC_ATTRIBUTE
MDC attribute name for client address.- See Also:
-
JSESSIONID_MDC_ATTRIBUTE
MDC attribute name for container session ID.- See Also:
-
createSession
private boolean createSessionWhether to create a session if it doesn't already exist. -
headerMap
Map of attribute/header pairs to inject.
-
-
Constructor Details
-
SLF4JMDCServletFilter
public SLF4JMDCServletFilter()Constructor.
-
-
Method Details
-
setCreateSession
public void setCreateSession(boolean flag) Sets whether to create a session if one does not exist.- Parameters:
flag- flag to set
-
setHeaderMap
Set a map of MDC attribute names to header names to add to context.- Parameters:
map- header map to set- Since:
- 5.1.0
-
runFilter
protected void runFilter(@Nonnull ServletRequest request, @Nonnull ServletResponse response, @Nonnull FilterChain chain) throws IOException, ServletException - Specified by:
runFilterin classAbstractConditionalFilter- Throws:
IOExceptionServletException
-