Class FilterRegistrationImpl

java.lang.Object
io.undertow.servlet.spec.FilterRegistrationImpl
All Implemented Interfaces:
FilterRegistration, FilterRegistration.Dynamic, Registration, Registration.Dynamic

public class FilterRegistrationImpl extends Object implements FilterRegistration, FilterRegistration.Dynamic
Author:
Stuart Douglas
  • Constructor Details

  • Method Details

    • addMappingForServletNames

      public void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames)
      Description copied from interface: FilterRegistration
      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.

      Specified by:
      addMappingForServletNames in interface FilterRegistration
      Parameters:
      dispatcherTypes - the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be used
      isMatchAfter - 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 - the servlet names of the filter mapping
    • getServletNameMappings

      public Collection<String> getServletNameMappings()
      Description copied from interface: FilterRegistration
      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.

      Specified by:
      getServletNameMappings in interface FilterRegistration
      Returns:
      a (possibly empty) Collection of the currently available servlet name mappings of the Filter represented by this FilterRegistration
    • addMappingForUrlPatterns

      public void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns)
      Description copied from interface: FilterRegistration
      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.

      Specified by:
      addMappingForUrlPatterns in interface FilterRegistration
      Parameters:
      dispatcherTypes - the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be used
      isMatchAfter - 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 - the url patterns of the filter mapping
    • getUrlPatternMappings

      public Collection<String> getUrlPatternMappings()
      Description copied from interface: FilterRegistration
      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.

      Specified by:
      getUrlPatternMappings in interface FilterRegistration
      Returns:
      a (possibly empty) Collection of the currently available URL pattern mappings of the Filter represented by this FilterRegistration
    • getName

      public String getName()
      Description copied from interface: Registration
      Gets the name of the Servlet or Filter that is represented by this Registration.
      Specified by:
      getName in interface Registration
      Returns:
      the name of the Servlet or Filter that is represented by this Registration
    • getClassName

      public String getClassName()
      Description copied from interface: Registration
      Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.
      Specified by:
      getClassName in interface Registration
      Returns:
      the fully qualified class name of the Servlet or Filter that is represented by this Registration, or null if this Registration is preliminary
    • setInitParameter

      public boolean setInitParameter(String name, String value)
      Description copied from interface: Registration
      Sets the initialization parameter with the given name and value on the Servlet or Filter that is represented by this Registration.
      Specified by:
      setInitParameter in interface Registration
      Parameters:
      name - the initialization parameter name
      value - the initialization parameter value
      Returns:
      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
    • getInitParameter

      public String getInitParameter(String name)
      Description copied from interface: Registration
      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.
      Specified by:
      getInitParameter in interface Registration
      Parameters:
      name - the name of the initialization parameter whose value is requested
      Returns:
      the value of the initialization parameter with the given name, or null if no initialization parameter with the given name exists
    • setInitParameters

      public Set<String> setInitParameters(Map<String,String> initParameters)
      Description copied from interface: Registration
      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 Registration.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.

      Specified by:
      setInitParameters in interface Registration
      Parameters:
      initParameters - the initialization parameters
      Returns:
      the (possibly empty) Set of initialization parameter names that are in conflict
    • getInitParameters

      public Map<String,String> getInitParameters()
      Description copied from interface: Registration
      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.
      Specified by:
      getInitParameters in interface Registration
      Returns:
      Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object
    • setAsyncSupported

      public void setAsyncSupported(boolean isAsyncSupported)
      Description copied from interface: Registration.Dynamic
      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.

      Specified by:
      setAsyncSupported in interface Registration.Dynamic
      Parameters:
      isAsyncSupported - true if the Servlet or Filter represented by this dynamic Registration supports asynchronous operations, false otherwise