Class ServerConnectionContinuation
- java.lang.Object
-
- software.amazon.awssdk.crt.CrtResource
-
- software.amazon.awssdk.crt.eventstream.ServerConnectionContinuation
-
- All Implemented Interfaces:
AutoCloseable
public class ServerConnectionContinuation extends CrtResource
Wrapper around aws-event-stream-rpc-server continuation. This class is marked AutoClosable. Note that by default ServerConnectionContinuationHandler will invoke close() in ServerConnectionContinuationHandler::onContinuationClosed().
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isClosed()
CompletableFuture<Void>
sendMessage(List<Header> headers, byte[] payload, MessageType messageType, int messageFlags)
Sends message on the continuationvoid
sendMessage(List<Header> headers, byte[] payload, MessageType messageType, int messageFlags, MessageFlushCallback callback)
Sends message on the continuation-
Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
-
-
-
Method Detail
-
isClosed
public boolean isClosed()
- Returns:
- true if the continuation has been closed. False otherwise.
-
sendMessage
public CompletableFuture<Void> sendMessage(List<Header> headers, byte[] payload, MessageType messageType, int messageFlags)
Sends message on the continuation- Parameters:
headers
- list of additional event stream headers to include on the message.payload
- payload for the messagemessageType
- message type. Must be either ApplicationMessage or ApplicationErrormessageFlags
- message flags for the message, use TerminateStream to cause this message to close the continuation after sending.- Returns:
- Future for syncing when the message is flushed to the transport or fails.
-
sendMessage
public void sendMessage(List<Header> headers, byte[] payload, MessageType messageType, int messageFlags, MessageFlushCallback callback)
Sends message on the continuation- Parameters:
headers
- list of additional event stream headers to include on the message.payload
- payload for the messagemessageType
- message type. Must be either ApplicationMessage or ApplicationErrormessageFlags
- message flags for the message, use TerminateStream to cause this message to close the continuation after sending.callback
- completion callback to be invoked when the message is synced to the underlying transport.
-
-