Package jade.domain.FIPAAgentManagement
Class Envelope
- java.lang.Object
-
- jade.domain.FIPAAgentManagement.Envelope
-
- All Implemented Interfaces:
Concept,Term,Serializable,Serializable
public class Envelope extends Object implements Concept, Serializable
This class models an envelope.- Version:
- $Date$ $Revision$
- Author:
- Fabio Bellifemine - CSELT S.p.A.
- See Also:
FIPAManagementOntology, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Envelope()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIntendedReceiver(AID id)Add an agent identifier to theintended-receiverslot collection of this object.voidaddProperties(Property p)Add a property to thepropertiesslot collection of this object.voidaddStamp(ReceivedObject ro)Add areceived-objectstamp to this message envelope.voidaddTo(AID id)Add an agent identifier to thetoslot collection of this object.voidclearAllIntendedReceiver()Remove all agent identifiers from theintended-receiverslot collection of this object.voidclearAllProperties()Remove all properties from thepropertiesslot collection of this object.voidclearAllTo()Remove all agent identifiers from thetoslot collection of this object.Objectclone()StringgetAclRepresentation()Retrieve theacl-representationslot of this object.IteratorgetAllIntendedReceiver()Access all agent identifiers from theintended receiverslot collection of this object.IteratorgetAllProperties()Access all properties from thepropertiesslot collection of this object.IteratorgetAllTo()Access all agent identifiers from thetoslot collection of this object.StringgetComments()Retrieve thecommentsslot of this object.DategetDate()Retrieve thedateslot of this object.AIDgetFrom()Retrieve thefromslot of this object.StringgetPayloadEncoding()Retrieve thepayload-encodingslot of this object.LonggetPayloadLength()Retrieve thepayload-lengthslot of this object.ReceivedObjectgetReceived()Retrieve thereceivedslot of this object.ReceivedObject[]getStamps()Access the list of all the stamps.booleanremoveIntendedReceiver(AID id)Remove an agent identifier from theintended-receiverslot collection of this object.booleanremoveProperties(Property p)Remove a property from thepropertiesslot collection of this object.booleanremoveTo(AID id)Remove an agent identifier from thetoslot collection of this object.voidsetAclRepresentation(String r)Set theacl-representationslot of this object.voidsetComments(String c)Set thecommentsslot of this object.voidsetDate(Date d)Set thedateslot of this object.voidsetFrom(AID id)Set thefromslot of this object.voidsetPayloadEncoding(String e)Set thepayload-encodingslot of this object.voidsetPayloadLength(Long l)Set thepayload-lengthslot of this object.voidsetReceived(ReceivedObject ro)Set thereceivedslot of this object.StringtoString()Retrieve a string representation for this platform description.
-
-
-
Method Detail
-
addTo
public void addTo(AID id)
Add an agent identifier to thetoslot collection of this object.- Parameters:
id- The agent identifier to add to the collection.
-
removeTo
public boolean removeTo(AID id)
Remove an agent identifier from thetoslot collection of this object.- Parameters:
id- The agent identifierto remove from the collection.- Returns:
- A boolean, telling whether the element was present in the collection or not.
-
clearAllTo
public void clearAllTo()
Remove all agent identifiers from thetoslot collection of this object.
-
getAllTo
public Iterator getAllTo()
Access all agent identifiers from thetoslot collection of this object.- Returns:
- An iterator over the agent identifiers collection.
-
setFrom
public void setFrom(AID id)
Set thefromslot of this object.- Parameters:
id- The agent identifier for the envelope sender.
-
getFrom
public AID getFrom()
Retrieve thefromslot of this object.- Returns:
- The value of the
fromslot of this envelope, ornullif no value was set.
-
setComments
public void setComments(String c)
Set thecommentsslot of this object.- Parameters:
c- The string for the envelope comments.
-
getComments
public String getComments()
Retrieve thecommentsslot of this object.- Returns:
- The value of the
commentsslot of this envelope, ornullif no value was set.
-
setAclRepresentation
public void setAclRepresentation(String r)
Set theacl-representationslot of this object.- Parameters:
r- The string for the ACL representation.
-
getAclRepresentation
public String getAclRepresentation()
Retrieve theacl-representationslot of this object.- Returns:
- The value of the
acl-representationslot of this envelope, ornullif no value was set.
-
setPayloadLength
public void setPayloadLength(Long l)
Set thepayload-lengthslot of this object.- Parameters:
l- The payload length, in bytes.
-
getPayloadLength
public Long getPayloadLength()
Retrieve thepayload-lengthslot of this object.- Returns:
- The value of the
payload-lengthslot of this envelope, ornullor a negative value if no value was set.
-
setPayloadEncoding
public void setPayloadEncoding(String e)
Set thepayload-encodingslot of this object. This slot can be used to specify a different charset than the standard one (US-ASCII) in order for instance to support accentuated characters in the content slot of the ACL message (e.g. setPayloadEncoding("UTF-8")).- Parameters:
e- The string for the payload encoding.
-
getPayloadEncoding
public String getPayloadEncoding()
Retrieve thepayload-encodingslot of this object.- Returns:
- The value of the
payload-encodingslot of this envelope, ornullif no value was set.
-
setDate
public void setDate(Date d)
Set thedateslot of this object.- Parameters:
d- The envelope date.
-
getDate
public Date getDate()
Retrieve thedateslot of this object.- Returns:
- The value of the
dateslot of this envelope, ornullif no value was set.
-
addIntendedReceiver
public void addIntendedReceiver(AID id)
Add an agent identifier to theintended-receiverslot collection of this object.- Parameters:
id- The agent identifier to add to the collection.
-
removeIntendedReceiver
public boolean removeIntendedReceiver(AID id)
Remove an agent identifier from theintended-receiverslot collection of this object.- Parameters:
id- The agent identifier to remove from the collection.- Returns:
- A boolean, telling whether the element was present in the collection or not.
-
clearAllIntendedReceiver
public void clearAllIntendedReceiver()
Remove all agent identifiers from theintended-receiverslot collection of this object.
-
getAllIntendedReceiver
public Iterator getAllIntendedReceiver()
Access all agent identifiers from theintended receiverslot collection of this object.- Returns:
- An iterator over the agent identifiers collection.
-
setReceived
public void setReceived(ReceivedObject ro)
Set thereceivedslot of this object.- Parameters:
ro- The received object for thereceivedslot.
-
getReceived
public ReceivedObject getReceived()
Retrieve thereceivedslot of this object.- Returns:
- The value of the
receivedslot of this envelope, ornullif no value was set.
-
addStamp
public void addStamp(ReceivedObject ro)
Add areceived-objectstamp to this message envelope. This method is used by the ACC to add a new stamp to the envelope at every routing hop.- Parameters:
ro- Thereceived-objectto add.
-
getStamps
public ReceivedObject[] getStamps()
Access the list of all the stamps. Thereceived-objectstamps are sorted according to the routing path, from the oldest to the newest.
-
addProperties
public void addProperties(Property p)
Add a property to thepropertiesslot collection of this object.- Parameters:
p- The property to add to the collection.
-
removeProperties
public boolean removeProperties(Property p)
Remove a property from thepropertiesslot collection of this object.- Parameters:
p- The property to remove from the collection.- Returns:
- A boolean, telling whether the element was present in the collection or not.
-
clearAllProperties
public void clearAllProperties()
Remove all properties from thepropertiesslot collection of this object.
-
getAllProperties
public Iterator getAllProperties()
Access all properties from thepropertiesslot collection of this object.- Returns:
- An iterator over the properties collection.
-
toString
public String toString()
Retrieve a string representation for this platform description.
-
-