@Provider public class DigitalSigningInterceptor extends Object implements WriterInterceptor, ClientExecutionInterceptor, ContainerResponseFilter, ClientRequestFilter
Constructor and Description |
---|
DigitalSigningInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
aroundWriteTo(WriterInterceptorContext context)
|
ClientResponse |
execute(ClientExecutionContext context) |
void |
filter(ClientRequestContext requestContext)
Filter method called before a request has been dispatched to a client
transport layer.
|
void |
filter(ContainerRequestContext requestContext,
ContainerResponseContext responseContext)
Filter method called after a response has been provided for a request
(either by a
request filter or by a
matched resource method. |
protected List<DKIMSignature> |
getHeaders(MultivaluedMap<String,Object> headers) |
protected void |
sign(KeyRepository repository,
MultivaluedMap<String,Object> headers,
byte[] body,
DKIMSignature dosetaSignature) |
protected List<DKIMSignature> getHeaders(MultivaluedMap<String,Object> headers)
public void filter(ClientRequestContext requestContext) throws IOException
ClientRequestFilter
javax.annotation.Priority
class-level annotation value.filter
in interface ClientRequestFilter
requestContext
- request context.IOException
- if an I/O exception occurs.public ClientResponse execute(ClientExecutionContext context) throws Exception
execute
in interface ClientExecutionInterceptor
Exception
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException
ContainerResponseFilter
request filter
or by a
matched resource method.
Filters in the filter chain are ordered according to their javax.annotation.Priority
class-level annotation value.
filter
in interface ContainerResponseFilter
requestContext
- request context.responseContext
- response context.IOException
- if an I/O exception occurs.public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException
WriterInterceptor
MessageBodyWriter.writeTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, java.io.OutputStream)
method.
The parameters of the wrapped method called are available from context
.
Implementations of this method SHOULD explicitly call
WriterInterceptorContext.proceed()
to invoke the next interceptor in the chain,
and ultimately the wrapped MessageBodyWriter.writeTo
method.aroundWriteTo
in interface WriterInterceptor
context
- invocation context.IOException
- if an IO error arises or is thrown by the wrapped
MessageBodyWriter.writeTo
method.WebApplicationException
- thrown by the wrapped MessageBodyWriter.writeTo
method.protected void sign(KeyRepository repository, MultivaluedMap<String,Object> headers, byte[] body, DKIMSignature dosetaSignature) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException
Copyright © 2015. All Rights Reserved.