org.glassfish.jersey.examples.managedclient
Class CustomHeaderFilter
java.lang.Object
org.glassfish.jersey.examples.managedclient.CustomHeaderFilter
- All Implemented Interfaces:
- ClientRequestFilter, ContainerRequestFilter
public class CustomHeaderFilter
- extends Object
- implements ContainerRequestFilter, ClientRequestFilter
A filter for appending and validating custom headers.
On the client side, appends a new custom request header with a configured name and value to each outgoing request.
On the server side, validates that each request has a custom header with a configured name and value.
If the validation fails a HTTP 403 response is returned.
- Author:
- Marek Potociar (marek.potociar at oracle.com)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CustomHeaderFilter
public CustomHeaderFilter(String headerName,
String headerValue)
filter
public void filter(ContainerRequestContext ctx)
throws IOException
- Specified by:
filter in interface ContainerRequestFilter
- Throws:
IOException
filter
public void filter(ClientRequestContext ctx)
throws IOException
- Specified by:
filter in interface ClientRequestFilter
- Throws:
IOException
Copyright © 2007-2013 Oracle Corporation. All Rights Reserved. Use is subject to license terms.