public abstract class FilterChainManager<ServletContextType>
extends java.lang.Object
HttpServletRequest and HttpServletResponse objects.
For example, the Spring implementation creates the ServletContext when the application is initialized the first time
and creates a FitlerChainManager to execute its filters for each request.| Modifier and Type | Class and Description |
|---|---|
protected static class |
FilterChainManager.TargetCacheKey
Object used as a key for the filter chain cache.
|
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
PATH_PART_SEPARATOR |
protected ServletContextType |
servletContext |
| Modifier | Constructor and Description |
|---|---|
protected |
FilterChainManager(ServletContextType context) |
| Modifier and Type | Method and Description |
|---|---|
FilterChainHolder |
getFilterChain(javax.servlet.http.HttpServletRequest request)
Returns the filter chain that applies to the given request.
|
protected FilterChainHolder |
getFilterChainCache(javax.servlet.DispatcherType type,
java.lang.String targetPath)
Retrieves a filter chain from the cache.
|
protected abstract java.util.Map<java.lang.String,FilterHolder> |
getFilterHolders()
This method is used by the
getFilterChain method to extract a Map of filter holders from the current
context. |
protected boolean |
pathMatches(java.lang.String target,
java.lang.String mapping)
Checks if a mapping path matches the target path of the request.
|
protected void |
putFilterChainCache(javax.servlet.DispatcherType type,
java.lang.String targetPath,
FilterChainHolder holder)
Adds a filter chain to the local cache.
|
protected static final java.lang.String PATH_PART_SEPARATOR
protected ServletContextType servletContext
protected FilterChainManager(ServletContextType context)
protected abstract java.util.Map<java.lang.String,FilterHolder> getFilterHolders()
getFilterChain method to extract a Map of filter holders from the current
context. This method is implemented in the AwsFilterChainManager class.public FilterChainHolder getFilterChain(javax.servlet.http.HttpServletRequest request)
DispatcherType value (set to REQUEST by default in the AwsProxyHttpServletRequest) and the target
path returned by the getPath method of the request.
This method currently does not filter on servlet name because the library assumes we are using a single servlet.request - The incoming servlet requestFilterChainHolder object that can be used to apply the filters to the requestprotected FilterChainHolder getFilterChainCache(javax.servlet.DispatcherType type, java.lang.String targetPath)
type - The dispatcher type for the incoming requesttargetPath - The request path - this is extracted with the getPath method of the request objectprotected void putFilterChainCache(javax.servlet.DispatcherType type,
java.lang.String targetPath,
FilterChainHolder holder)
getFilterChain
method to retry this.type - DispatcherType from the incoming requesttargetPath - The target path in the APIholder - The FilterChainHolder object to save in the cacheprotected boolean pathMatches(java.lang.String target,
java.lang.String mapping)
target - The target path from the incoming requestmapping - The mapping path stored in the filter registrationCopyright © 2017. All Rights Reserved.