public class Message
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
inReplyTo |
protected java.lang.String |
msgID |
protected Performative |
perf |
protected AgentID |
recipient |
protected AgentID |
sender |
protected java.lang.Long |
sentAt |
Constructor and Description |
---|
Message()
Creates an empty message.
|
Message(AgentID recipient)
Creates a new message.
|
Message(AgentID recipient,
Performative perf)
Creates a new message.
|
Message(Message inReplyTo)
Creates a response message.
|
Message(Message inReplyTo,
Performative perf)
Creates a response message.
|
Message(Performative perf)
Creates a new message.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getInReplyTo()
Gets the message id of the associated request message.
|
java.lang.String |
getJsonCache()
Gets the Cached JSON String (if any)
|
java.lang.String |
getMessageID()
Gets the unique identifier for this message.
|
Performative |
getPerformative()
Gets the performative for this message.
|
AgentID |
getRecipient()
Gets the recipient of this message.
|
AgentID |
getSender()
Gets the sender of this message.
|
java.lang.Long |
getSentAt()
Gets the timestamp (milliseconds since epoch) that this message was sent at.
|
void |
setInReplyTo(java.lang.String id)
Sets the message id of the associated request message.
|
void |
setJsonCache(java.lang.String _jsoncache)
Sets the Cached JSON String
|
void |
setMessageID(java.lang.String id)
Sets the unique identifier for this message.
|
void |
setPerformative(Performative perf)
Sets the performative for this message.
|
void |
setRecipient(AgentID aid)
Sets the recipient of this message.
|
void |
setSender(AgentID aid)
Sets the sender of this message.
|
void |
setSentAt(long ms)
Sets the timestamp (milliseconds since epoch) that this message was sent at.
|
java.lang.String |
toString()
Gets a string representation of the message.
|
protected java.lang.String msgID
protected Performative perf
protected AgentID recipient
protected AgentID sender
protected java.lang.String inReplyTo
protected java.lang.Long sentAt
public Message()
public Message(Performative perf)
perf
- performative.public Message(AgentID recipient)
recipient
- agent id of recipient agent or topic.public Message(AgentID recipient, Performative perf)
recipient
- agent id of recipient agent or topic.perf
- performative.public Message(Message inReplyTo)
inReplyTo
- message to which this response corresponds to.public Message(Message inReplyTo, Performative perf)
inReplyTo
- message to which this response corresponds to.perf
- performative.public void setPerformative(Performative perf)
perf
- performative.public Performative getPerformative()
public void setRecipient(AgentID aid)
aid
- recipient agent id.public AgentID getRecipient()
public void setSender(AgentID aid)
aid
- sender agent id.public AgentID getSender()
public void setMessageID(java.lang.String id)
id
- message identifier.public java.lang.String getMessageID()
public void setInReplyTo(java.lang.String id)
id
- message id of request message.public java.lang.String getInReplyTo()
public void setSentAt(long ms)
ms
- timestamp in millisecondspublic java.lang.Long getSentAt()
public java.lang.String getJsonCache()
public void setJsonCache(java.lang.String _jsoncache)
_jsoncache
- JSON String representation of the messagepublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()