org.glassfish.jersey.examples.managedclient
Class CustomHeaderFilter
java.lang.Object
org.glassfish.jersey.examples.managedclient.CustomHeaderFilter
- All Implemented Interfaces:
- javax.ws.rs.client.ClientRequestFilter, javax.ws.rs.container.ContainerRequestFilter
public class CustomHeaderFilter
- extends Object
- implements javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.client.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)
|
Method Summary |
void |
filter(javax.ws.rs.client.ClientRequestContext ctx)
|
void |
filter(javax.ws.rs.container.ContainerRequestContext ctx)
|
| 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(javax.ws.rs.container.ContainerRequestContext ctx)
throws IOException
- Specified by:
filter in interface javax.ws.rs.container.ContainerRequestFilter
- Throws:
IOException
filter
public void filter(javax.ws.rs.client.ClientRequestContext ctx)
throws IOException
- Specified by:
filter in interface javax.ws.rs.client.ClientRequestFilter
- Throws:
IOException
Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.