diff options
author | David Ostrovsky <david@ostrovsky.org> | 2014-03-10 01:50:49 +0100 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-05-05 11:16:30 -0400 |
commit | ec24568f14ee38b264c86133ce8ebcc35a39034b (patch) | |
tree | 053fc0a9c67a81ca7f7290f2e1e8f7f9ea5276e1 /src/main/java/com/gitblit/extensions | |
parent | 3920e1f852b0417fd1217095d7ec12cbd6f41cb8 (diff) | |
download | gitblit-ec24568f14ee38b264c86133ce8ebcc35a39034b.tar.gz gitblit-ec24568f14ee38b264c86133ce8ebcc35a39034b.zip |
Add http request filter extension point
To allow for integration of 3rd party server monitoring solutions,
Gitblit needs to expose an extension point for collecting http data.
Diffstat (limited to 'src/main/java/com/gitblit/extensions')
-rw-r--r-- | src/main/java/com/gitblit/extensions/HttpRequestFilter.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/extensions/HttpRequestFilter.java b/src/main/java/com/gitblit/extensions/HttpRequestFilter.java new file mode 100644 index 00000000..e3e330cb --- /dev/null +++ b/src/main/java/com/gitblit/extensions/HttpRequestFilter.java @@ -0,0 +1,49 @@ +/* + * Copyright 2014 gitblit.com. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gitblit.extensions; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import ro.fortsoft.pf4j.ExtensionPoint; + +/** + * Extension point to intercept HTTP requests passing through the server. + * + * @author David Ostrovsky + * @since 1.6.0 + * + */ +public abstract class HttpRequestFilter implements Filter, ExtensionPoint { + + @Override + public void init(FilterConfig config) throws ServletException { + } + + @Override + public void destroy() { + } + + @Override + public abstract void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException; +} |