Package hudson.util

Class PluginServletFilter

  • All Implemented Interfaces:
    ExtensionPoint, javax.servlet.Filter

    public final class PluginServletFilter
    extends Object
    implements javax.servlet.Filter, ExtensionPoint
    Servlet Filter that chains multiple Filters, provided by plugins

    While this class by itself is not an extension point, I'm marking this class as an extension point so that this class will be more discoverable.

    SecurityRealm that wants to contribute Filters should first check if SecurityRealm.createFilter(FilterConfig) is more appropriate.

    See Also:
    SecurityRealm
    • Constructor Detail

      • PluginServletFilter

        public PluginServletFilter()
    • Method Detail

      • init

        public void init​(javax.servlet.FilterConfig config)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • addFilter

        public static void addFilter​(javax.servlet.Filter filter)
                              throws javax.servlet.ServletException
        Throws:
        javax.servlet.ServletException
      • hasFilter

        public static boolean hasFilter​(javax.servlet.Filter filter)
        Checks whether the given filter is already registered in the chain.
        Parameters:
        filter - the filter to check.
        Returns:
        true if the filter is already registered in the chain.
        Since:
        2.94
      • removeFilter

        public static void removeFilter​(javax.servlet.Filter filter)
                                 throws javax.servlet.ServletException
        Throws:
        javax.servlet.ServletException
      • doFilter

        public void doFilter​(javax.servlet.ServletRequest request,
                             javax.servlet.ServletResponse response,
                             javax.servlet.FilterChain chain)
                      throws IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Throws:
        IOException
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Filter
      • cleanUp

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public static void cleanUp()