* Filled in by the message originator with the title of the destination service
*/
String _serviceTarget;
+
+ /**
+ * Optional user key of a NetworkStream to enable TCP to send userID on connection
+ */
+ long _key;
Class<?> _class;
MessageAbstract _message;
* contain native types that are serializable
* @throws IllegalArgumentException
*/
- NetworkMessage(String intent, String target, MessageAbstract message) throws IllegalArgumentException {
+ public NetworkMessage(String intent, String target, MessageAbstract message) throws IllegalArgumentException {
_serializeLength = -1;
if ( !(intent != null && intent.length() > 0) )
throw(new IllegalArgumentException("intent cannot be null or empty"));
return _serializeLength;
}
+ /**
+ * Set the key of the TCP stream in the messsage.
+ *
+ * @param key
+ */
+ public void setKey(long key) {
+ _key = key;
+ }
+
+ /**
+ * Get the key set by the ServerTCP.
+ *
+ * @return the key of the stream associated
+ */
+ public long getKey() {
+ return _key;
+ }
+
/**
* Create a message for passing over the network.
*