Class ClientConnectionContinuationHandler
- java.lang.Object
-
- software.amazon.awssdk.crt.eventstream.ClientConnectionContinuationHandler
-
- All Implemented Interfaces:
AutoCloseable
public abstract class ClientConnectionContinuationHandler extends Object implements AutoCloseable
Handler interface for responding to continuation events. It's auto closable. By default, onContinuationClosed() releases the underlying resource.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientConnectionContinuation
continuation
-
Constructor Summary
Constructors Constructor Description ClientConnectionContinuationHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
CompletableFuture<Void>
getContinuationClosedFuture()
protected void
onContinuationClosed()
By default closes the underlying resource.protected abstract void
onContinuationMessage(List<Header> headers, byte[] payload, MessageType messageType, int messageFlags)
Invoked when a message is received on a continuation.
-
-
-
Field Detail
-
continuation
protected ClientConnectionContinuation continuation
-
-
Method Detail
-
onContinuationMessage
protected abstract void onContinuationMessage(List<Header> headers, byte[] payload, MessageType messageType, int messageFlags)
Invoked when a message is received on a continuation.- Parameters:
headers
- List of EventStream headers for the message received.payload
- Payload for the message receivedmessageType
- message type for the messagemessageFlags
- message flags for the message
-
onContinuationClosed
protected void onContinuationClosed()
By default closes the underlying resource. If you override this function, be sure to either call close() manually or invoke super.onContinuationClosed() before returning.
-
getContinuationClosedFuture
public CompletableFuture<Void> getContinuationClosedFuture()
- Returns:
- a future that will be completed upon the continuation being closed.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
-