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.IOExceptionpublic MrUdpNodeConnection(java.util.UUID senderUUID)
throws java.io.IOException
java.io.IOExceptionpublic MrUdpNodeConnection(ReliableSocketProfile socketProfile) throws java.io.IOException
socketProfile - a profile to create the socketjava.io.IOExceptionpublic MrUdpNodeConnection(ReliableSocketProfile socketProfile, java.util.UUID senderUUID) throws java.io.IOException
socketProfile - a profile to create the socketsenderUUID - sender UUIDjava.io.IOExceptionpublic MrUdpNodeConnection(ReliableSocket socket) throws java.io.IOException
socketProfile - a profile to create the socketjava.io.IOExceptionpublic 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 NodeConnectionpublic java.net.Socket getSocket()
public void connect(java.net.SocketAddress endpoint)
throws java.io.IOException
connect in interface NodeConnectionjava.io.IOExceptionpublic void disconnect()
throws java.io.IOException
disconnect in interface NodeConnectionjava.io.IOExceptionpublic int getNumberOfReconnectionsMade()
getNumberOfReconnectionsMade in interface NodeConnectionpublic void sendMessage(Message message) throws java.io.IOException
sendMessage in interface NodeConnectionjava.io.IOExceptionpublic void addNodeConnectionListener(NodeConnectionListener lis)
addNodeConnectionListener in interface NodeConnectionpublic void removeNodeConnectionListener(NodeConnectionListener lis)
removeNodeConnectionListener in interface NodeConnectionpublic void addExtendedMessageListener(ExtendedMessageListener lis, ExtendedMessage messageType)
addExtendedMessageListener in interface ExtendedMessageSourcepublic void removeExtendedMessageListener(ExtendedMessageListener lis, ExtendedMessage messageType)
removeExtendedMessageListener in interface ExtendedMessageSourcepublic void addSddlListener(SddlNetworkListener lis)
addSddlListener in interface NodeConnectionpublic void removeSddlListener(SddlNetworkListener lis)
removeSddlListener in interface NodeConnection