|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.adf.acl.ACLMessage
public class ACLMessage
A FIPA ACL message contains a set of one or more message parameters.
Precisely which parameters are needed for effective agent communication
will vary according to the situation; the only parameter that is mandatory
in all ACL messages is the performative, although it is
expected that most CL messages will also contain sender,
receiver and content parameters.
If an agent does not recognize or is unable to process one or more of
the parameters or parameter values, it can reply with the appropriate
not-understood message.
The full set of FIPA ACL message parameters is shown bellow without regard to their specific encodings in an implementation.
FIPA ACL Message Parameters by type
performativesender,
receiver, reply-tocontentlanguage,
encoding, ontologyprotocol,
conversation-id, reply-with,
in-reply-to, reply-by
| Constructor Summary | |
|---|---|
ACLMessage(Performative p)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
ACLMessage |
createReply()
create a new Message that is a reply to this message. |
byte[] |
getByteSequenceContent()
|
java.lang.String |
getContent()
This parameter denotes the content of the message; equivalently denotes the object of the action. |
java.io.Serializable |
getContentObject()
This method returns the content of this ACLMessage when they have been written via the method setContentObject. |
java.lang.String |
getConversationId()
The conversation-id parameter introduces an expression which is used to identify the ongoing sequence of communicative acts that together form a conversation. |
java.lang.String |
getEncoding()
This parameter denotes the specific encoding of the content language expression. |
java.lang.String |
getInReplyTo()
The in-reply-to parameter denotes an expression that references an earlier action to which this message is a reply. |
java.lang.String |
getLanguage()
This parameter denotes the language in which the content parameter is expressed, for example SL, CCL, KIF or RDF. |
java.lang.String |
getOntology()
This parameter denotes the ontology used to give a meaning to the symbols in the content expression. |
Performative |
getPerformative()
The performative parameter denotes the type of the communicative act of the ACL message as defied by FIPA00037. |
java.lang.String |
getProtocol()
This parameter denotes the interaction protocol that the sending agent is employing with this ACL message. |
java.util.Set<AID> |
getReceiverSet()
The receiver parameter denotes the identity of the intended recipients of the message. |
java.util.Date |
getReplyByDate()
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply. |
long |
getReplyByMillis()
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply. |
java.lang.String |
getReplyByString()
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply. |
java.util.Set<AID> |
getReplyToSet()
The reply-to parameter indicates that subsequent messages in this conversation thread are to be directed to the agent named in the reply-to parameter, instead of to the agent named in the sender parameter. |
java.lang.String |
getReplyWith()
The reply-with parameter introduces an expression that will be used by the responding agent to identify this message. |
AID |
getSender()
The sender parameter denotes the identity of the sender of the message, i.e. |
java.util.Properties |
getUserDefinedProperties()
Every FIPA implementation is free to include user-defined message parameters other than the FIPA ACL message parameters specified by FIPA00061. |
void |
reset()
|
void |
setByteSequenceContent(byte[] content)
|
void |
setContent(java.lang.String content)
This parameter denotes the content of the message; equivalently denotes the object of the action. |
void |
setContentObject(java.io.Serializable s)
This method sets the content of this ACLMessage to a Java object. |
void |
setConversationId(java.lang.String conversationId)
The conversation-id parameter introduces an expression which is used to identify the ongoing sequence of communicative acts that together form a conversation. |
void |
setEncoding(java.lang.String encoding)
This parameter denotes the specific encoding of the content language expression. |
void |
setInReplyTo(java.lang.String inReplyTo)
The in-reply-to parameter denotes an expression that references an earlier action to which this message is a reply. |
void |
setLanguage(java.lang.String language)
This parameter denotes the language in which the content parameter is expressed, for example SL, CCL, KIF or RDF. |
void |
setOntology(java.lang.String ontology)
This parameter denotes the ontology used to give a meaning to the symbols in the content expression. |
void |
setPerformative(Performative p)
The performative parameter denotes the type of the communicative act of the ACL message as defied by FIPA00037. |
void |
setProtocol(java.lang.String protocol)
This parameter denotes the interaction protocol that the sending agent is employing with this ACL message. |
void |
setReplyBy(java.util.Date date)
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply. |
void |
setReplyBy(long millis)
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply. |
void |
setReplyBy(java.lang.String str)
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply. |
void |
setReplyWith(java.lang.String replyWith)
The reply-with parameter introduces an expression that will be used by the responding agent to identify this message. |
void |
setSender(AID sender)
The sender parameter denotes the identity of the sender of the message, i.e. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ACLMessage(Performative p)
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic ACLMessage createReply()
public byte[] getByteSequenceContent()
public java.lang.String getContent()
This parameter denotes the content of the message; equivalently denotes the object of the action. The meaning of the content of any ACL message is intended to be interpreted by the receiver of the message. This is particularly relevant for instance when referring to referential expressions, whose interpretation might be different for the sender and the receiver.
Note: Most ACL messages require a content expression. Certain ACL message types, such as cancel, have an implicit content, especially in cases of using the conversation-id or in-reply-to parameters.
public java.io.Serializable getContentObject()
throws java.io.IOException,
java.lang.ClassNotFoundException
setContentObject.
It is not FIPA compliant so its usage is not encouraged.
For example to read Java objects from the content
ACLMessage msg = blockingReceive();
try {
Date d = (Date)msg.getContentObject();
} catch(Exception e) {
// handle Exceptions
}
* @return the object read from the content of this ACLMessage
UnreadableException - when an error occurs during the decoding.
java.io.IOException
java.lang.ClassNotFoundExceptionpublic java.lang.String getConversationId()
The conversation-id parameter introduces an expression which is used to identify the ongoing sequence of communicative acts that together form a conversation.
It is required the usage of globally unique values for the conversation-id parameter in order to allow the participants to distinguish between several concurrent conversations. A simple mechanism to ensure uniqueness is the concatenation of the globally unique identifier of the sender agent to an identifier (for example, a progressive number) that is unique within the scope of the sender agent itself.
Note: An agent may tag ACL messages with a conversation identifier to manage its communication strategies and activities. Typically this will allow an agent to identify individual conversations with multiple agents. It will also allow agents to reason across historical records of conversations.
public java.lang.String getEncoding()
This parameter denotes the specific encoding of the content language expression.
Note: The content expression might be encoded in several ways. The encoding parameter is optionally used to specify this encoding to the recipient agent. If the encoding parameter is not present, the encoding will be specified in the message envelope that encloses the ACL message.
public java.lang.String getInReplyTo()
The in-reply-to parameter denotes an expression that references an earlier action to which this message is a reply.
getReplyWith(),
setReplyWith()public java.lang.String getLanguage()
This parameter denotes the language in which the content parameter is expressed, for example SL, CCL, KIF or RDF.
Note: The ACL content parameter is expressed in a formal language. This field may be omitted if the agent receiving the message can be assumed to know the language of the content expression.
public java.lang.String getOntology()
This parameter denotes the ontology used to give a meaning to the symbols in the content expression.
Note: The ontology parameter is used in conjunction with the language parameter to support the interpretation of the content expression by the receiving agent. In many situations, the ontology parameter will be commonly understood by the agent community and so this message parameter may be omitted.
public Performative getPerformative()
The performative parameter denotes the type of the communicative act of the ACL message as defied by FIPA00037.
Note: The performative parameter is a required parameter of all ACL messages.
public java.lang.String getProtocol()
This parameter denotes the interaction protocol that the sending agent is employing with this ACL message. Some standard FIPA interaction protocols are: Request, Query, Request When, Contract Net, Subscribe, Propose, Auction etc.
Any ACL message that contains a non-null value for the protocol parameter is considered to belong to a conversation and it is required to respect the following rules:
Note: The protocol parameter defines the interaction protocol in which the ACL message is generated. This parameter is optional; however, developers are advised that employing ACL without the framework of an interaction protocol (and thus directly using the ACL semantics to control the agent’s generation and interpretation of ACL messages) is an extremely ambitious undertaking.
public java.util.Set<AID> getReceiverSet()
The receiver parameter denotes the identity of the intended recipients of the message.
The receiver parameter may be a single agent or a set of agents. The latter corresponds to the situation where the message is multicast. Pragmatically, the semantics of this multicast is that the sender intends the message for each recipient of the CA encoded in the message. For example, if an agent performs an inform act with a set of three agents as receiver, it denotes that the sender intends each of these agents to come to believe the content of the message.
Note:Ordinarily, the receiver parameter will be a part of every ACL message. It is only permissible to omit the receiver parameter if the message recipient can be reliably inferred from context, or in special cases such as the embedded ACL message in proxy and propagate.
public java.util.Date getReplyByDate()
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply.
Notes: The time will be expressed according to the sender's view of the time on the sender's platform. The reply message can be identified in several ways: as the next sequential message in an interaction protocol, through the use of the reply-with parameter, through the use of a conversation-id and so forth. The way that the reply message is identified is determined by the agent implementer.
public long getReplyByMillis()
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply.
Notes: The time will be expressed according to the sender's view of the time on the sender's platform. The reply message can be identified in several ways: as the next sequential message in an interaction protocol, through the use of the reply-with parameter, through the use of a conversation-id and so forth. The way that the reply message is identified is determined by the agent implementer.
public java.lang.String getReplyByString()
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply.
Notes: The time will be expressed according to the sender's view of the time on the sender's platform. The reply message can be identified in several ways: as the next sequential message in an interaction protocol, through the use of the reply-with parameter, through the use of a conversation-id and so forth. The way that the reply message is identified is determined by the agent implementer.
public java.util.Set<AID> getReplyToSet()
The reply-to parameter indicates that subsequent messages in this conversation thread are to be directed to the agent named in the reply-to parameter, instead of to the agent named in the sender parameter.
public java.lang.String getReplyWith()
The reply-with parameter introduces an expression that will be used by the responding agent to identify this message.
The reply-with parameter is designed to be used to follow a conversation thread in a situation where multiple dialogues occur simultaneously. For example, if agent i sends to agent j a message which contains: reply-with <expr>. Agent j will respond with a message containing: in-reply-to <expr>.
public AID getSender()
The sender parameter denotes the identity of the sender of the message, i.e. the agent which performs the communicative act giving rise to this ACL message.
Note:The sender parameter will be a parameter of most ACL messages. It is possible to omit the sender parameter if, for example, the agent sending the ACL message wishes to remain anonymous.
public java.util.Properties getUserDefinedProperties()
Every FIPA implementation is free to include user-defined message parameters other than the FIPA ACL message parameters specified by FIPA00061. The semantics of these user-defined parameters is not defined by FIPA, and FIPA compliance does not require any particular interpretation of these parameters. The prefatory string "X-" must be used for the names of these non-FIPA standard additional parameters.
Notes: The keyword of a user-defined parameter must not contain space inside.
The user must not add the prefix "X-" to the keyword. This is automatically added by the StringACLCodec.
public void reset()
public void setByteSequenceContent(byte[] content)
public void setContent(java.lang.String content)
This parameter denotes the content of the message; equivalently denotes the object of the action. The meaning of the content of any ACL message is intended to be interpreted by the receiver of the message. This is particularly relevant for instance when referring to referential expressions, whose interpretation might be different for the sender and the receiver.
Note: Most ACL messages require a content expression. Certain ACL message types, such as cancel, have an implicit content, especially in cases of using the conversation-id or in-reply-to parameters.
Warning: no checks are made to validate the content value.
content - A string representing the content of this message.
public void setContentObject(java.io.Serializable s)
throws java.io.IOException
ACLMessage msg = new ACLMessage(ACLMessage.INFORM);
Date d = new Date();
try {
msg.setContentObject(d);
} catch(IOException e) {
// handle IOException
}
s - the object that will be used to set the content of the
ACLMessage.
java.io.IOException - if an I/O error occurs.public void setConversationId(java.lang.String conversationId)
The conversation-id parameter introduces an expression which is used to identify the ongoing sequence of communicative acts that together form a conversation.
It is required the usage of globally unique values for the conversation-id parameter in order to allow the participants to distinguish between several concurrent conversations. A simple mechanism to ensure uniqueness is the concatenation of the globally unique identifier of the sender agent to an identifier (for example, a progressive number) that is unique within the scope of the sender agent itself.
Note: An agent may tag ACL messages with a conversation identifier to manage its communication strategies and activities. Typically this will allow an agent to identify individual conversations with multiple agents. It will also allow agents to reason across historical records of conversations.
conversationId - A string representing the conversation-id of
this message.public void setEncoding(java.lang.String encoding)
This parameter denotes the specific encoding of the content language expression.
Note: The content expression might be encoded in several ways. The encoding parameter is optionally used to specify this encoding to the recipient agent. If the encoding parameter is not present, the encoding will be specified in the message envelope that encloses the ACL message.
encoding - A string representing the encoding of this message.public void setInReplyTo(java.lang.String inReplyTo)
The in-reply-to parameter denotes an expression that references an earlier action to which this message is a reply.
inReplyTo - A string representing the in-reply-to parameter of
this message.getReplyWith(),
setReplyWith()public void setLanguage(java.lang.String language)
This parameter denotes the language in which the content parameter is expressed, for example SL, CCL, KIF or RDF.
Note: The ACL content parameter is expressed in a formal language. This field may be omitted if the agent receiving the message can be assumed to know the language of the content expression.
public void setOntology(java.lang.String ontology)
This parameter denotes the ontology used to give a meaning to the symbols in the content expression.
Note: The ontology parameter is used in conjunction with the language parameter to support the interpretation of the content expression by the receiving agent. In many situations, the ontology parameter will be commonly understood by the agent community and so this message parameter may be omitted.
ontology - A string representing the ontology of this message.public void setPerformative(Performative p)
The performative parameter denotes the type of the communicative act of the ACL message as defied by FIPA00037.
Note: The performative parameter is a required parameter of all ACL messages.
performative - An integer identifying the FIPA performative to be
set to this message. Remember to use the set of constants provided by
this class.public void setProtocol(java.lang.String protocol)
This parameter denotes the interaction protocol that the sending agent is employing with this ACL message. Some standard FIPA interaction protocols are: Request, Query, Request When, Contract Net, Subscribe, Propose, Auction etc.
Any ACL message that contains a non-null value for the protocol parameter is considered to belong to a conversation and it is required to respect the following rules:
Note: The protocol parameter defines the interaction protocol in which the ACL message is generated. This parameter is optional; however, developers are advised that employing ACL without the framework of an interaction protocol (and thus directly using the ACL semantics to control the agent’s generation and interpretation of ACL messages) is an extremely ambitious undertaking.
public void setReplyBy(java.util.Date date)
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply.
Notes: The time will be expressed according to the sender's view of the time on the sender's platform. The reply message can be identified in several ways: as the next sequential message in an interaction protocol, through the use of the reply-with parameter, through the use of a conversation-id and so forth. The way that the reply message is identified is determined by the agent implementer.
replyBy - A java.util.Date representing the reply-by parameter of
this message.public void setReplyBy(long millis)
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply.
Notes: The time will be expressed according to the sender's view of the time on the sender's platform. The reply message can be identified in several ways: as the next sequential message in an interaction protocol, through the use of the reply-with parameter, through the use of a conversation-id and so forth. The way that the reply message is identified is determined by the agent implementer.
replyBy - The number of milliseconds since January 1, 1970,
00:00:00 GMT representing the reply-by parameter of this message.
public void setReplyBy(java.lang.String str)
throws java.lang.IllegalArgumentException
The reply-by parameter denotes a time and/or date expression which indicates the latest time by which the sending agent would like to receive a reply.
Notes: The time will be expressed according to the sender's view of the time on the sender's platform. The reply message can be identified in several ways: as the next sequential message in an interaction protocol, through the use of the reply-with parameter, through the use of a conversation-id and so forth. The way that the reply message is identified is determined by the agent implementer.
replyBy - A java.util.Date representing the reply-by parameter of
this message.
java.lang.IllegalArgumentExceptionpublic void setReplyWith(java.lang.String replyWith)
The reply-with parameter introduces an expression that will be used by the responding agent to identify this message.
The reply-with parameter is designed to be used to follow a conversation thread in a situation where multiple dialogues occur simultaneously. For example, if agent i sends to agent j a message which contains: reply-with <expr>. Agent j will respond with a message containing: in-reply-to <expr>.
replyWith - A string representing the reply-with parameter of this
message.public void setSender(AID sender)
The sender parameter denotes the identity of the sender of the message, i.e. the agent which performs the communicative act giving rise to this ACL message.
Note:The sender parameter will be a parameter of most ACL messages. It is possible to omit the sender parameter if, for example, the agent sending the ACL message wishes to remain anonymous.
sender - The AID of the sender of this message.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||