Package io.servicetalk.http.api
Class HttpApiConversions
java.lang.Object
io.servicetalk.http.api.HttpApiConversions
Conversion routines to
StreamingHttpService
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Deprecated.this interface is not needed anymore and will be removed in a future version with no replacement. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isPayloadEmpty
(HttpMetaData metadata) Checks whether a request/response payload body is empty.static boolean
isSafeToAggregate
(HttpMetaData metadata) Checks whether a request/response payload is safe to aggregate, which may allow for writing a `content-length` header.static boolean
mayHaveTrailers
(HttpMetaData metadata) Checks whether a request/response payload may have trailers.static BlockingHttpClient
toBlockingClient
(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClient
toBlockingHttpClient
.static BlockingHttpClient
toBlockingClient
(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
static BlockingHttpConnection
toBlockingConnection
(StreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromStreamingHttpConnection
toBlockingHttpConnection
.static BlockingHttpConnection
toBlockingConnection
(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
static BlockingHttpService
Convert from aStreamingHttpService
to aBlockingHttpService
.static BlockingStreamingHttpClient
toBlockingStreamingClient
(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClient
toBlockingStreamingHttpClient
.static BlockingStreamingHttpClient
toBlockingStreamingClient
(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
toBlockingStreamingConnection
(StreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromStreamingHttpConnection
toBlockingStreamingHttpConnection
.toBlockingStreamingConnection
(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
static BlockingStreamingHttpService
Convert from aStreamingHttpService
to aBlockingStreamingHttpService
.static HttpClient
toClient
(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClient
toHttpClient
.static HttpClient
toClient
(StreamingHttpClient original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
static HttpConnection
toConnection
(StreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromStreamingHttpConnection
toHttpConnection
.static HttpConnection
toConnection
(StreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
static HttpService
toHttpService
(StreamingHttpService service) Convert from aStreamingHttpService
to aHttpService
.toReservedBlockingConnection
(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnection
toReservedBlockingHttpConnection
.toReservedBlockingConnection
(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
toReservedBlockingStreamingConnection
(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnection
toReservedBlockingStreamingHttpConnection
.toReservedBlockingStreamingConnection
(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
static ReservedHttpConnection
toReservedConnection
(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnection
toReservedHttpConnection
.static ReservedHttpConnection
toReservedConnection
(ReservedStreamingHttpConnection original, HttpExecutionStrategyInfluencer influencer) Deprecated.Use overload withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
toStreamingHttpService
(BlockingHttpService service, HttpExecutionStrategy strategy) Deprecated.toStreamingHttpService
(BlockingHttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.toStreamingHttpService
(BlockingStreamingHttpService service, HttpExecutionStrategy strategy) Deprecated.toStreamingHttpService
(BlockingStreamingHttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.static StreamingHttpService
toStreamingHttpService
(HttpExecutionStrategy strategy, BlockingHttpService service) Convert from aBlockingHttpService
to aStreamingHttpService
.static StreamingHttpService
toStreamingHttpService
(HttpExecutionStrategy strategy, BlockingStreamingHttpService service) Convert from aBlockingStreamingHttpService
to aStreamingHttpService
.static StreamingHttpService
toStreamingHttpService
(HttpExecutionStrategy strategy, HttpService service) Convert from aHttpService
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromReservedStreamingHttpConnection
toReservedHttpConnection
.- Parameters:
original
-ReservedStreamingHttpConnection
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedReservedHttpConnection
- Returns:
- The conversion result.
-
toReservedConnection
public static ReservedHttpConnection toReservedConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnection
toReservedHttpConnection
.- Parameters:
original
-ReservedStreamingHttpConnection
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromReservedStreamingHttpConnection
toReservedBlockingHttpConnection
.- Parameters:
original
-ReservedStreamingHttpConnection
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedReservedBlockingHttpConnection
- Returns:
- The conversion result.
-
toReservedBlockingConnection
public static ReservedBlockingHttpConnection toReservedBlockingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnection
toReservedBlockingHttpConnection
.- Parameters:
original
-ReservedStreamingHttpConnection
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromReservedStreamingHttpConnection
toReservedBlockingStreamingHttpConnection
.- Parameters:
original
-ReservedStreamingHttpConnection
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedReservedBlockingStreamingHttpConnection
- Returns:
- The conversion result.
-
toReservedBlockingStreamingConnection
public static ReservedBlockingStreamingHttpConnection toReservedBlockingStreamingConnection(ReservedStreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromReservedStreamingHttpConnection
toReservedBlockingStreamingHttpConnection
.- Parameters:
original
-ReservedStreamingHttpConnection
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromStreamingHttpConnection
toHttpConnection
.- Parameters:
original
-StreamingHttpConnection
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedHttpConnection
- Returns:
- The conversion result.
-
toConnection
public static HttpConnection toConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromStreamingHttpConnection
toHttpConnection
.- Parameters:
original
-StreamingHttpConnection
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromStreamingHttpConnection
toBlockingHttpConnection
.- Parameters:
original
-StreamingHttpConnection
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedBlockingHttpConnection
- Returns:
- The conversion result.
-
toBlockingConnection
public static BlockingHttpConnection toBlockingConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromStreamingHttpConnection
toBlockingHttpConnection
.- Parameters:
original
-StreamingHttpConnection
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromStreamingHttpConnection
toBlockingStreamingHttpConnection
.- Parameters:
original
-StreamingHttpConnection
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedBlockingStreamingHttpConnection
- Returns:
- The conversion result.
-
toBlockingStreamingConnection
public static BlockingStreamingHttpConnection toBlockingStreamingConnection(StreamingHttpConnection original, HttpExecutionStrategy strategy) Convert fromStreamingHttpConnection
toBlockingStreamingHttpConnection
.- Parameters:
original
-StreamingHttpConnection
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromStreamingHttpClient
toHttpClient
.- Parameters:
original
-StreamingHttpClient
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedHttpClient
- Returns:
- The conversion result.
-
toClient
Convert fromStreamingHttpClient
toHttpClient
.- Parameters:
original
-StreamingHttpClient
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromStreamingHttpClient
toBlockingHttpClient
.- Parameters:
original
-StreamingHttpClient
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedBlockingHttpClient
- Returns:
- The conversion result.
-
toBlockingClient
public static BlockingHttpClient toBlockingClient(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClient
toBlockingHttpClient
.- Parameters:
original
-StreamingHttpClient
to 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 withHttpExecutionStrategy
rather thanHttpExecutionStrategyInfluencer
Convert fromStreamingHttpClient
toBlockingStreamingHttpClient
.- Parameters:
original
-StreamingHttpClient
to convert.influencer
-HttpExecutionStrategyInfluencer
to use to derive the strategy of the returnedBlockingStreamingHttpClient
- Returns:
- The conversion result.
-
toBlockingStreamingClient
public static BlockingStreamingHttpClient toBlockingStreamingClient(StreamingHttpClient original, HttpExecutionStrategy strategy) Convert fromStreamingHttpClient
toBlockingStreamingHttpClient
.- Parameters:
original
-StreamingHttpClient
to 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 aHttpService
to aStreamingHttpService
.- Parameters:
service
- TheHttpService
to convert.influencer
-HttpExecutionStrategyInfluencer
to influence the strategy for invoking the resultingStreamingHttpService
.- Returns:
HttpApiConversions.ServiceAdapterHolder
containing the service adapted to the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(HttpService service, HttpExecutionStrategy strategy) Deprecated.Convert from aHttpService
to aStreamingHttpService
.- Parameters:
service
- TheHttpService
to convert.strategy
- required strategy for the service when invoking the resultingHttpApiConversions.ServiceAdapterHolder
.- Returns:
HttpApiConversions.ServiceAdapterHolder
containing the service adapted to the streaming programming model.
-
toStreamingHttpService
public static StreamingHttpService toStreamingHttpService(HttpExecutionStrategy strategy, HttpService service) Convert from aHttpService
to aStreamingHttpService
.- Parameters:
service
- TheHttpService
to convert.strategy
- required strategy for the service when invoking the resultingStreamingHttpService
.- Returns:
- the converted
StreamingHttpService
to be used for the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(BlockingStreamingHttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.Convert from aBlockingStreamingHttpService
to aStreamingHttpService
.- Parameters:
service
- TheBlockingStreamingHttpService
to convert.influencer
-HttpExecutionStrategyInfluencer
to influence the strategy for invoking the resultingStreamingHttpService
.- Returns:
HttpApiConversions.ServiceAdapterHolder
containing the service adapted to the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(BlockingStreamingHttpService service, HttpExecutionStrategy strategy) Deprecated.Convert from aBlockingStreamingHttpService
to aStreamingHttpService
.- Parameters:
service
- TheBlockingStreamingHttpService
to convert.strategy
- required strategy for the service when invoking the resultingStreamingHttpService
.- Returns:
HttpApiConversions.ServiceAdapterHolder
containing the service adapted to the streaming programming model.
-
toStreamingHttpService
public static StreamingHttpService toStreamingHttpService(HttpExecutionStrategy strategy, BlockingStreamingHttpService service) Convert from aBlockingStreamingHttpService
to aStreamingHttpService
.- Parameters:
strategy
- required strategy for the service when invoking the resultingStreamingHttpService
.service
- TheBlockingStreamingHttpService
to convert.- Returns:
- the converted
StreamingHttpService
to be used for the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(BlockingHttpService service, HttpExecutionStrategyInfluencer influencer) Deprecated.Convert from aBlockingHttpService
to aStreamingHttpService
.- Parameters:
service
- TheBlockingHttpService
to convert.influencer
-HttpExecutionStrategyInfluencer
to influence the strategy for invoking the resultingStreamingHttpService
.- Returns:
HttpApiConversions.ServiceAdapterHolder
containing the service adapted to the streaming programming model.
-
toStreamingHttpService
@Deprecated public static HttpApiConversions.ServiceAdapterHolder toStreamingHttpService(BlockingHttpService service, HttpExecutionStrategy strategy) Deprecated.Convert from aBlockingHttpService
to aStreamingHttpService
.- Parameters:
service
- TheBlockingHttpService
to convert.strategy
- required strategy for the service when invoking the resultingHttpApiConversions.ServiceAdapterHolder
.- Returns:
HttpApiConversions.ServiceAdapterHolder
containing the service adapted to the streaming programming model.
-
toStreamingHttpService
public static StreamingHttpService toStreamingHttpService(HttpExecutionStrategy strategy, BlockingHttpService service) Convert from aBlockingHttpService
to aStreamingHttpService
.- Parameters:
strategy
- required strategy for the service when invoking the resultingStreamingHttpService
.service
- TheBlockingHttpService
to convert.- Returns:
- the converted
StreamingHttpService
to 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:
true
is the request/response payload body is empty,false
otherwise.
-
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:
true
is the request/response payload is safe to aggregate,false
otherwise.
-
mayHaveTrailers
Checks whether a request/response payload may have trailers.- Parameters:
metadata
- The request/response to check.- Returns:
true
is the request/response payload may have trailers,false
otherwise.
-
toBlockingHttpService
Convert from aStreamingHttpService
to aBlockingHttpService
.- Parameters:
service
- TheStreamingHttpService
to convert.- Returns:
- The conversion result.
-
toHttpService
Convert from aStreamingHttpService
to aHttpService
.- Parameters:
service
- TheStreamingHttpService
to convert.- Returns:
- The conversion result.
-
toBlockingStreamingHttpService
public static BlockingStreamingHttpService toBlockingStreamingHttpService(StreamingHttpService service) Convert from aStreamingHttpService
to aBlockingStreamingHttpService
.- Parameters:
service
- TheStreamingHttpService
to convert.- Returns:
- The conversion result.
-