Class ServerListenerHandler
- java.lang.Object
-
- software.amazon.awssdk.crt.eventstream.ServerListenerHandler
-
public abstract class ServerListenerHandler extends Object
Handler interface for processing incoming event-stream-rpc connections and their lifetimes.
-
-
Constructor Summary
Constructors Constructor Description ServerListenerHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description protected abstract voidonConnectionShutdown(ServerConnection serverConnection, int errorCode)Invoked upon connection shutdown.protected abstract ServerConnectionHandleronNewConnection(ServerConnection serverConnection, int errorCode)Invoked upon receiving a new connection, or if an error happened upon connection creation.
-
-
-
Method Detail
-
onNewConnection
protected abstract ServerConnectionHandler onNewConnection(ServerConnection serverConnection, int errorCode)
Invoked upon receiving a new connection, or if an error happened upon connection creation. If errorCode is non-zero, onConnectionShutdown() will never be invoked.- Parameters:
serverConnection- The new server connection to use for communications. Is non-null when errorCode is 0.errorCode- represents any error that occurred during connection establishment- Returns:
- Return an instance of ServerConnectionHandler, for processing connection specific events.
-
onConnectionShutdown
protected abstract void onConnectionShutdown(ServerConnection serverConnection, int errorCode)
Invoked upon connection shutdown. serverConnection will never be null. This function is only invoked if onNewConnection() was invoked with a zero errorCode.- Parameters:
serverConnection- connection the shutdown occurred on.errorCode- shutdown reason. 0 means clean shutdown.
-
-