Package io.servicetalk.http.api
Class HttpApiConversions
java.lang.Object
io.servicetalk.http.api.HttpApiConversions
Conversion routines to
StreamingHttpService.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.this interface is not needed anymore and will be removed in a future version with no replacement. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPayloadEmpty(HttpMetaData metadata) Checks whether a request/response payload body is empty.static booleanisSafeToAggregate(HttpMetaData metadata) Checks whether a request/response payload is safe to aggregate, which may allow for writing a `content-length` header.static booleanmayHaveTrailers(HttpMetaData metadata) Checks whether a request/response payload may have trailers.static BlockingHttpClienttoBlockingClient(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClienttoBlockingHttpClient.static BlockingHttpClienttoBlockingClient(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerstatic BlockingHttpConnectiontoBlockingConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) static BlockingHttpConnectiontoBlockingConnection(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerstatic BlockingHttpServiceConvert from aStreamingHttpServiceto aBlockingHttpService.static BlockingStreamingHttpClienttoBlockingStreamingClient(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClienttoBlockingStreamingHttpClient.static BlockingStreamingHttpClienttoBlockingStreamingClient(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencertoBlockingStreamingConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) toBlockingStreamingConnection(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerstatic BlockingStreamingHttpServiceConvert from aStreamingHttpServiceto aBlockingStreamingHttpService.static HttpClienttoClient(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClienttoHttpClient.static HttpClienttoClient(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerstatic HttpConnectiontoConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) Deprecated.static HttpConnectiontoConnection(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerstatic HttpServicetoHttpService(StreamingHttpService service) Convert from aStreamingHttpServiceto aHttpService.toReservedBlockingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnectiontoReservedBlockingHttpConnection.toReservedBlockingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencertoReservedBlockingStreamingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnectiontoReservedBlockingStreamingHttpConnection.toReservedBlockingStreamingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerstatic ReservedHttpConnectiontoReservedConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnectiontoReservedHttpConnection.static ReservedHttpConnectiontoReservedConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencertoStreamingHttpService(BlockingHttpService service, HttpExecutionStrategy strategy) Deprecated.toStreamingHttpService(BlockingHttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.toStreamingHttpService(BlockingStreamingHttpService service, HttpExecutionStrategy strategy) Deprecated.toStreamingHttpService(BlockingStreamingHttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.static StreamingHttpServicetoStreamingHttpService(HttpExecutionStrategy strategy, BlockingHttpService service) Convert from aBlockingHttpServiceto aStreamingHttpService.static StreamingHttpServicetoStreamingHttpService(HttpExecutionStrategy strategy, BlockingStreamingHttpService service) Convert from aBlockingStreamingHttpServiceto aStreamingHttpService.static StreamingHttpServicetoStreamingHttpService(HttpExecutionStrategy strategy, HttpService service) Convert from aHttpServiceto aStreamingHttpService.toStreamingHttpService(HttpService service, HttpExecutionStrategy strategy) Deprecated.toStreamingHttpService(HttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.
-
Method Details
-
toReservedConnection
@Deprecated public static ReservedHttpConnection toReservedConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromReservedStreamingHttpConnectiontoReservedHttpConnection.- Parameters:
original-ReservedStreamingHttpConnectionto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedReservedHttpConnection- Returns:
- The conversion result.
-
toReservedConnection
public static ReservedHttpConnection toReservedConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnectiontoReservedHttpConnection.- Parameters:
original-ReservedStreamingHttpConnectionto convert.strategy- required strategy for the service when invoking the resultingReservedHttpConnection- Returns:
- The conversion result.
-
toReservedBlockingConnection
@Deprecated public static ReservedBlockingHttpConnection toReservedBlockingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromReservedStreamingHttpConnectiontoReservedBlockingHttpConnection.- Parameters:
original-ReservedStreamingHttpConnectionto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedReservedBlockingHttpConnection- Returns:
- The conversion result.
-
toReservedBlockingConnection
public static ReservedBlockingHttpConnection toReservedBlockingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnectiontoReservedBlockingHttpConnection.- Parameters:
original-ReservedStreamingHttpConnectionto convert.strategy- required strategy for the service when invoking the resultingReservedBlockingHttpConnection- Returns:
- The conversion result.
-
toReservedBlockingStreamingConnection
@Deprecated public static ReservedBlockingStreamingHttpConnection toReservedBlockingStreamingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromReservedStreamingHttpConnectiontoReservedBlockingStreamingHttpConnection.- Parameters:
original-ReservedStreamingHttpConnectionto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedReservedBlockingStreamingHttpConnection- Returns:
- The conversion result.
-
toReservedBlockingStreamingConnection
public static ReservedBlockingStreamingHttpConnection toReservedBlockingStreamingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnectiontoReservedBlockingStreamingHttpConnection.- Parameters:
original-ReservedStreamingHttpConnectionto convert.strategy- required strategy for the service when invoking the resultingReservedBlockingStreamingHttpConnection- Returns:
- The conversion result.
-
toConnection
@Deprecated public static HttpConnection toConnection(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromStreamingHttpConnectiontoHttpConnection.- Parameters:
original-StreamingHttpConnectionto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedHttpConnection- Returns:
- The conversion result.
-
toConnection
@Deprecated public static HttpConnection toConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) Deprecated.Convert fromStreamingHttpConnectiontoHttpConnection.- Parameters:
original-StreamingHttpConnectionto convert.strategy- required strategy for the service when invoking the resultingHttpConnection- Returns:
- The conversion result.
-
toBlockingConnection
@Deprecated public static BlockingHttpConnection toBlockingConnection(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromStreamingHttpConnectiontoBlockingHttpConnection.- Parameters:
original-StreamingHttpConnectionto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedBlockingHttpConnection- Returns:
- The conversion result.
-
toBlockingConnection
@Deprecated public static BlockingHttpConnection toBlockingConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) Deprecated.Convert fromStreamingHttpConnectiontoBlockingHttpConnection.- Parameters:
original-StreamingHttpConnectionto convert.strategy- required strategy for the service when invoking the resultingBlockingHttpConnection- Returns:
- The conversion result.
-
toBlockingStreamingConnection
@Deprecated public static BlockingStreamingHttpConnection toBlockingStreamingConnection(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromStreamingHttpConnectiontoBlockingStreamingHttpConnection.- Parameters:
original-StreamingHttpConnectionto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedBlockingStreamingHttpConnection- Returns:
- The conversion result.
-
toBlockingStreamingConnection
@Deprecated public static BlockingStreamingHttpConnection toBlockingStreamingConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) Deprecated.Convert fromStreamingHttpConnectiontoBlockingStreamingHttpConnection.- Parameters:
original-StreamingHttpConnectionto convert.strategy- required strategy for the service when invoking the resultingBlockingStreamingHttpConnection- Returns:
- The conversion result.
-
toClient
@Deprecated public static HttpClient toClient(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromStreamingHttpClienttoHttpClient.- Parameters:
original-StreamingHttpClientto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedHttpClient- Returns:
- The conversion result.
-
toClient
Convert fromStreamingHttpClienttoHttpClient.- Parameters:
original-StreamingHttpClientto convert.strategy- required strategy for the service when invoking the resultingHttpClient- Returns:
- The conversion result.
-
toBlockingClient
@Deprecated public static BlockingHttpClient toBlockingClient(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromStreamingHttpClienttoBlockingHttpClient.- Parameters:
original-StreamingHttpClientto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedBlockingHttpClient- Returns:
- The conversion result.
-
toBlockingClient
public static BlockingHttpClient toBlockingClient(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClienttoBlockingHttpClient.- Parameters:
original-StreamingHttpClientto convert.strategy- required strategy for the service when invoking the resultingBlockingHttpClient- Returns:
- The conversion result.
-
toBlockingStreamingClient
@Deprecated public static BlockingStreamingHttpClient toBlockingStreamingClient(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategyrather thanHttpExecutionStrategyInfluencerConvert fromStreamingHttpClienttoBlockingStreamingHttpClient.- Parameters:
original-StreamingHttpClientto convert.influencer-HttpExecutionStrategyInfluencerto use to derive the strategy of the returnedBlockingStreamingHttpClient- Returns:
- The conversion result.
-
toBlockingStreamingClient
public static BlockingStreamingHttpClient toBlockingStreamingClient(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClienttoBlockingStreamingHttpClient.- Parameters:
original-StreamingHttpClientto convert.strategy- required strategy for the service when invoking the resultingBlockingStreamingHttpClient- Returns:
- The conversion result.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(HttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.Convert from aHttpServiceto aStreamingHttpService.- Parameters:
service- TheHttpServiceto convert.influencer-HttpExecutionStrategyInfluencerto influence the strategy for invoking the resultingStreamingHttpService.- Returns:
HttpApiConversions.ServiceAdapterHoldercontaining the service adapted to the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(HttpService service, HttpExecutionStrategy strategy) Deprecated.Convert from aHttpServiceto aStreamingHttpService.- Parameters:
service- TheHttpServiceto convert.strategy- required strategy for the service when invoking the resultingHttpApiConversions.ServiceAdapterHolder.- Returns:
HttpApiConversions.ServiceAdapterHoldercontaining the service adapted to the streaming programming model.
-
toStreamingHttpService
public static StreamingHttpService toStreamingHttpService(HttpExecutionStrategy strategy, HttpService service) Convert from aHttpServiceto aStreamingHttpService.- Parameters:
service- TheHttpServiceto convert.strategy- required strategy for the service when invoking the resultingStreamingHttpService.- Returns:
- the converted
StreamingHttpServiceto be used for the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(BlockingStreamingHttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.Convert from aBlockingStreamingHttpServiceto aStreamingHttpService.- Parameters:
service- TheBlockingStreamingHttpServiceto convert.influencer-HttpExecutionStrategyInfluencerto influence the strategy for invoking the resultingStreamingHttpService.- Returns:
HttpApiConversions.ServiceAdapterHoldercontaining the service adapted to the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(BlockingStreamingHttpService service, HttpExecutionStrategy strategy) Deprecated.Convert from aBlockingStreamingHttpServiceto aStreamingHttpService.- Parameters:
service- TheBlockingStreamingHttpServiceto convert.strategy- required strategy for the service when invoking the resultingStreamingHttpService.- Returns:
HttpApiConversions.ServiceAdapterHoldercontaining the service adapted to the streaming programming model.
-
toStreamingHttpService
public static StreamingHttpService toStreamingHttpService(HttpExecutionStrategy strategy, BlockingStreamingHttpService service) Convert from aBlockingStreamingHttpServiceto aStreamingHttpService.- Parameters:
strategy- required strategy for the service when invoking the resultingStreamingHttpService.service- TheBlockingStreamingHttpServiceto convert.- Returns:
- the converted
StreamingHttpServiceto be used for the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(BlockingHttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.Convert from aBlockingHttpServiceto aStreamingHttpService.- Parameters:
service- TheBlockingHttpServiceto convert.influencer-HttpExecutionStrategyInfluencerto influence the strategy for invoking the resultingStreamingHttpService.- Returns:
HttpApiConversions.ServiceAdapterHoldercontaining the service adapted to the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(BlockingHttpService service, HttpExecutionStrategy strategy) Deprecated.Convert from aBlockingHttpServiceto aStreamingHttpService.- Parameters:
service- TheBlockingHttpServiceto convert.strategy- required strategy for the service when invoking the resultingHttpApiConversions.ServiceAdapterHolder.- Returns:
HttpApiConversions.ServiceAdapterHoldercontaining the service adapted to the streaming programming model.
-
toStreamingHttpService
public static StreamingHttpService toStreamingHttpService(HttpExecutionStrategy strategy, BlockingHttpService service) Convert from aBlockingHttpServiceto aStreamingHttpService.- Parameters:
strategy- required strategy for the service when invoking the resultingStreamingHttpService.service- TheBlockingHttpServiceto convert.- Returns:
- the converted
StreamingHttpServiceto be used for the streaming programming model.
-
isPayloadEmpty
Checks whether a request/response payload body is empty.- Parameters:
metadata- The request/response to check.- Returns:
trueis the request/response payload body is empty,falseotherwise.
-
isSafeToAggregate
Checks whether a request/response payload is safe to aggregate, which may allow for writing a `content-length` header.- Parameters:
metadata- The request/response to check.- Returns:
trueis the request/response payload is safe to aggregate,falseotherwise.
-
mayHaveTrailers
Checks whether a request/response payload may have trailers.- Parameters:
metadata- The request/response to check.- Returns:
trueis the request/response payload may have trailers,falseotherwise.
-
toBlockingHttpService
Convert from aStreamingHttpServiceto aBlockingHttpService.- Parameters:
service- TheStreamingHttpServiceto convert.- Returns:
- The conversion result.
-
toHttpService
Convert from aStreamingHttpServiceto aHttpService.- Parameters:
service- TheStreamingHttpServiceto convert.- Returns:
- The conversion result.
-
toBlockingStreamingHttpService
public static BlockingStreamingHttpService toBlockingStreamingHttpService(StreamingHttpService service) Convert from aStreamingHttpServiceto aBlockingStreamingHttpService.- Parameters:
service- TheStreamingHttpServiceto convert.- Returns:
- The conversion result.
-