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
-
-
Constructor Summary
Constructors Constructor Description CustomHeaderFilter(String headerName, String headerValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilter(ClientRequestContext ctx)voidfilter(ContainerRequestContext ctx)
-
-
-
Method Detail
-
filter
public void filter(ContainerRequestContext ctx) throws IOException
- Specified by:
filterin interfaceContainerRequestFilter- Throws:
IOException
-
filter
public void filter(ClientRequestContext ctx) throws IOException
- Specified by:
filterin interfaceClientRequestFilter- Throws:
IOException
-
-