Class SubscribeToTopicResponseHandler
- java.lang.Object
-
- software.amazon.awssdk.aws.greengrass.SubscribeToTopicResponseHandler
-
- All Implemented Interfaces:
StreamEventPublisher<EventStreamJsonMessage>
,StreamResponse<SubscribeToTopicResponse,EventStreamJsonMessage>
public final class SubscribeToTopicResponseHandler extends Object implements StreamResponse<SubscribeToTopicResponse,EventStreamJsonMessage>
-
-
Constructor Summary
Constructors Constructor Description SubscribeToTopicResponseHandler(OperationResponse<SubscribeToTopicResponse,EventStreamJsonMessage> operationResponse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Void>
closeStream()
Closes the stream by sending an empty messageCompletableFuture<Void>
getRequestFlushFuture()
Completable future indicating flush of the request that initiated the stream operationCompletableFuture<SubscribeToTopicResponse>
getResponse()
Completable future for retrieving the initial-response of the stream operationboolean
isClosed()
Tests if the stream is closedCompletableFuture<Void>
sendStreamEvent(EventStreamJsonMessage event)
Publish an event over an open stream operation.
-
-
-
Constructor Detail
-
SubscribeToTopicResponseHandler
public SubscribeToTopicResponseHandler(OperationResponse<SubscribeToTopicResponse,EventStreamJsonMessage> operationResponse)
-
-
Method Detail
-
getRequestFlushFuture
public CompletableFuture<Void> getRequestFlushFuture()
Description copied from interface:StreamResponse
Completable future indicating flush of the request that initiated the stream operation- Specified by:
getRequestFlushFuture
in interfaceStreamResponse<SubscribeToTopicResponse,EventStreamJsonMessage>
- Returns:
- Completable future indicating flush of the request that initiated the stream operation
-
getResponse
public CompletableFuture<SubscribeToTopicResponse> getResponse()
Description copied from interface:StreamResponse
Completable future for retrieving the initial-response of the stream operation- Specified by:
getResponse
in interfaceStreamResponse<SubscribeToTopicResponse,EventStreamJsonMessage>
- Returns:
- Completable future for retrieving the initial-response of the stream operation
-
sendStreamEvent
public CompletableFuture<Void> sendStreamEvent(EventStreamJsonMessage event)
Description copied from interface:StreamEventPublisher
Publish an event over an open stream operation.- Specified by:
sendStreamEvent
in interfaceStreamEventPublisher<EventStreamJsonMessage>
- Parameters:
event
- event to publish- Returns:
- Completable future indicating flush of the event over the stream
-
closeStream
public CompletableFuture<Void> closeStream()
Description copied from interface:StreamEventPublisher
Closes the stream by sending an empty message- Specified by:
closeStream
in interfaceStreamEventPublisher<EventStreamJsonMessage>
- Returns:
- Completable future indicating flush of the stream termination message
-
isClosed
public boolean isClosed()
Description copied from interface:StreamResponse
Tests if the stream is closed- Specified by:
isClosed
in interfaceStreamResponse<SubscribeToTopicResponse,EventStreamJsonMessage>
- Returns:
- True if the stream is closed
-
-