Top Fields Constructors Methods
io.undertow.servlet.spec

public Class FilterRegistrationImpl

extends Object
implements FilterRegistration, Dynamic
Class Inheritance
All Implemented Interfaces
jakarta.servlet.FilterRegistration.Dynamic, jakarta.servlet.Registration.Dynamic, jakarta.servlet.Registration, jakarta.servlet.FilterRegistration
Imports
java.util.ArrayList, .Collection, .EnumSet, .HashSet, .List, .Map, .Set, jakarta.servlet.DispatcherType, .FilterRegistration, io.undertow.servlet.api.Deployment, .DeploymentInfo, .FilterInfo, .FilterMappingInfo

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private final Deployment
private final FilterInfo
private final ServletContextImpl

Constructor Summary

AccessConstructor and Description
public
FilterRegistrationImpl(final FilterInfo filterInfo, final Deployment deployment, ServletContextImpl servletContext)

Method Summary

Modifier and TypeMethod and Description
public void
addMappingForServletNames(final EnumSet<DispatcherType>
the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be used
dispatcherTypes
,
final boolean
true if the given filter mapping should be matched after any declared filter mappings, and false if it is supposed to be matched before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained
isMatchAfter
,
final String...
the servlet names of the filter mapping
servletNames
)

Implements jakarta.servlet.FilterRegistration.addMappingForServletNames.

Adds a filter mapping with the given servlet names and dispatcher types for the Filter represented by this FilterRegistration.

public void
addMappingForUrlPatterns(final EnumSet<DispatcherType>
the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be used
dispatcherTypes
,
final boolean
true if the given filter mapping should be matched after any declared filter mappings, and false if it is supposed to be matched before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained
isMatchAfter
,
final String...
the url patterns of the filter mapping
urlPatterns
)

Implements jakarta.servlet.FilterRegistration.addMappingForUrlPatterns.

Adds a filter mapping with the given url patterns and dispatcher types for the Filter represented by this FilterRegistration.

public String
getClassName()

Implements jakarta.servlet.Registration.getClassName.

Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.

public String
getInitParameter(final String
the name of the initialization parameter whose value is requested
name
)

Implements jakarta.servlet.Registration.getInitParameter.

Gets the value of the initialization parameter with the given name that will be used to initialize the Servlet or Filter represented by this Registration object.

public Map<String, String>
getInitParameters()

Implements jakarta.servlet.Registration.getInitParameters.

Gets an immutable (and possibly empty) Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object.

public String
getName()

Implements jakarta.servlet.Registration.getName.

Gets the name of the Servlet or Filter that is represented by this Registration.

public Collection<String>
getServletNameMappings()

Implements jakarta.servlet.FilterRegistration.getServletNameMappings.

Gets the currently available servlet name mappings of the Filter represented by this FilterRegistration.

public Collection<String>
getUrlPatternMappings()

Implements jakarta.servlet.FilterRegistration.getUrlPatternMappings.

Gets the currently available URL pattern mappings of the Filter represented by this FilterRegistration.

public void
setAsyncSupported(final boolean
true if the Servlet or Filter represented by this dynamic Registration supports asynchronous operations, false otherwise
isAsyncSupported
)

Implements jakarta.servlet.Registration.Dynamic.setAsyncSupported.

Configures the Servlet or Filter represented by this dynamic Registration as supporting asynchronous operations or not.

public boolean
setInitParameter(final String
the initialization parameter name
name
,
final String
the initialization parameter value
value
)

Implements jakarta.servlet.Registration.setInitParameter.

Sets the initialization parameter with the given name and value on the Servlet or Filter that is represented by this Registration.

public Set<String>
setInitParameters(final Map<String, String>
the initialization parameters
initParameters
)

Implements jakarta.servlet.Registration.setInitParameters.

Sets the given initialization parameters on the Servlet or Filter that is represented by this Registration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deploymentback to summary
private final Deployment deployment
filterInfoback to summary
private final FilterInfo filterInfo
servletContextback to summary
private final ServletContextImpl servletContext

Constructor Detail

FilterRegistrationImplback to summary
public FilterRegistrationImpl(final FilterInfo filterInfo, final Deployment deployment, ServletContextImpl servletContext)

Method Detail

addMappingForServletNamesback to summary
public void addMappingForServletNames(final EnumSet<DispatcherType> dispatcherTypes, final boolean isMatchAfter, final String... servletNames)

Implements jakarta.servlet.FilterRegistration.addMappingForServletNames.

Doc from jakarta.servlet.FilterRegistration.addMappingForServletNames.

Adds a filter mapping with the given servlet names and dispatcher types for the Filter represented by this FilterRegistration.

Filter mappings are matched in the order in which they were added.

Depending on the value of the isMatchAfter parameter, the given filter mapping will be considered after or before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained.

If this method is called multiple times, each successive call adds to the effects of the former.

Parameters
dispatcherTypes:EnumSet<DispatcherType>

the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be used

isMatchAfter:boolean

true if the given filter mapping should be matched after any declared filter mappings, and false if it is supposed to be matched before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained

servletNames:String[]

the servlet names of the filter mapping

Annotations
@Override
addMappingForUrlPatternsback to summary
public void addMappingForUrlPatterns(final EnumSet<DispatcherType> dispatcherTypes, final boolean isMatchAfter, final String... urlPatterns)

