Class SubscribeToIoTCoreResponseHandler
- java.lang.Object
-
- software.amazon.awssdk.aws.greengrass.SubscribeToIoTCoreResponseHandler
-
- All Implemented Interfaces:
StreamEventPublisher<EventStreamJsonMessage>
,StreamResponse<SubscribeToIoTCoreResponse,EventStreamJsonMessage>
public final class SubscribeToIoTCoreResponseHandler extends Object implements StreamResponse<SubscribeToIoTCoreResponse,EventStreamJsonMessage>
-
-
Constructor Summary
Constructors Constructor Description SubscribeToIoTCoreResponseHandler(OperationResponse<SubscribeToIoTCoreResponse,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<SubscribeToIoTCoreResponse>
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
-
SubscribeToIoTCoreResponseHandler
public SubscribeToIoTCoreResponseHandler(OperationResponse<SubscribeToIoTCoreResponse,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<SubscribeToIoTCoreResponse,EventStreamJsonMessage>
- Returns:
- Completable future indicating flush of the request that initiated the stream operation
-
getResponse
public CompletableFuture<SubscribeToIoTCoreResponse> getResponse()
Description copied from interface:StreamResponse
Completable future for retrieving the initial-response of the stream operation- Specified by:
getResponse
in interfaceStreamResponse<SubscribeToIoTCoreResponse,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<SubscribeToIoTCoreResponse,EventStreamJsonMessage>
- Returns:
- True if the stream is closed
-
-