Module cloud.piranha.webapp.impl
Package cloud.piranha.webapp.impl
Class DefaultWebApplicationRequestMapper
java.lang.Object
cloud.piranha.webapp.impl.DefaultWebApplicationRequestMapper
- All Implemented Interfaces:
WebApplicationRequestMapper
public class DefaultWebApplicationRequestMapper extends java.lang.Object implements WebApplicationRequestMapper
The default WebApplicationRequestMapper.
- Author:
- Manfred Riem ([email protected])
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<FilterMapping>
filterMappings
Stores the filter mappings.protected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String>
servletMappings
Stores the servlet mappings. -
Constructor Summary
Constructors Constructor Description DefaultWebApplicationRequestMapper()
-
Method Summary
Modifier and Type Method Description java.util.Set<java.lang.String>
addFilterMapping(java.util.Set<DispatcherType> dispatcherTypes, java.lang.String filterName, java.lang.String... urlPatterns)
Add a filter mapping.java.util.Set<java.lang.String>
addFilterMappingBeforeExisting(java.util.Set<DispatcherType> dispatcherTypes, java.lang.String filterName, java.lang.String... urlPatterns)
Add a filter mapping.java.util.Set<java.lang.String>
addServletMapping(java.lang.String servletName, java.lang.String... urlPatterns)
Add a servlet mapping.java.util.Collection<java.lang.String>
findFilterMappings(DispatcherType dispatcherType, java.lang.String path)
Find the filter mappings.DefaultWebApplicationRequestMapping
findServletMapping(java.lang.String path)
Find a servlet mapping for the given path.java.util.Collection<java.lang.String>
getServletMappings(java.lang.String servletName)
Get the mappings for the specified servlet.java.lang.String
getServletName(java.lang.String mapping)
Get the servlet name for the specified mapping..Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cloud.piranha.webapp.api.WebApplicationRequestMapper
addFilterMapping, addFilterMappingBeforeExisting, findFilterMappings
-
Field Details
-
filterMappings
Stores the filter mappings. -
servletMappings
protected final java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String> servletMappingsStores the servlet mappings.
-
-
Constructor Details
-
DefaultWebApplicationRequestMapper
public DefaultWebApplicationRequestMapper()
-
-
Method Details
-
addFilterMapping
public java.util.Set<java.lang.String> addFilterMapping(java.util.Set<DispatcherType> dispatcherTypes, java.lang.String filterName, java.lang.String... urlPatterns)Description copied from interface:WebApplicationRequestMapper
Add a filter mapping.This adds the filter mappings at the end of list of existing mappings (if any).
- Specified by:
addFilterMapping
in interfaceWebApplicationRequestMapper
- Parameters:
dispatcherTypes
- the dispatcher types.filterName
- the filter name.urlPatterns
- the URL patterns to map (aka mappings).- Returns:
- the URL patterns that were added.
-
addFilterMappingBeforeExisting
public java.util.Set<java.lang.String> addFilterMappingBeforeExisting(java.util.Set<DispatcherType> dispatcherTypes, java.lang.String filterName, java.lang.String... urlPatterns)Description copied from interface:WebApplicationRequestMapper
Add a filter mapping.This adds the filter mappings at the start of list of existing mappings (if any). If there are existing mappings these are shifted to the right.
- Specified by:
addFilterMappingBeforeExisting
in interfaceWebApplicationRequestMapper
- Parameters:
dispatcherTypes
- the dispatcher types.filterName
- the filter name.urlPatterns
- the URL patterns to map (aka mappings).- Returns:
- the URL patterns that were added.
-
addServletMapping
public java.util.Set<java.lang.String> addServletMapping(java.lang.String servletName, java.lang.String... urlPatterns)Add a servlet mapping.- Specified by:
addServletMapping
in interfaceWebApplicationRequestMapper
- Parameters:
servletName
- the servlet name.urlPatterns
- the URL patterns to map (aka mappings).- Returns:
- the URL patterns that were already added.
-
findFilterMappings
public java.util.Collection<java.lang.String> findFilterMappings(DispatcherType dispatcherType, java.lang.String path)Find the filter mappings.- Specified by:
findFilterMappings
in interfaceWebApplicationRequestMapper
- Parameters:
path
- the path.dispatcherType
- the dispatcher type.- Returns:
- the filter mappings.
-
findServletMapping
Find a servlet mapping for the given path.- Specified by:
findServletMapping
in interfaceWebApplicationRequestMapper
- Parameters:
path
- the path.- Returns:
- the mapping, or null if not found.
-
getServletMappings
public java.util.Collection<java.lang.String> getServletMappings(java.lang.String servletName)Get the mappings for the specified servlet.- Specified by:
getServletMappings
in interfaceWebApplicationRequestMapper
- Parameters:
servletName
- the servlet name.- Returns:
- the mappings, or an empty collection if none.
-
getServletName
public java.lang.String getServletName(java.lang.String mapping)Get the servlet name for the specified mapping..- Specified by:
getServletName
in interfaceWebApplicationRequestMapper
- Parameters:
mapping
- the mapping.- Returns:
- the servlet name, or null if not found.
-