Class ResponsePublisher<ResponseT extends SdkResponse>
- java.lang.Object
- 
- software.amazon.awssdk.core.async.ResponsePublisher<ResponseT>
 
- 
- Type Parameters:
- ResponseT- Pojo response type.
 - All Implemented Interfaces:
- org.reactivestreams.Publisher<ByteBuffer>,- SdkPublisher<ByteBuffer>
 
 public final class ResponsePublisher<ResponseT extends SdkResponse> extends Object implements SdkPublisher<ByteBuffer> AnSdkPublisherthat publishes response body content and also contains a reference to theSdkResponsereturned by the service.NOTE: You must subscribe to this publisher promptly to avoid automatic cancellation. The default timeout for subscribing is 60 seconds, which starts when the response body begins streaming. If subscribe(Subscriber)is not invoked before the timeout, the publisher will automatically cancel the underlying subscription to prevent resource leakage.The timeout can be customized by passing a Durationto the constructor, or disabled entirely by passingDuration.ZEROor a negativeDuration.- See Also:
- AsyncResponseTransformer.toPublisher()
 
- 
- 
Constructor SummaryConstructors Constructor Description ResponsePublisher(ResponseT response, SdkPublisher<ByteBuffer> publisher)ResponsePublisher(ResponseT response, SdkPublisher<ByteBuffer> publisher, Duration timeout)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()booleanhasTimeoutTask()ResponseTresponse()voidsubscribe(org.reactivestreams.Subscriber<? super ByteBuffer> subscriber)booleantimeoutTaskDoneOrCancelled()StringtoString()- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface software.amazon.awssdk.core.async.SdkPublisheraddTrailingData, buffer, doAfterOnCancel, doAfterOnComplete, doAfterOnError, filter, filter, flatMapIterable, limit, map, subscribe
 
- 
 
- 
- 
- 
Constructor Detail- 
ResponsePublisherpublic ResponsePublisher(ResponseT response, SdkPublisher<ByteBuffer> publisher) 
 - 
ResponsePublisherpublic ResponsePublisher(ResponseT response, SdkPublisher<ByteBuffer> publisher, Duration timeout) 
 
- 
 - 
Method Detail- 
responsepublic ResponseT response() - Returns:
- the unmarshalled response object from the service.
 
 - 
subscribepublic void subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> subscriber) - Specified by:
- subscribein interface- org.reactivestreams.Publisher<ResponseT extends SdkResponse>
 
 - 
hasTimeoutTaskpublic boolean hasTimeoutTask() 
 - 
timeoutTaskDoneOrCancelledpublic boolean timeoutTaskDoneOrCancelled() 
 
- 
 
-