Implements jakarta.servlet.FilterRegistration.addMappingForUrlPatterns.

Doc from jakarta.servlet.FilterRegistration.addMappingForUrlPatterns.

Adds a filter mapping with the given url patterns and dispatcher types for the Filter represented by this FilterRegistration.

Filter mappings are matched in the order in which they were added.

Depending on the value of the isMatchAfter parameter, the given filter mapping will be considered after or before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained.

If this method is called multiple times, each successive call adds to the effects of the former.

Parameters
dispatcherTypes:EnumSet<DispatcherType>

the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be used

isMatchAfter:boolean

true if the given filter mapping should be matched after any declared filter mappings, and false if it is supposed to be matched before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained

urlPatterns:String[]

the url patterns of the filter mapping

Annotations
@Override
getClassNameback to summary
public String getClassName()

Implements jakarta.servlet.Registration.getClassName.

Doc from jakarta.servlet.Registration.getClassName.

Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.

Returns:String

the fully qualified class name of the Servlet or Filter that is represented by this Registration, or null if this Registration is preliminary

Annotations
@Override
getInitParameterback to summary
public String getInitParameter(final String name)

Implements jakarta.servlet.Registration.getInitParameter.

Doc from jakarta.servlet.Registration.getInitParameter.

Gets the value of the initialization parameter with the given name that will be used to initialize the Servlet or Filter represented by this Registration object.

Parameters
name:String

the name of the initialization parameter whose value is requested

Returns:String

the value of the initialization parameter with the given name, or null if no initialization parameter with the given name exists

Annotations
@Override
getInitParametersback to summary
public Map<String, String> getInitParameters()

Implements jakarta.servlet.Registration.getInitParameters.

Doc from jakarta.servlet.Registration.getInitParameters.

Gets an immutable (and possibly empty) Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object.

Returns:Map<String, String>

Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object

Annotations
@Override
getNameback to summary
public String getName()

Implements jakarta.servlet.Registration.getName.

Doc from jakarta.servlet.Registration.getName.

Gets the name of the Servlet or Filter that is represented by this Registration.

Returns:String

the name of the Servlet or Filter that is represented by this Registration

Annotations
@Override
getServletNameMappingsback to summary
public Collection<String> getServletNameMappings()

Implements jakarta.servlet.FilterRegistration.getServletNameMappings.

Doc from jakarta.servlet.FilterRegistration.getServletNameMappings.

Gets the currently available servlet name mappings of the Filter represented by this FilterRegistration.

If permitted, any changes to the returned Collection must not affect this FilterRegistration.

Returns:Collection<String>

a (possibly empty) Collection of the currently available servlet name mappings of the Filter represented by this FilterRegistration

Annotations
@Override
getUrlPatternMappingsback to summary
public Collection<String> getUrlPatternMappings()

Implements jakarta.servlet.FilterRegistration.getUrlPatternMappings.

Doc from jakarta.servlet.FilterRegistration.getUrlPatternMappings.

Gets the currently available URL pattern mappings of the Filter represented by this FilterRegistration.

If permitted, any changes to the returned Collection must not affect this FilterRegistration.

Returns:Collection<String>

a (possibly empty) Collection of the currently available URL pattern mappings of the Filter represented by this FilterRegistration

Annotations
@Override
setAsyncSupportedback to summary
public void setAsyncSupported(final boolean isAsyncSupported)

Implements jakarta.servlet.Registration.Dynamic.setAsyncSupported.

Doc from jakarta.servlet.Registration.Dynamic.setAsyncSupported.

Configures the Servlet or Filter represented by this dynamic Registration as supporting asynchronous operations or not.

By default, servlet and filters do not support asynchronous operations.

A call to this method overrides any previous setting.

Parameters
isAsyncSupported:boolean

true if the Servlet or Filter represented by this dynamic Registration supports asynchronous operations, false otherwise

Annotations
@Override
setInitParameterback to summary
public boolean setInitParameter(final String name, final String value)

Implements jakarta.servlet.Registration.setInitParameter.

Doc from jakarta.servlet.Registration.setInitParameter.

Sets the initialization parameter with the given name and value on the Servlet or Filter that is represented by this Registration.

Parameters
name:String

the initialization parameter name

value:String

the initialization parameter value

Returns:boolean

true if the update was successful, i.e., an initialization parameter with the given name did not already exist for the Servlet or Filter represented by this Registration, and false otherwise

Annotations
@Override
setInitParametersback to summary
public Set<String> setInitParameters(final Map<String, String> initParameters)

Implements jakarta.servlet.Registration.setInitParameters.

Doc from jakarta.servlet.Registration.setInitParameters.

Sets the given initialization parameters on the Servlet or Filter that is represented by this Registration.

The given map of initialization parameters is processed by-value, i.e., for each initialization parameter contained in the map, this method calls setInitParameter(String, String). If that method would return false for any of the initialization parameters in the given map, no updates will be performed, and false will be returned. Likewise, if the map contains an initialization parameter with a null name or value, no updates will be performed, and an IllegalArgumentException will be thrown.

The returned set is not backed by the Registration object, so changes in the returned set are not reflected in the Registration object, and vice-versa.

Parameters
initParameters:Map<String, String>

the initialization parameters

Returns:Set<String>

the (possibly empty) Set of initialization parameter names that are in conflict

Annotations
@Override