|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectes.upv.dsic.gti_ia.core.ACLMessage
public class ACLMessage
This class represents a message sent between agents.
| Field Summary | |
|---|---|
static int |
ACCEPT_PROPOSAL
constant identifying the FIPA performative |
static int |
AGREE
constant identifying the FIPA performative |
static int |
CANCEL
constant identifying the FIPA performative |
static int |
CFP
constant identifying the FIPA performative |
static int |
CONFIRM
constant identifying the FIPA performative |
static int |
DISCONFIRM
constant identifying the FIPA performative |
static int |
FAILURE
constant identifying the FIPA performative |
static int |
INFORM
constant identifying the FIPA performative |
static int |
INFORM_IF
constant identifying the FIPA performative |
static int |
INFORM_REF
constant identifying the FIPA performative |
static int |
NOT_UNDERSTOOD
constant identifying the FIPA performative |
static int |
PROPAGATE
constant identifying the FIPA performative |
static int |
PROPOSE
constant identifying the FIPA performative |
static int |
PROXY
constant identifying the FIPA performative |
static int |
QUERY_IF
constant identifying the FIPA performative |
static int |
QUERY_REF
constant identifying the FIPA performative |
static int |
REFUSE
constant identifying the FIPA performative |
static int |
REJECT_PROPOSAL
constant identifying the FIPA performative |
static int |
REQUEST
constant identifying the FIPA performative |
static int |
REQUEST_WHEN
constant identifying the FIPA performative |
static int |
REQUEST_WHENEVER
constant identifying the FIPA performative |
static int |
SUBSCRIBE
constant identifying the FIPA performative |
static int |
UNKNOWN
constant identifying an unknown performative |
| Constructor Summary | |
|---|---|
ACLMessage()
Empty constructor. |
|
ACLMessage(int performative)
Constructor for the class. |
|
| Method Summary | |
|---|---|
int |
addReceiver(AgentID r)
Adds a receiver to the receivers list |
void |
clearAllReceiver()
Clears receivers list |
ACLMessage |
clone()
Clones Message |
void |
copyFromAsTemplate(ACLMessage msg)
Copies the fields of the message to this one, when those fields have a correct value. |
ACLMessage |
createReply()
Creates an ACLMessage that is a reply to this one |
static ACLMessage |
fromString(String strMsg)
Parses the message given as a String and creates an object of type ACLMessage. |
byte[] |
getByteSequenceContent()
Reads :content slot. |
String |
getContent()
Gets the content of this message. |
Object |
getContentObject()
This method returns the content of this ACLMessage when they have been written via the method setContentObject. |
String |
getConversationId()
Gets the conversationID of this message. |
String |
getEncoding()
Get the encoding for this message. |
String |
getExchangeHeader(String key)
|
Map<String,String> |
getExchangeHeaders()
|
Map<String,String> |
getHeaders()
Obtains the whole set of headers in this message. |
String |
getHeaderValue(String key)
Gets the value of a header for this message. |
String |
getInReplyTo()
Gets the inReplyTo field of this message. |
String |
getLanguage()
Gets the language field. |
String |
getOntology()
Get the ontology for the message |
String |
getPerformative()
|
static String |
getPerformative(int perf)
Returns the string corresponding to the integer for the performative |
static int |
getPerformative(String perf)
Returns the integer corresponding to the performative |
int |
getPerformativeInt()
|
String |
getProtocol()
Gets the protocol for the message |
AgentID |
getReceiver()
Obtains the AgentID of the first receiver of the (possibly many) receivers of this message. |
AgentID |
getReceiver(int index)
Returns receiver in index position in receivers list |
ArrayList<AgentID> |
getReceiverList()
Returns the whole list of the AgentID of the receivers. |
String |
getReplyBy()
Gets the replyBy field. |
Date |
getReplyByDate()
Gets the replyByDate field for this message. |
AgentID |
getReplyTo()
Gets the ReplyTo field |
String |
getReplyWith()
Gets the replyWith field of this message. |
AgentID |
getSender()
Returns the sender of this message. |
int |
getTotalReceivers()
Gets the count of receivers of this message. |
void |
putExchangeHeader(String key,
String value)
|
void |
setByteSequenceContent(byte[] content)
Sets the value of byte sequence content |
void |
setContent(String cont)
Sets content field. |
void |
setContentObject(Serializable s)
Sets the value of byte sequence content |
void |
setConversationId(String id)
Sets the conversationID of this message. |
void |
setEncoding(String encoding)
Set encoding of the message |
void |
setHeader(String key,
String value)
Sets the value of a header for this message. |
void |
setInReplyTo(String irt)
Sets the inReplyTo field of this message. |
void |
setLanguage(String lang)
Sets language field |
void |
setOntology(String ontology)
Set ontology of the message |
void |
setPerformative(int performative)
Sets performative type |
void |
setPerformative(String performative)
Sets the performative field in the message. |
void |
setProtocol(String protocol)
Sets the protocol for the message |
void |
setReceiver(AgentID receiver)
Sets the receiver. |
void |
setReplyByDate(Date date)
Sets the replyByDate field for this message. |
void |
setReplyTo(AgentID reply)
Sets ReplyTo field |
void |
setReplyWith(String rw)
Sets the replyWith field of this message. |
void |
setSender(AgentID sender)
Set sender |
String |
toString()
Serializes this message to a String, using all the fields in the message. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ACCEPT_PROPOSAL
public static final int AGREE
public static final int CANCEL
public static final int CFP
public static final int CONFIRM
public static final int DISCONFIRM
public static final int FAILURE
public static final int INFORM
public static final int INFORM_IF
public static final int INFORM_REF
public static final int NOT_UNDERSTOOD
public static final int PROPOSE
public static final int QUERY_IF
public static final int QUERY_REF
public static final int REFUSE
public static final int REJECT_PROPOSAL
public static final int REQUEST
public static final int REQUEST_WHEN
public static final int REQUEST_WHENEVER
public static final int SUBSCRIBE
public static final int PROXY
public static final int PROPAGATE
public static final int UNKNOWN
| Constructor Detail |
|---|
public ACLMessage()
setPerformativepublic ACLMessage(int performative)
performative - The performative to be used in this message.setPerformative| Method Detail |
|---|
public void setPerformative(int performative)
performative - public String getPerformative()
public int getPerformativeInt()
public void setSender(AgentID sender)
sender - The AgentID of the sender of this message.AgentIDpublic AgentID getSender()
AgentIDpublic void setReceiver(AgentID receiver)
receiver - public AgentID getReceiver()
AgentIDpublic AgentID getReceiver(int index)
index -
public void setReplyTo(AgentID reply)
reply - public AgentID getReplyTo()
public void setContent(String cont)
cont - public String getContent()
public void setLanguage(String lang)
lang - public String getLanguage()
public void setEncoding(String encoding)
encoding - public String getEncoding()
public void setOntology(String ontology)
ontology - public String getOntology()
public void setProtocol(String protocol)
protocol - public String getProtocol()
public void setConversationId(String id)
id - A String containing the conversationID to be set.public String getConversationId()
public void setReplyWith(String rw)
replyWith - public String getReplyWith()
public void setInReplyTo(String irt)
inReplyTo - public String getInReplyTo()
public void setReplyByDate(Date date)
date - If the date is null, the current time and date is used.public Date getReplyByDate()
public String getReplyBy()
public void setPerformative(String performative)
performative - Must contain a valid performative (e.g. INFORM) in order to be set.
See the performatives in this class to notice which ones are valid.ACLMessagepublic void clearAllReceiver()
public int addReceiver(AgentID r)
receiver - AgentID of the receiver to be added.
public ArrayList<AgentID> getReceiverList()
AgentIDpublic int getTotalReceivers()
public ACLMessage clone()
clone in class Objectpublic ACLMessage createReply()
public void copyFromAsTemplate(ACLMessage msg)
msg - From which the fields are to be copied.
public void setHeader(String key,
String value)
key - The name of the headervalue - The content for the headerpublic String getHeaderValue(String key)
key - The name of the header
public Map<String,String> getHeaders()
public void setContentObject(Serializable s)
throws IOException
serializable - object to store
IOExceptionpublic void setByteSequenceContent(byte[] content)
byte - array to storepublic static int getPerformative(String perf)
public static String getPerformative(int perf)
public byte[] getByteSequenceContent()
:content slot.
:content slot.public Object getContentObject()
setContentObject.
public String toString()
toString in class Objectpublic static ACLMessage fromString(String strMsg)
strMsg - String containing a serialization of an ACLMessage
toString()public Map<String,String> getExchangeHeaders()
public void putExchangeHeader(String key,
String value)
public String getExchangeHeader(String key)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||