public class ClientConnectionImpl extends java.lang.Object implements ClientConnection
ClientConnection.CompletedCallback
Constructor and Description |
---|
ClientConnectionImpl(java.lang.String connectionName,
int flowId,
FlowHandler nettyHandler) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Drop the connection.
|
java.lang.String |
getConnectionName() |
int |
getFlowId() |
FlowHandler |
getNettyHandler() |
void |
send(io.pravega.shared.protocol.netty.Append append)
Sends the provided append request.
|
void |
send(io.pravega.shared.protocol.netty.WireCommand cmd)
Sends the provided command.
|
void |
sendAsync(java.util.List<io.pravega.shared.protocol.netty.Append> appends,
ClientConnection.CompletedCallback callback)
Sends the provided append commands.
|
void |
sendAsync(io.pravega.shared.protocol.netty.WireCommand cmd,
ClientConnection.CompletedCallback callback)
Sends a wire command asynchronously.
|
public ClientConnectionImpl(java.lang.String connectionName, int flowId, FlowHandler nettyHandler)
public void send(io.pravega.shared.protocol.netty.WireCommand cmd) throws io.pravega.shared.protocol.netty.ConnectionFailedException
ClientConnection
send
in interface ClientConnection
cmd
- The command to send.io.pravega.shared.protocol.netty.ConnectionFailedException
- The connection has died, and can no longer be used.public void send(io.pravega.shared.protocol.netty.Append append) throws io.pravega.shared.protocol.netty.ConnectionFailedException
ClientConnection
send
in interface ClientConnection
append
- The append command to send.io.pravega.shared.protocol.netty.ConnectionFailedException
- The connection has died, and can no longer be used.public void sendAsync(io.pravega.shared.protocol.netty.WireCommand cmd, ClientConnection.CompletedCallback callback)
ClientConnection
sendAsync
in interface ClientConnection
cmd
- The wire command to be sent.callback
- A callback to be invoked when the operation is completepublic void sendAsync(java.util.List<io.pravega.shared.protocol.netty.Append> appends, ClientConnection.CompletedCallback callback)
ClientConnection
sendAsync
in interface ClientConnection
appends
- A list of append command to send.callback
- A callback to be invoked when the operation is completepublic void close()
ClientConnection
close
in interface ClientConnection
close
in interface java.lang.AutoCloseable
public java.lang.String getConnectionName()
public int getFlowId()
public FlowHandler getNettyHandler()