Class Envelope

    • 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​(String c)
        Set the comments slot of this object.
        Parameters:
        c - The string for the envelope comments.
      • getComments

        public 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​(String r)
        Set the acl-representation slot of this object.
        Parameters:
        r - The string for the ACL representation.
      • getAclRepresentation

        public 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​(Long l)
        Set the payload-length slot of this object.
        Parameters:
        l - The payload length, in bytes.
      • getPayloadLength

        public 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​(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 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​(Date d)
        Set the date slot of this object.
        Parameters:
        d - The envelope date.
      • getDate

        public 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 String toString()
        Retrieve a string representation for this platform description.
        Overrides:
        toString in class Object
        Returns:
        an SL0-like String representation of this object