public class PacketMessages
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,PacketInfo> |
packetMsgs
Stores communication ids with related message packet info for receiving
messages in packets.
|
protected java.lang.Object |
syncOn
To synchronize on
|
Constructor and Description |
---|
PacketMessages()
Create a new instance of PacketMessages
|
Modifier and Type | Method and Description |
---|---|
boolean |
addMessagePacket(java.lang.String communicationID,
java.lang.String packetObject)
Add the message packet to the appropriate file as indicated by the communication id.
|
boolean |
addPacketCommunicationID(java.lang.String communicationID,
int packetSize)
Add the communication id and packet info to the packetInfo structure.
|
MethodInfo |
endOfMessage(java.lang.String communicationID)
Call this to indicate that the whole message has been sent and should now be executed.
|
protected java.util.HashMap<java.lang.String,PacketInfo> packetMsgs
protected final java.lang.Object syncOn
public boolean addPacketCommunicationID(java.lang.String communicationID, int packetSize) throws java.lang.Exception
communicationID
- the id to identify the communication thread.packetSize
- the maximum size of the packet to send.java.lang.Exception
- any error.public boolean addMessagePacket(java.lang.String communicationID, java.lang.String packetObject) throws java.lang.Exception
communicationID
- the id to identify the communication thread.packetObject
- the next part of the message to save.java.lang.Exception
- any error.public MethodInfo endOfMessage(java.lang.String communicationID) throws java.lang.Exception
communicationID
- the id to identify the communication thread.java.lang.Exception
- any error.