java.lang.Object
cloud.piranha.webapp.impl.DefaultFilterEnvironment
- All Implemented Interfaces:
FilterEnvironment
,FilterConfig
,FilterRegistration
,FilterRegistration.Dynamic
,Registration
,Registration.Dynamic
The default FilterEnvironment.
- Author:
- Manfred Riem ([email protected])
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.servlet.FilterRegistration
FilterRegistration.Dynamic
Nested classes/interfaces inherited from interface jakarta.servlet.Registration
Registration.Dynamic
-
Field Summary
Fields inherited from interface cloud.piranha.webapp.api.FilterEnvironment
UNAVAILABLE
-
Constructor Summary
ConstructorDescriptionConstructor.DefaultFilterEnvironment(WebApplication webApp, String filterName, Filter filter)
Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames)
Add the mappings for the servlet names.void
addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns)
Add the mappings.Returns the class name.Returns the filter.Returns the filter name.getInitParameter(String name)
Get the init parameter.Get the init parameter names.Returns the init parameters.getName()
Returns the name.Returns the servlet context.Returns the servlet name mappings.Returns the URL pattern mappings.Returns the web application.void
Initialize the filter.boolean
Is async supported.void
setAsyncSupported(boolean asyncSupported)
Set async supported.void
setClassName(String className)
Set the class name.void
setFilterName(String filterName)
Set the filter name.boolean
setInitParameter(String name, String value)
Set the init parameter.setInitParameters(Map<String,String> initParameters)
Set the init parameters.void
setStatus(int status)
Set status.void
setWebApplication(WebApplication webApplication)
Set the web application.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(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, 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(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, 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
Returns the class name.- Specified by:
getClassName
in interfaceRegistration
- Returns:
- the class name
-
getFilter
Returns the filter.- Specified by:
getFilter
in interfaceFilterEnvironment
- Returns:
- the filter
-
getFilterName
Returns the filter name.- Specified by:
getFilterName
in interfaceFilterConfig
- Returns:
- the filter name
-
getInitParameter
Get the init parameter.- Specified by:
getInitParameter
in interfaceFilterConfig
- Specified by:
getInitParameter
in interfaceRegistration
- Parameters:
name
- the name- Returns:
- the value.
-
getInitParameterNames
Get the init parameter names.- Specified by:
getInitParameterNames
in interfaceFilterConfig
- Returns:
- the enumeration.
-
getInitParameters
Returns the init parameters.- Specified by:
getInitParameters
in interfaceRegistration
- Returns:
- the init parameters
-
getName
Returns the name.- Specified by:
getName
in interfaceRegistration
- Returns:
- the name
-
getServletContext
Returns the servlet context.- Specified by:
getServletContext
in interfaceFilterConfig
- Returns:
- the servlet context
-
getServletNameMappings
Returns the servlet name mappings.- Specified by:
getServletNameMappings
in interfaceFilterRegistration
- Returns:
- the servlet name mappings
-
getUrlPatternMappings
Returns the URL pattern mappings.- Specified by:
getUrlPatternMappings
in interfaceFilterRegistration
- Returns:
- the URL pattern mappings
-
getWebApplication
Returns 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
Set the class name.- Specified by:
setClassName
in interfaceFilterEnvironment
- Parameters:
className
- the class name.
-
setFilterName
Set the filter name.- Specified by:
setFilterName
in interfaceFilterEnvironment
- Parameters:
filterName
- the filter name.
-
setInitParameter
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
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.
-
isAsyncSupported
public boolean isAsyncSupported()Description copied from interface:FilterEnvironment
Is async supported.- Specified by:
isAsyncSupported
in interfaceFilterEnvironment
- Returns:
- true if it is, false otherwise.
-
toString
-