public class MrUdpNodeConnection extends java.lang.Object implements NodeConnection
Constructor and Description |
---|
MrUdpNodeConnection()
Default constructor.
|
MrUdpNodeConnection(ReliableSocket socket)
Constructor.
|
MrUdpNodeConnection(ReliableSocketProfile socketProfile)
Constructor.
|
MrUdpNodeConnection(ReliableSocketProfile socketProfile,
java.util.UUID senderUUID)
Constructor.
|
MrUdpNodeConnection(ReliableSocket socket,
java.util.UUID senderUUID)
Constructor.
|
MrUdpNodeConnection(java.util.UUID senderUUID)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtendedMessageListener(ExtendedMessageListener lis,
ExtendedMessage messageType)
Adds a specific message type listener.
|
void |
addNodeConnectionListener(NodeConnectionListener lis)
Adds a listener to this connection.
|
void |
addSddlListener(SddlNetworkListener lis)
Adds a SDDL listener to this connection.
|
void |
connect(java.net.SocketAddress endpoint)
Tries to stablish a connection to the specified address.
|
void |
disconnect()
Disconnect with the Gateway.
|
java.util.UUID |
getClientUUID() |
int |
getNumberOfReconnectionsMade()
Method that gets the number of reconnection made.
|
java.net.Socket |
getSocket()
Retrieves the Socket associated with this RemoteConnection.
|
java.util.UUID |
getUuid()
Returns the UUID of the connection.
|
void |
removeExtendedMessageListener(ExtendedMessageListener lis,
ExtendedMessage messageType)
Removes a specific message type listener.
|
void |
removeNodeConnectionListener(NodeConnectionListener lis)
Removes a listener to this connection.
|
void |
removeSddlListener(SddlNetworkListener lis)
Removes a SDDL listener to this connection.
|
void |
sendMessage(Message message)
Sends a message to the Gateway.
|
void |
setUuid(java.util.UUID uuid)
Sets the connection UUID.
|
public MrUdpNodeConnection() throws java.io.IOException
java.io.IOException
public MrUdpNodeConnection(java.util.UUID senderUUID) throws java.io.IOException
java.io.IOException
public MrUdpNodeConnection(ReliableSocketProfile socketProfile) throws java.io.IOException
socketProfile
- a profile to create the socketjava.io.IOException
public MrUdpNodeConnection(ReliableSocketProfile socketProfile, java.util.UUID senderUUID) throws java.io.IOException
socketProfile
- a profile to create the socketsenderUUID
- sender UUIDjava.io.IOException
public MrUdpNodeConnection(ReliableSocket socket) throws java.io.IOException
socketProfile
- a profile to create the socketjava.io.IOException
public MrUdpNodeConnection(ReliableSocket socket, java.util.UUID senderUUID)
socket
- public java.util.UUID getClientUUID()
public void setUuid(java.util.UUID uuid)
uuid
- the unique identifierpublic java.util.UUID getUuid()
getUuid
in interface NodeConnection
public java.net.Socket getSocket()
public void connect(java.net.SocketAddress endpoint) throws java.io.IOException
connect
in interface NodeConnection
java.io.IOException
public void disconnect() throws java.io.IOException
disconnect
in interface NodeConnection
java.io.IOException
public int getNumberOfReconnectionsMade()
getNumberOfReconnectionsMade
in interface NodeConnection
public void sendMessage(Message message) throws java.io.IOException
sendMessage
in interface NodeConnection
java.io.IOException
public void addNodeConnectionListener(NodeConnectionListener lis)
addNodeConnectionListener
in interface NodeConnection
public void removeNodeConnectionListener(NodeConnectionListener lis)
removeNodeConnectionListener
in interface NodeConnection
public void addExtendedMessageListener(ExtendedMessageListener lis, ExtendedMessage messageType)
addExtendedMessageListener
in interface ExtendedMessageSource
public void removeExtendedMessageListener(ExtendedMessageListener lis, ExtendedMessage messageType)
removeExtendedMessageListener
in interface ExtendedMessageSource
public void addSddlListener(SddlNetworkListener lis)
addSddlListener
in interface NodeConnection
public void removeSddlListener(SddlNetworkListener lis)
removeSddlListener
in interface NodeConnection