Class AsyncServerPipeline.ResponseContentStage<I>
java.lang.Object
org.apache.hc.core5.http.nio.support.AsyncServerPipeline.ResponseContentStage<I>
- Enclosing class:
AsyncServerPipeline
Response content generation stage.
- Since:
- 5.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HandlerResolver<HttpRequest, AsyncRequestConsumer<I>> private final Validator<HttpRequest> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateResponseContentStage(Validator<HttpRequest> requestValidator, HandlerResolver<HttpRequest, AsyncRequestConsumer<I>> requestConsumerResolver) -
Method Summary
Modifier and TypeMethodDescriptionasByteArray(ContentType contentType) Configures the pipeline to represent the response message content as byre array.asString(ContentType contentType) Configures the pipeline to represent the response message content as a String.produce(Resolver<O, AsyncResponseProducer> responseProducerResolver) ResolvesAsyncResponseProducerto be used by the pipeline to generate the outgoing response message stream based on the given response message object.produceContent(Resolver<O, AsyncEntityProducer> dataProducerResolver) ResolvesAsyncEntityProducerto be used by the pipeline to generate the outgoing response content stream based on the given response content object.
-
Field Details
-
requestValidator
-
requestConsumerResolver
-
-
Constructor Details
-
ResponseContentStage
private ResponseContentStage(Validator<HttpRequest> requestValidator, HandlerResolver<HttpRequest, AsyncRequestConsumer<I>> requestConsumerResolver)
-
-
Method Details
-
produce
public <O> AsyncServerPipeline.RequestHandlingStage<I,O> produce(Resolver<O, AsyncResponseProducer> responseProducerResolver) ResolvesAsyncResponseProducerto be used by the pipeline to generate the outgoing response message stream based on the given response message object.- Type Parameters:
O- response content representation.
-
produceContent
public <O> AsyncServerPipeline.RequestHandlingStage<I, Message<HttpResponse, O>> produceContent(Resolver<O, AsyncEntityProducer> dataProducerResolver) ResolvesAsyncEntityProducerto be used by the pipeline to generate the outgoing response content stream based on the given response content object.- Type Parameters:
O- response content representation.
-
asString
public AsyncServerPipeline.RequestHandlingStage<I, Message<HttpResponse, String>> asString(ContentType contentType) Configures the pipeline to represent the response message content as a String. -
asByteArray
public AsyncServerPipeline.RequestHandlingStage<I, Message<HttpResponse, byte[]>> asByteArray(ContentType contentType) Configures the pipeline to represent the response message content as byre array.
-