Class MetaFilter
java.lang.Object
org.eclipse.jgit.http.server.glue.MetaFilter
- All Implemented Interfaces:
javax.servlet.Filter
- Direct Known Subclasses:
GitFilter
Generic container filter to manage routing to different pipelines.
Callers can create and configure a new processing pipeline by using one of
the serve(String)
or serveRegex(String)
methods to allocate
a binder for a particular URL pattern.
Registered filters and servlets are initialized lazily, usually during the first request. Once initialized the bindings in this servlet cannot be modified without destroying the servlet and thereby destroying all registered filters and servlets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<ServletBinderImpl> private UrlPipeline[]
(package private) static final String
private javax.servlet.ServletContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate UrlPipeline[]
void
destroy()
void
doFilter
(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) private UrlPipeline
find
(javax.servlet.http.HttpServletRequest req) private UrlPipeline[]
void
init
(javax.servlet.FilterConfig filterConfig) protected ServletBinder
Configure a newly created binder.private ServletBinder
Construct a binding for a specific path.serveRegex
(String expression) Construct a binding for a regular expression.serveRegex
(Pattern pattern) Construct a binding for a regular expression.
-
Field Details
-
REGEX_GROUPS
- See Also:
-
servletContext
private javax.servlet.ServletContext servletContext -
bindings
-
pipelines
-
-
Constructor Details
-
MetaFilter
public MetaFilter()Empty filter with no bindings.
-
-
Method Details
-
serve
Construct a binding for a specific path.- Parameters:
path
- pattern to match.- Returns:
- binder for the passed path.
-
serveRegex
Construct a binding for a regular expression.- Parameters:
expression
- the regular expression to pattern match the URL against.- Returns:
- binder for the passed expression.
-
serveRegex
Construct a binding for a regular expression.- Parameters:
pattern
- the regular expression to pattern match the URL against.- Returns:
- binder for the passed expression.
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException - Specified by:
init
in interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroy
in interfacejavax.servlet.Filter
-
newIdentitySet
-
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 interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
find
private UrlPipeline find(javax.servlet.http.HttpServletRequest req) throws javax.servlet.ServletException - Throws:
javax.servlet.ServletException
-
register
-
register
Configure a newly created binder.- Parameters:
b
- the newly created binder.- Returns:
- binder for the caller, potentially after adding one or more filters into the pipeline.
-
getPipelines
- Throws:
javax.servlet.ServletException
-
createPipelines
- Throws:
javax.servlet.ServletException
-