jade.domain.FIPAAgentManagement
Class Envelope

java.lang.Object
  |
  +--jade.domain.FIPAAgentManagement.Envelope
All Implemented Interfaces:
Concept, Serializable, java.io.Serializable, Term

public class Envelope
extends java.lang.Object
implements Concept, Serializable

This class models an envelope.

Version:
$Date: 2005-04-13 17:20:32 +0200 (mer, 13 apr 2005) $ $Revision: 5664 $
Author:
Fabio Bellifemine - CSELT S.p.A.
See Also:
FIPAManagementOntology, Serialized Form

Constructor Summary
Envelope()
          Default constructor.
 
Method Summary
 void addIntendedReceiver(AID id)
          Add an agent identifier to the intended-receiver slot collection of this object.
 void addProperties(Property p)
          Add a property to the properties slot collection of this object.
 void addStamp(ReceivedObject ro)
          Add a received-object stamp to this message envelope.
 void addTo(AID id)
          Add an agent identifier to the to slot collection of this object.
 void clearAllIntendedReceiver()
          Remove all agent identifiers from the intended-receiver slot collection of this object.
 void clearAllProperties()
          Remove all properties from the properties slot collection of this object.
 void clearAllTo()
          Remove all agent identifiers from the to slot collection of this object.
 java.lang.String getAclRepresentation()
          Retrieve the acl-representation slot of this object.
 Iterator getAllIntendedReceiver()
          Access all agent identifiers from the intended receiver slot collection of this object.
 Iterator getAllProperties()
          Access all properties from the properties slot collection of this object.
 Iterator getAllTo()
          Access all agent identifiers from the to slot collection of this object.
 java.lang.String getComments()
          Retrieve the comments slot of this object.
 java.util.Date getDate()
          Retrieve the date slot of this object.
 AID getFrom()
          Retrieve the from slot of this object.
 java.lang.String getPayloadEncoding()
          Retrieve the payload-encoding slot of this object.
 java.lang.Long getPayloadLength()
          Retrieve the payload-length slot of this object.
 ReceivedObject getReceived()
          Retrieve the received slot of this object.
 ReceivedObject[] getStamps()
          Access the list of all the stamps.
 boolean removeIntendedReceiver(AID id)
          Remove an agent identifier from the intended-receiver slot collection of this object.
 boolean removeProperties(Property p)
          Remove a property from the properties slot collection of this object.
 boolean removeTo(AID id)
          Remove an agent identifier from the to slot collection of this object.
 void setAclRepresentation(java.lang.String r)
          Set the acl-representation slot of this object.
 void setComments(java.lang.String c)
          Set the comments slot of this object.
 void setDate(java.util.Date d)
          Set the date slot of this object.
 void setFrom(AID id)
          Set the from slot of this object.
 void setPayloadEncoding(java.lang.String e)
          Set the payload-encoding slot of this object.
 void setPayloadLength(java.lang.Long l)
          Set the payload-length slot of this object.
 void setReceived(ReceivedObject ro)
          Set the received slot of this object.
 java.lang.String toString()
          Retrieve a string representation for this platform description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Envelope

public Envelope()
Default constructor. Initializes the payloadLength to -1.

Method Detail

addTo

public void addTo(AID id)
Add an agent identifier to the to slot 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 the to slot 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 the to slot collection of this object.


getAllTo

public Iterator getAllTo()
Access all agent identifiers from the to slot collection of this object.

Returns:
An iterator over the agent identifiers collection.

setFrom

public void setFrom(AID id)
Set the from slot of this object.

Parameters:
id - The agent identifier for the envelope sender.

getFrom

public AID getFrom()
Retrieve the from slot of this object.

Returns:
The value of the from slot of this envelope, or null if no value was set.

setComments

public void setComments(java.lang.String c)
Set the comments slot of this object.

Parameters:
c - The string for the envelope comments.

getComments

public java.lang.String getComments()
Retrieve the comments slot of this object.

Returns:
The value of the comments slot of this envelope, or null if no value was set.

setAclRepresentation

public void setAclRepresentation(java.lang.String r)
Set the acl-representation slot of this object.

Parameters:
r - The string for the ACL representation.

getAclRepresentation

public java.lang.String getAclRepresentation()
Retrieve the acl-representation slot of this object.

Returns:
The value of the acl-representation slot of this envelope, or null if no value was set.

setPayloadLength

public void setPayloadLength(java.lang.Long l)
Set the payload-length slot of this object.

Parameters:
l - The payload length, in bytes.

getPayloadLength

public java.lang.Long getPayloadLength()
Retrieve the payload-length slot of this object.

Returns:
The value of the payload-length slot of this envelope, or null or a negative value if no value was set.

setPayloadEncoding

public void setPayloadEncoding(java.lang.String e)
Set the payload-encoding slot 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 java.lang.String getPayloadEncoding()
Retrieve the payload-encoding slot of this object.

Returns:
The value of the payload-encoding slot of this envelope, or null if no value was set.

setDate

public void setDate(java.util.Date d)
Set the date slot of this object.

Parameters:
d - The envelope date.

getDate

public java.util.Date getDate()
Retrieve the date slot of this object.

Returns:
The value of the date slot of this envelope, or null if no value was set.

addIntendedReceiver

public void addIntendedReceiver(AID id)
Add an agent identifier to the intended-receiver slot 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 the intended-receiver slot 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 the intended-receiver slot collection of this object.


getAllIntendedReceiver

public Iterator getAllIntendedReceiver()
Access all agent identifiers from the intended receiver slot collection of this object.

Returns:
An iterator over the agent identifiers collection.

setReceived

public void setReceived(ReceivedObject ro)
Set the received slot of this object.

Parameters:
ro - The received object for the received slot.

getReceived

public ReceivedObject getReceived()
Retrieve the received slot of this object.

Returns:
The value of the received slot of this envelope, or null if no value was set.

addStamp

public void addStamp(ReceivedObject ro)
Add a received-object stamp 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 - The received-object to add.

getStamps

public ReceivedObject[] getStamps()
Access the list of all the stamps. The received-object stamps are sorted according to the routing path, from the oldest to the newest.


addProperties

public void addProperties(Property p)
Add a property to the properties slot collection of this object.

Parameters:
p - The property to add to the collection.

removeProperties

public boolean removeProperties(Property p)
Remove a property from the properties slot 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 the properties slot collection of this object.


getAllProperties

public Iterator getAllProperties()
Access all properties from the properties slot collection of this object.

Returns:
An iterator over the properties collection.

toString

public java.lang.String toString()
Retrieve a string representation for this platform description.

Overrides:
toString in class java.lang.Object
Returns:
an SL0-like String representation of this object


JADE