public interface TcpConnection
extends java.lang.Runnable
Socket
and SocketChannel
that sends Message
objects by serializing the payload and streaming it to the
destination. Requires a TcpListener
to receive incoming messages.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection.
|
java.lang.String |
getConnectionId() |
org.springframework.core.serializer.Deserializer<?> |
getDeserializer() |
java.lang.Object |
getDeserializerStateKey() |
java.lang.String |
getHostAddress() |
java.lang.String |
getHostName() |
TcpListener |
getListener() |
java.lang.Object |
getPayload()
Uses the deserializer to obtain the message payload
from the connection's input stream.
|
int |
getPort() |
org.springframework.core.serializer.Serializer<?> |
getSerializer() |
SocketInfo |
getSocketInfo()
Provides getters for
Socket properties. |
javax.net.ssl.SSLSession |
getSslSession() |
long |
incrementAndGetConnectionSequence() |
boolean |
isOpen() |
boolean |
isServer() |
void |
send(org.springframework.messaging.Message<?> message)
Converts and sends the message.
|
void close()
boolean isOpen()
void send(org.springframework.messaging.Message<?> message) throws java.lang.Exception
message
- The message,java.lang.Exception
- Any Exception.@Nullable java.lang.Object getPayload() throws java.lang.Exception
java.lang.Exception
- Any Exception.java.lang.String getHostName()
java.lang.String getHostAddress()
int getPort()
java.lang.String getConnectionId()
boolean isServer()
org.springframework.core.serializer.Deserializer<?> getDeserializer()
org.springframework.core.serializer.Serializer<?> getSerializer()
@Nullable TcpListener getListener()
long incrementAndGetConnectionSequence()
@Nullable java.lang.Object getDeserializerStateKey()
Deserializer
that
maintains state for this connection. Currently, this would be the InputStream
associated with the connection, but the object should be treated as opaque
and ONLY used as a key.@Nullable javax.net.ssl.SSLSession getSslSession()
SSLSession
associated with this connection, if SSL is in use,
null otherwise.SocketInfo getSocketInfo()
Socket
properties.