javax.servlet.FilterConfig
, javax.servlet.FilterRegistration
, javax.servlet.FilterRegistration.Dynamic
, javax.servlet.Registration
, javax.servlet.Registration.Dynamic
public class DefaultFilterEnvironment
extends java.lang.Object
implements javax.servlet.FilterRegistration.Dynamic, javax.servlet.FilterConfig
Modifier and Type | Field | Description |
---|---|---|
static int |
UNAVAILABLE |
Defines the UNAVAILABLE constant.
|
Constructor | Description |
---|---|
DefaultFilterEnvironment() |
Constructor.
|
DefaultFilterEnvironment(cloud.piranha.api.WebApplication webApp,
java.lang.String filterName,
javax.servlet.Filter filter) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addMappingForServletNames(java.util.EnumSet<javax.servlet.DispatcherType> dispatcherTypes,
boolean isMatchAfter,
java.lang.String... servletNames) |
Add the mappings for the servlet names.
|
void |
addMappingForUrlPatterns(java.util.EnumSet<javax.servlet.DispatcherType> dispatcherTypes,
boolean isMatchAfter,
java.lang.String... urlPatterns) |
Add the mappings.
|
java.lang.String |
getClassName() |
Get the class name.
|
javax.servlet.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.
|
javax.servlet.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.
|
cloud.piranha.api.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(DefaultWebApplication webApplication) |
Set the web application.
|
public static final int UNAVAILABLE
public DefaultFilterEnvironment()
public DefaultFilterEnvironment(cloud.piranha.api.WebApplication webApp, java.lang.String filterName, javax.servlet.Filter filter)
webApp
- the web application.filterName
- the filter name.filter
- the filter.public void addMappingForServletNames(java.util.EnumSet<javax.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, java.lang.String... servletNames)
addMappingForServletNames
in interface javax.servlet.FilterRegistration
dispatcherTypes
- the dispatcher types.isMatchAfter
- is a matcher after.servletNames
- the servlet names.public void addMappingForUrlPatterns(java.util.EnumSet<javax.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, java.lang.String... urlPatterns)
addMappingForUrlPatterns
in interface javax.servlet.FilterRegistration
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.public java.lang.String getClassName()
getClassName
in interface javax.servlet.Registration
public javax.servlet.Filter getFilter()
public java.lang.String getFilterName()
getFilterName
in interface javax.servlet.FilterConfig
public java.lang.String getInitParameter(java.lang.String name)
getInitParameter
in interface javax.servlet.FilterConfig
getInitParameter
in interface javax.servlet.Registration
name
- the namepublic java.util.Enumeration<java.lang.String> getInitParameterNames()
getInitParameterNames
in interface javax.servlet.FilterConfig
public java.util.Map<java.lang.String,java.lang.String> getInitParameters()
getInitParameters
in interface javax.servlet.Registration
public java.lang.String getName()
getName
in interface javax.servlet.Registration
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.FilterConfig
public java.util.Collection<java.lang.String> getServletNameMappings()
getServletNameMappings
in interface javax.servlet.FilterRegistration
public java.util.Collection<java.lang.String> getUrlPatternMappings()
getUrlPatternMappings
in interface javax.servlet.FilterRegistration
public cloud.piranha.api.WebApplication getWebApplication()
public void initialize() throws javax.servlet.ServletException
javax.servlet.ServletException
- when a servlet error occurs.public void setAsyncSupported(boolean asyncSupported)
setAsyncSupported
in interface javax.servlet.Registration.Dynamic
asyncSupported
- the async supported flag.public void setClassName(java.lang.String className)
className
- the class name.public void setFilterName(java.lang.String filterName)
filterName
- the filter name.public boolean setInitParameter(java.lang.String name, java.lang.String value)
setInitParameter
in interface javax.servlet.Registration
name
- the parameter name.value
- the parameter value.public java.util.Set<java.lang.String> setInitParameters(java.util.Map<java.lang.String,java.lang.String> initParameters)
setInitParameters
in interface javax.servlet.Registration
initParameters
- the init parameterspublic void setStatus(int status)
status
- the status.public void setWebApplication(DefaultWebApplication webApplication)
webApplication
- the web application.Copyright © 2020 Piranha Cloud. All rights reserved.