Class ACLMessage

All Implemented Interfaces:
Serializable, Cloneable

public class ACLMessage extends ActMessage
This class describes an ACL message. It provides accessors for all message parameters defined in the FIPA 97 specification part 2. Note that the :receiver and :sender are automatically mapped to the MaDKit AgentAddress.
Since:
MaDKit 1.0
Version:
1.1
Author:
Ol. Gutknecht, J. Ferber
See Also:
  • Field Details

  • Constructor Details

    • ACLMessage

      public ACLMessage()
      Default constructor for ACLMessage class
    • ACLMessage

      public ACLMessage(String actType)
      Constructor for ACLMessage class
    • ACLMessage

      public ACLMessage(String actType, String cont)
      Constructor for ACLMessage class
    • ACLMessage

      public ACLMessage(int perf, String cont)
  • Method Details

    • getAct

      public String getAct()
    • setContent

      public void setContent(String s)
      Overrides:
      setContent in class ActMessage
    • getPerformative

      public String getPerformative()
    • setPerformative

      public void setPerformative(String s)
    • addReceiver

      public void addReceiver(AgentAddress r)
      Adds a value to :receiver slot. Warning: no checks are made to validate the slot value.
      Parameters:
      r - The value to add to the slot value set.
    • getReceivers

      public List<AgentAddress> getReceivers()
      Return the list of receivers..
    • removeReceiver

      public boolean removeReceiver(AgentAddress r)
      Removes a value from :receiver slot. Warning: no checks are made to validate the slot value.
      Parameters:
      r - The value to remove from the slot value set.
      Returns:
      true if the AgentAddress has been found and removed, false otherwise
    • clearAllReceiver

      public void clearAllReceiver()
      Removes all values from :receiver slot. Warning: no checks are made to validate the slot value.
    • addReplyTo

      public void addReplyTo(AgentAddress dest)
      Adds a value to :reply-to slot. Warning: no checks are made to validate the slot value.
      Parameters:
      dest - The value to add to the slot value set.
    • removeReplyTo

      public boolean removeReplyTo(AgentAddress dest)
      Removes a value from :reply_to slot. Warning: no checks are made to validate the slot value.
      Parameters:
      dest - The value to remove from the slot value set.
      Returns:
      true if the AgentAddress has been found and removed, false otherwise
    • clearAllReplyTo

      public void clearAllReplyTo()
      Removes all values from :reply_to slot. Warning: no checks are made to validate the slot value.
    • getEnvelope

      public String getEnvelope()
    • setEnvelope

      public void setEnvelope(String s)
    • getConversationIDentifier

      public String getConversationIDentifier()
    • setConversationID

      public void setConversationID(String s)
    • getProtocol

      public String getProtocol()
    • setProtocol

      public void setProtocol(String s)
    • getReplyWith

      public String getReplyWith()
    • setReplyWith

      public void setReplyWith(String s)
    • getReplyBy

      public String getReplyBy()
    • setReplyBy

      public void setReplyBy(String s)
    • setReplyBy

      public void setReplyBy(Date s)
    • getInReplyTo

      public String getInReplyTo()
      Overrides:
      getInReplyTo in class ActMessage
    • setInReplyTo

      public void setInReplyTo(String s)
      Overrides:
      setInReplyTo in class ActMessage
    • getLanguage

      public String getLanguage()
    • setLanguage

      public void setLanguage(String s)
    • getEncoding

      public String getEncoding()
    • setEncoding

      public void setEncoding(String s)
    • getOntology

      public String getOntology()
    • setOntology

      public void setOntology(String s)
    • toString

      public String toString()
      Overrides:
      toString in class Message
    • createReply

      public ACLMessage createReply()
      create a new ACLMessage that is a reply to this message. In particular, it sets the following parameters of the new message: receiver, language, ontology, protocol, conversation-id, in-reply-to, reply-with. The programmer needs to set the communicative-act and the content. Of course, if he wishes to do that, he can reset any of the fields.
      Returns:
      the ACLMessage to send as a reply