java.lang.Object
cloud.piranha.webapp.impl.DefaultFilterEnvironment
- All Implemented Interfaces:
FilterEnvironment
,FilterConfig
,FilterRegistration
,FilterRegistration.Dynamic
,Registration
,Registration.Dynamic
public class DefaultFilterEnvironment extends java.lang.Object implements FilterEnvironment
The default FilterEnvironment.
- Author:
- Manfred Riem ([email protected])
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.servlet.FilterRegistration
FilterRegistration.Dynamic
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DefaultFilterEnvironment()
Constructor.DefaultFilterEnvironment(WebApplication webApp, java.lang.String filterName, Filter filter)
Constructor. -
Method Summary
Modifier and Type Method Description void
addMappingForServletNames(java.util.EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, java.lang.String... servletNames)
Add the mappings for the servlet names.void
addMappingForUrlPatterns(java.util.EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, java.lang.String... urlPatterns)
Add the mappings.java.lang.String
getClassName()
Get the class name.Filter
getFilter()
Get the filter.java.lang.String
getFilterName()
Get the filter name.java.lang.String
getInitParameter(java.lang.String name)
Get the init parameter.java.util.Enumeration<java.lang.String>
getInitParameterNames()
Get the init parameter names.java.util.Map<java.lang.String,java.lang.String>
getInitParameters()
Get the init parameters.java.lang.String
getName()
Get the name.ServletContext
getServletContext()
Get the servlet context.java.util.Collection<java.lang.String>
getServletNameMappings()
Get the servlet name mappings.java.util.Collection<java.lang.String>
getUrlPatternMappings()
Get the URL pattern mappings.WebApplication
getWebApplication()
Get the web application.void
initialize()
Initialize the filter.void
setAsyncSupported(boolean asyncSupported)
Set async supported.void
setClassName(java.lang.String className)
Set the class name.void
setFilterName(java.lang.String filterName)
Set the filter name.boolean
setInitParameter(java.lang.String name, java.lang.String value)
Set the init parameter.java.util.Set<java.lang.String>
setInitParameters(java.util.Map<java.lang.String,java.lang.String> initParameters)
Set the init parameters.void
setStatus(int status)
Set status.void
setWebApplication(WebApplication webApplication)
Set the web application.java.lang.String
toString()
-
Constructor Details
-
DefaultFilterEnvironment
public DefaultFilterEnvironment()Constructor. -
DefaultFilterEnvironment
Constructor.- Parameters:
webApp
- the web application.filterName
- the filter name.filter
- the filter.
-
-
Method Details
-
addMappingForServletNames
public void addMappingForServletNames(java.util.EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, java.lang.String... servletNames)Add the mappings for the servlet names.- Specified by:
addMappingForServletNames
in interfaceFilterRegistration
- Parameters:
dispatcherTypes
- the dispatcher types.isMatchAfter
- is a matcher after.servletNames
- the servlet names.
-
addMappingForUrlPatterns
public void addMappingForUrlPatterns(java.util.EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, java.lang.String... urlPatterns)Add the mappings.- Specified by:
addMappingForUrlPatterns
in interfaceFilterRegistration
- Parameters:
dispatcherTypes
- the dispatcher types.isMatchAfter
- true to call the filter this mapping applies to after declared ones, false to call it before declared ones.urlPatterns
- the url patterns.
-
getClassName
public java.lang.String getClassName()Get the class name.- Specified by:
getClassName
in interfaceRegistration
- Returns:
- the class name.
-
getFilter
Get the filter.- Specified by:
getFilter
in interfaceFilterEnvironment
- Returns:
- the filter.
-
getFilterName
public java.lang.String getFilterName()Get the filter name.- Specified by:
getFilterName
in interfaceFilterConfig
- Returns:
- the filter name.
-
getInitParameter
public java.lang.String getInitParameter(java.lang.String name)Get the init parameter.- Specified by:
getInitParameter
in interfaceFilterConfig
- Specified by:
getInitParameter
in interfaceRegistration
- Parameters:
name
- the name- Returns:
- the value.
-
getInitParameterNames
public java.util.Enumeration<java.lang.String> getInitParameterNames()Get the init parameter names.- Specified by:
getInitParameterNames
in interfaceFilterConfig
- Returns:
- the enumeration.
-
getInitParameters
public java.util.Map<java.lang.String,java.lang.String> getInitParameters()Get the init parameters.- Specified by:
getInitParameters
in interfaceRegistration
- Returns:
- the init parameters.
-
getName
public java.lang.String getName()Get the name.- Specified by:
getName
in interfaceRegistration
- Returns:
- the name.
-
getServletContext
Get the servlet context.- Specified by:
getServletContext
in interfaceFilterConfig
- Returns:
- the servlet context.
-
getServletNameMappings
public java.util.Collection<java.lang.String> getServletNameMappings()Get the servlet name mappings.- Specified by:
getServletNameMappings
in interfaceFilterRegistration
- Returns:
- the servlet name mappings.
-
getUrlPatternMappings
public java.util.Collection<java.lang.String> getUrlPatternMappings()Get the URL pattern mappings.- Specified by:
getUrlPatternMappings
in interfaceFilterRegistration
- Returns:
- the URL pattern mappings.
-
getWebApplication
Get the web application.- Specified by:
getWebApplication
in interfaceFilterEnvironment
- Returns:
- the web application.
-
initialize
Initialize the filter.- Specified by:
initialize
in interfaceFilterEnvironment
- Throws:
ServletException
- when a servlet error occurs.
-
setAsyncSupported
public void setAsyncSupported(boolean asyncSupported)Set async supported.- Specified by:
setAsyncSupported
in interfaceRegistration.Dynamic
- Parameters:
asyncSupported
- the async supported flag.
-
setClassName
public void setClassName(java.lang.String className)Set the class name.- Specified by:
setClassName
in interfaceFilterEnvironment
- Parameters:
className
- the class name.
-
setFilterName
public void setFilterName(java.lang.String filterName)Set the filter name.- Specified by:
setFilterName
in interfaceFilterEnvironment
- Parameters:
filterName
- the filter name.
-
setInitParameter
public boolean setInitParameter(java.lang.String name, java.lang.String value)Set the init parameter.- Specified by:
setInitParameter
in interfaceRegistration
- Parameters:
name
- the parameter name.value
- the parameter value.- Returns:
- if the init parameter was set.
-
setInitParameters
public java.util.Set<java.lang.String> setInitParameters(java.util.Map<java.lang.String,java.lang.String> initParameters)Set the init parameters.- Specified by:
setInitParameters
in interfaceRegistration
- Parameters:
initParameters
- the init parameters- Returns:
- the set of conflicting parameter names.
-
setStatus
public void setStatus(int status)Set status.- Specified by:
setStatus
in interfaceFilterEnvironment
- Parameters:
status
- the status.
-
setWebApplication
Description copied from interface:FilterEnvironment
Set the web application.- Specified by:
setWebApplication
in interfaceFilterEnvironment
- Parameters:
webApplication
- the web application.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-