public interface Message extends Cloneable, Comparable<Message>, Serializable
This interface defines messages based on the ACL Message Structure Specification issued by the FIPA. Messages that are received from other messages via the Message Transfer System are read-only for the receiver.
Modifiable messages are those messages an agent itself sends to other agents.
All message implementations are expected to comply with the following specification:
performative
. Therefore, all
implementations should take the performative of the message already as a
parameter in the constructor. The performative may be changed later by means
of a set method unless it is an unmodifiable message.reply-by
time is set.null
if they are not set. For all multi-valued message
components, a message should return an empty collection if they have no
content
Modifier and Type | Method and Description |
---|---|
Message |
clone()
Clones this message.
|
String |
getContent()
Returns the content of the message.
|
Serializable |
getContentObject()
Returns the content object of the message.
|
byte[] |
getContentObjectBytes()
Returns (a copy of) the content object of the message as an array of
bytes.
|
UniqueIdentifier |
getConversationID()
Returns the conversation-id of the message (part of the conversation
control).
|
EncodingIdentifier |
getEncoding()
Returns the encoding of the message (part of the content description).
|
UniqueIdentifier |
getInReplyTo()
Returns the in-reply-to of the message (part of the conversation
control).
|
LanguageIdentifier |
getLanguage()
Returns the language of the message (part of the content description).
|
OntologyIdentifier |
getOntology()
Returns the ontology of the message (part of the content description).
|
CommunicativeAct |
getPerformative()
Returns the type of communicative act.
|
ProtocolIdentifier |
getProtocol()
Returns the protocol of the message (part of the conversation control).
|
SortedSet<AgentIdentifier> |
getReceivers()
Returns the (unmodifiable) set of receivers of the message.
|
Timestamp |
getReplyBy()
Returns the reply-by of the message (part of the conversation control).
|
SortedSet<AgentIdentifier> |
getReplyTos()
Returns the (unmodifiable) set of reply-tos of the message.
|
UniqueIdentifier |
getReplyWith()
Returns the reply-with of the message (part of the conversation control).
|
AgentIdentifier |
getSender()
Returns the sender of the message.
|
String |
getUserParameter(UserParameter parameter)
Returns the value of the specified user-defined parameter of the message.
|
SortedMap<UserParameter,String> |
getUserParameters()
Returns the (unmodifiable) map of user-defined parameters of the message.
|
boolean |
hasUserParameter(UserParameter parameter)
Checks if a user-defined parameter is set for a message (including those
cases in which the parameter is set without a value).
|
String |
toString()
Returns the string representation of this message.
|
compareTo
CommunicativeAct getPerformative()
AgentIdentifier getSender()
SortedSet<AgentIdentifier> getReceivers()
SortedSet<AgentIdentifier> getReplyTos()
String getContent()
Serializable getContentObject() throws UnreadableException
UnreadableException
- if the content object cannot be readbyte[] getContentObjectBytes()
LanguageIdentifier getLanguage()
EncodingIdentifier getEncoding()
OntologyIdentifier getOntology()
ProtocolIdentifier getProtocol()
UniqueIdentifier getConversationID()
UniqueIdentifier getReplyWith()
UniqueIdentifier getInReplyTo()
Timestamp getReplyBy()
Timestamp
object and never null. If no explicit reply-by date has
been set, the maximum possible timestamp should be returned.boolean hasUserParameter(UserParameter parameter)
parameter
- the user-defined parametertrue
if the user-defined parameter is set,
false
otherwisegetUserParameter(UserParameter)
String getUserParameter(UserParameter parameter) throws NoSuchElementException
parameter
- the user-defined parameterNoSuchElementException
- if the user-defined parameter is not sethasUserParameter(UserParameter)
SortedMap<UserParameter,String> getUserParameters()
Message clone()
String toString()
Returns the string representation of this message.
Note that messages are quite complex objects. Consequently, an implementation of this method might also be computationally demanding. Furthermore, caching the string representation might not be advisable because it can be quite memory-consuming. Therefore, this method should better not be used excessively.
Copyright © Aimpulse Intelligent Systems GmbH
All rights reserved.