Package io.servicetalk.http.api
Class ContentEncodingHttpRequesterFilter
java.lang.Object
io.servicetalk.http.api.ContentEncodingHttpRequesterFilter
- All Implemented Interfaces:
HttpExecutionStrategyInfluencer,StreamingHttpClientFilterFactory,StreamingHttpConnectionFilterFactory,ExecutionStrategyInfluencer<HttpExecutionStrategy>
public final class ContentEncodingHttpRequesterFilter
extends Object
implements StreamingHttpClientFilterFactory, StreamingHttpConnectionFilterFactory
A
StreamingHttpClientFilter that adds encoding / decoding functionality for requests and responses
respectively, as these are specified by the spec
Content-Encoding.
Append this filter before others that are expected to see compressed content for this request/response, and after other filters that expect to manipulate the original payload.
-
Constructor Summary
ConstructorsConstructorDescriptionContentEncodingHttpRequesterFilter(BufferDecoderGroup decompressors) Create a new instance and specify the supported decompression (advertised inHttpHeaderNames.ACCEPT_ENCODING). -
Method Summary
Modifier and TypeMethodDescriptioncreate(FilterableStreamingHttpClient client) Creates aStreamingHttpClientFilterusing the providedStreamingHttpClientFilter.create(FilterableStreamingHttpConnection connection) Create aStreamingHttpConnectionFilterusing the providedFilterableStreamingHttpConnection.Return anExecutionStrategythat describes the offloads required by the influencer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.servicetalk.http.api.HttpExecutionStrategyInfluencer
influenceStrategy
-
Constructor Details
-
ContentEncodingHttpRequesterFilter
Create a new instance and specify the supported decompression (advertised inHttpHeaderNames.ACCEPT_ENCODING). The compression is specified viaHttpRequestMetaData.contentEncoding(). The order of entries may impact the selection preference.- Parameters:
decompressors- the decompression supported to decode responses accordingly and also used to advertiseHttpHeaderNames.ACCEPT_ENCODINGto the server.
-
-
Method Details
-
create
Description copied from interface:StreamingHttpClientFilterFactoryCreates aStreamingHttpClientFilterusing the providedStreamingHttpClientFilter.- Specified by:
createin interfaceStreamingHttpClientFilterFactory- Parameters:
client-FilterableStreamingHttpClientto filter- Returns:
StreamingHttpClientFilterusing the providedStreamingHttpClientFilter.
-
create
Description copied from interface:StreamingHttpConnectionFilterFactoryCreate aStreamingHttpConnectionFilterusing the providedFilterableStreamingHttpConnection.- Specified by:
createin interfaceStreamingHttpConnectionFilterFactory- Parameters:
connection-FilterableStreamingHttpConnectionto filter- Returns:
StreamingHttpConnectionFilterusing the providedFilterableStreamingHttpConnection.
-
requiredOffloads
Description copied from interface:HttpExecutionStrategyInfluencerReturn anExecutionStrategythat describes the offloads required by the influencer.The provided default implementation requests offloading of all operations. Implementations that require no offloading should be careful to return
HttpExecutionStrategies.offloadNone()rather thanHttpExecutionStrategies.offloadNever(). Implementations should avoid returningHttpExecutionStrategies.defaultStrategy(), instead returning the strategy they require orHttpExecutionStrategies.offloadAll()if offloading for all paths is required (safe default).- Specified by:
requiredOffloadsin interfaceExecutionStrategyInfluencer<HttpExecutionStrategy>- Specified by:
requiredOffloadsin interfaceHttpExecutionStrategyInfluencer- Returns:
- the
ExecutionStrategyrequired by the influencer.
-