public final class ContentCodingHttpServiceFilter extends Object implements StreamingHttpServiceFilterFactory, HttpExecutionStrategyInfluencer
StreamingHttpService that adds encoding / decoding functionality for responses and requests respectively,
as these are specified by the spec
Content-Encoding.
Append this filter before others that are expected to to see compressed content for this request/response, and after other filters that expect to see/manipulate the original payload.
| Constructor and Description |
|---|
ContentCodingHttpServiceFilter(List<ContentCodec> supportedCodings)
Enable support of the provided encodings for this server's responses.
|
ContentCodingHttpServiceFilter(List<ContentCodec> supportedRequestCodings,
List<ContentCodec> supportedResponseCodings)
Enable support of the provided encodings for both client requests and server responses.
|
| Modifier and Type | Method and Description |
|---|---|
StreamingHttpServiceFilter |
create(StreamingHttpService service)
Create a
StreamingHttpServiceFilter using the provided StreamingHttpService. |
HttpExecutionStrategy |
influenceStrategy(HttpExecutionStrategy strategy)
Optionally modify the passed
HttpExecutionStrategy to a new HttpExecutionStrategy that suits
this HttpExecutionStrategyInfluencer. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappenddefaultStreamingInfluencerpublic ContentCodingHttpServiceFilter(List<ContentCodec> supportedCodings)
Client requests that have compressed payloads will be rejected.
To enable support of compressed requests, see ContentCodingHttpServiceFilter(List, List).
supportedCodings - the codecs used to compress responses when allowed.public ContentCodingHttpServiceFilter(List<ContentCodec> supportedRequestCodings,
List<ContentCodec> supportedResponseCodings)
To disable support of compressed requests use an Collections.emptyList() for the
supportedRequestCodings param or use ContentCodingHttpServiceFilter(List) constructor
instead.
The order of the codecs provided, affect selection priority alongside the order of the incoming accept-encoding header from the client.
supportedRequestCodings - the codecs used to decompress client requests if compressed.supportedResponseCodings - the codecs used to compress server responses if client accepts them.public StreamingHttpServiceFilter create(StreamingHttpService service)
StreamingHttpServiceFilterFactoryStreamingHttpServiceFilter using the provided StreamingHttpService.create in interface StreamingHttpServiceFilterFactoryservice - StreamingHttpService to filterStreamingHttpServiceFilter using the provided StreamingHttpService.public HttpExecutionStrategy influenceStrategy(HttpExecutionStrategy strategy)
HttpExecutionStrategyInfluencerHttpExecutionStrategy to a new HttpExecutionStrategy that suits
this HttpExecutionStrategyInfluencer.influenceStrategy in interface HttpExecutionStrategyInfluencerstrategy - HttpExecutionStrategy to influence.HttpExecutionStrategy that suits this HttpExecutionStrategyInfluencer