public interface BareResponse extends Flow.Subscriber<DataChunk>
| Modifier and Type | Method and Description |
|---|---|
void |
onComplete()
Response should be flushed and closed.
|
void |
onError(Throwable thr)
Response should be flushed and closed.
|
void |
onNext(DataChunk data)
Provided
ByteBuffer MUST be fully read during the method call. |
void |
onSubscribe(Flow.Subscription subscription)
Each response is subscribed up to a single publisher and AFTER
writeStatusAndHeaders(Http.ResponseStatus, Map)
method is called and returned. |
long |
requestId()
A unique correlation ID that is associated with this response and its associated request.
|
CompletionStage<BareResponse> |
whenCompleted()
Returns a
CompletionStage of this response. |
CompletionStage<BareResponse> |
whenHeadersCompleted()
Returns a
CompletionStage of headers part of this response. |
void |
writeStatusAndHeaders(Http.ResponseStatus status,
Map<String,List<String>> headers)
Send response line and headers to the client.
|
void writeStatusAndHeaders(Http.ResponseStatus status, Map<String,List<String>> headers) throws SocketClosedException, NullPointerException
status - an HTTP statusheaders - a Map of header names and valuesSocketClosedException - if headers were already send or response is closedNullPointerException - if status is nullCompletionStage<BareResponse> whenHeadersCompleted()
CompletionStage of headers part of this response. The stage is completed when all headers are sent to
the client.CompletionStage<BareResponse> whenCompleted()
CompletionStage of this response. The stage is completed when all response data are sent or response
channel is finished.void onSubscribe(Flow.Subscription subscription)
writeStatusAndHeaders(Http.ResponseStatus, Map)
method is called and returned.onSubscribe in interface Flow.Subscriber<DataChunk>subscription - a subscription.void onNext(DataChunk data) throws SocketClosedException
ByteBuffer MUST be fully read during the method call.onNext in interface Flow.Subscriber<DataChunk>data - chunk of the response payloadSocketClosedException - if response is already closedvoid onError(Throwable thr)
This method can be called without a subscription or demand. HTTP IO must be able to handle it.
onError in interface Flow.Subscriber<DataChunk>thr - an error.void onComplete()
This method can be called without a subscription or demand. HTTP IO must be able to handle it.
onComplete in interface Flow.Subscriber<DataChunk>long requestId()
Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.