public interface Connection
Modifier and Type | Method and Description |
---|---|
void |
addConnectionListener(ConnectionListener l)
Add a ConnectionListener.
|
java.lang.String |
getName()
Get the name for this connection.
|
Registry |
getRegistry()
Get the Registry that this connection is using for decoding messages and entities.
|
boolean |
isAlive()
Find out if this connection is still alive.
|
void |
removeConnectionListener(ConnectionListener l)
Remove a ConnectionListener.
|
void |
sendMessage(Message msg)
Send a message across this connection.
|
void |
sendMessages(java.util.Collection<? extends Message> messages)
Send a set of messages across this connection.
|
void |
setLogBytes(boolean enabled)
Turn byte-level logging on or off.
|
void |
setName(java.lang.String name)
Set the name for this connection.
|
void |
setRegistry(Registry registry)
Set the Registry that this connection should use for decoding messages and entities.
|
void |
shutdown()
Shut this connection down.
|
void |
startup()
Start this connection up.
|
void sendMessage(Message msg) throws ConnectionException
msg
- The message to send.ConnectionException
- If the connection has not been started up or has been shut down, or if there is an error sending the message.void sendMessages(java.util.Collection<? extends Message> messages) throws ConnectionException
messages
- The messages to send.ConnectionException
- If the connection has not been started up or has been shut down, or if there is an error sending the message.void addConnectionListener(ConnectionListener l)
l
- The listener to add.void removeConnectionListener(ConnectionListener l)
l
- The listener to remove.void startup()
boolean isAlive()
void shutdown()
void setLogBytes(boolean enabled)
enabled
- Whether to enable byte-level logging.void setName(java.lang.String name)
name
- The new name.java.lang.String getName()
void setRegistry(Registry registry)
registry
- The new Registry to use.Registry getRegistry()