madkit.message

## Class ACLMessage

- java.lang.Object
- - madkit.kernel.Message
  - - madkit.message.ActMessage
    - - madkit.message.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:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ACCEPT_PROPOSAL` constant identifying the FIPA performative
    `static String` | `ACCEPT_PROPOSAL_STRING`
    `static int` | `AGREE` constant identifying the FIPA performative
    `static String` | `AGREE_STRING`
    `static int` | `CANCEL` constant identifying the FIPA performative
    `static String` | `CANCEL_STRING`
    `static int` | `CFP` constant identifying the FIPA performative
    `static String` | `CFP_STRING`
    `static int` | `CONFIRM` constant identifying the FIPA performative
    `static String` | `CONFIRM_STRING`
    `static int` | `DISCONFIRM` constant identifying the FIPA performative
    `static String` | `DISCONFIRM_STRING`
    `static int` | `FAILURE` constant identifying the FIPA performative
    `static String` | `FAILURE_STRING`
    `static int` | `INFORM` constant identifying the FIPA performative
    `static int` | `INFORM_IF` constant identifying the FIPA performative
    `static String` | `INFORM_IF_STRING`
    `static int` | `INFORM_REF` constant identifying the FIPA performative
    `static String` | `INFORM_REF_STRING`
    `static String` | `INFORM_STRING`
    `static int` | `NOT_UNDERSTOOD` constant identifying the FIPA performative
    `static String` | `NOT_UNDERSTOOD_STRING`
    `static List<String>` | `performatives`
    `static int` | `PROPAGATE` constant identifying the FIPA performative
    `static String` | `PROPAGATE_STRING`
    `static int` | `PROPOSE` constant identifying the FIPA performative
    `static String` | `PROPOSE_STRING`
    `static int` | `PROXY` constant identifying the FIPA performative
    `static String` | `PROXY_STRING`
    `static int` | `QUERY_IF` constant identifying the FIPA performative
    `static String` | `QUERY_IF_STRING`
    `static int` | `QUERY_REF` constant identifying the FIPA performative
    `static String` | `QUERY_REF_STRING`
    `static int` | `REFUSE` constant identifying the FIPA performative
    `static String` | `REFUSE_STRING`
    `static int` | `REJECT_PROPOSAL` constant identifying the FIPA performative
    `static String` | `REJECT_PROPOSAL_STRING`
    `static int` | `REQUEST` constant identifying the FIPA performative
    `static String` | `REQUEST_STRING`
    `static int` | `REQUEST_WHEN` constant identifying the FIPA performative
    `static String` | `REQUEST_WHEN_STRING`
    `static int` | `REQUEST_WHENEVER` constant identifying the FIPA performative
    `static String` | `REQUEST_WHENEVER_STRING`
    `static int` | `SUBSCRIBE` constant identifying the FIPA performative
    `static String` | `SUBSCRIBE_STRING`
    `static int` | `UNKNOWN` constant identifying an unknown performative

    - ### Fields inherited from class madkit.message.ActMessage

      `action, fields`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ACLMessage()` Default constructor for ACLMessage class
    `ACLMessage(int perf, String cont)`
    `ACLMessage(String actType)` Constructor for ACLMessage class
    `ACLMessage(String actType, String cont)` Constructor for ACLMessage class

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addReceiver(AgentAddress r)` Adds a value to `:receiver` slot.
    `void` | `addReplyTo(AgentAddress dest)` Adds a value to `:reply-to` slot.
    `void` | `clearAllReceiver()` Removes all values from `:receiver` slot.
    `void` | `clearAllReplyTo()` Removes all values from `:reply_to` slot.
    `ACLMessage` | `createReply()` create a new ACLMessage that is a reply to this message.
    `String` | `getAct()`
    `String` | `getConversationIDentifier()`
    `String` | `getEncoding()`
    `String` | `getEnvelope()`
    `String` | `getInReplyTo()`
    `String` | `getLanguage()`
    `String` | `getOntology()`
    `String` | `getPerformative()`
    `String` | `getProtocol()`
    `List<AgentAddress>` | `getReceivers()` Return the list of receivers..
    `String` | `getReplyBy()`
    `String` | `getReplyWith()`
    `boolean` | `removeReceiver(AgentAddress r)` Removes a value from `:receiver` slot.
    `boolean` | `removeReplyTo(AgentAddress dest)` Removes a value from `:reply_to` slot.
    `void` | `setContent(String s)`
    `void` | `setConversationID(String s)`
    `void` | `setEncoding(String s)`
    `void` | `setEnvelope(String s)`
    `void` | `setInReplyTo(String s)`
    `void` | `setLanguage(String s)`
    `void` | `setOntology(String s)`
    `void` | `setPerformative(String s)`
    `void` | `setProtocol(String s)`
    `void` | `setReplyBy(Date s)`
    `void` | `setReplyBy(String s)`
    `void` | `setReplyWith(String s)`
    `String` | `toString()`

    - ### Methods inherited from class madkit.message.ActMessage

      `getAction, getContent, getFieldValue, getKeys, getObject, setField, setObject`

    - ### Methods inherited from class madkit.kernel.Message

      `clone, getConversationID, getReceiver, getSender`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ACCEPT_PROPOSAL

          public static final int ACCEPT_PROPOSAL

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### AGREE

          public static final int AGREE

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### CANCEL

          public static final int CANCEL

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### CFP

          public static final int CFP

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### CONFIRM

          public static final int CONFIRM

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### DISCONFIRM

          public static final int DISCONFIRM

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### FAILURE

          public static final int FAILURE

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### INFORM

          public static final int INFORM

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### INFORM_IF

          public static final int INFORM_IF

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### INFORM_REF

          public static final int INFORM_REF

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### NOT_UNDERSTOOD

          public static final int NOT_UNDERSTOOD

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### PROPOSE

          public static final int PROPOSE

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### QUERY_IF

          public static final int QUERY_IF

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### QUERY_REF

          public static final int QUERY_REF

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### REFUSE

          public static final int REFUSE

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### REJECT_PROPOSAL

          public static final int REJECT_PROPOSAL

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### REQUEST

          public static final int REQUEST

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### REQUEST_WHEN

          public static final int REQUEST_WHEN

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### REQUEST_WHENEVER

          public static final int REQUEST_WHENEVER

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### SUBSCRIBE

          public static final int SUBSCRIBE

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### PROXY

          public static final int PROXY

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### PROPAGATE

          public static final int PROPAGATE

      constant identifying the FIPA performative
      See Also:
        Constant Field Values

    - #### UNKNOWN

          public static final int UNKNOWN

      constant identifying an unknown performative
      See Also:
        Constant Field Values

    - #### ACCEPT_PROPOSAL_STRING

          public static final String ACCEPT_PROPOSAL_STRING

      See Also:
        Constant Field Values

    - #### AGREE_STRING

          public static final String AGREE_STRING

      See Also:
        Constant Field Values

    - #### CANCEL_STRING

          public static final String CANCEL_STRING

      See Also:
        Constant Field Values

    - #### CFP_STRING

          public static final String CFP_STRING

      See Also:
        Constant Field Values

    - #### CONFIRM_STRING

          public static final String CONFIRM_STRING

      See Also:
        Constant Field Values

    - #### DISCONFIRM_STRING

          public static final String DISCONFIRM_STRING

      See Also:
        Constant Field Values

    - #### FAILURE_STRING

          public static final String FAILURE_STRING

      See Also:
        Constant Field Values

    - #### INFORM_STRING

          public static final String INFORM_STRING

      See Also:
        Constant Field Values

    - #### INFORM_IF_STRING

          public static final String INFORM_IF_STRING

      See Also:
        Constant Field Values

    - #### INFORM_REF_STRING

          public static final String INFORM_REF_STRING

      See Also:
        Constant Field Values

    - #### NOT_UNDERSTOOD_STRING

          public static final String NOT_UNDERSTOOD_STRING

      See Also:
        Constant Field Values

    - #### PROPOSE_STRING

          public static final String PROPOSE_STRING

      See Also:
        Constant Field Values

    - #### QUERY_IF_STRING

          public static final String QUERY_IF_STRING

      See Also:
        Constant Field Values

    - #### QUERY_REF_STRING

          public static final String QUERY_REF_STRING

      See Also:
        Constant Field Values

    - #### REFUSE_STRING

          public static final String REFUSE_STRING

      See Also:
        Constant Field Values

    - #### REJECT_PROPOSAL_STRING

          public static final String REJECT_PROPOSAL_STRING

      See Also:
        Constant Field Values

    - #### REQUEST_STRING

          public static final String REQUEST_STRING

      See Also:
        Constant Field Values

    - #### REQUEST_WHEN_STRING

          public static final String REQUEST_WHEN_STRING

      See Also:
        Constant Field Values

    - #### REQUEST_WHENEVER_STRING

          public static final String REQUEST_WHENEVER_STRING

      See Also:
        Constant Field Values

    - #### SUBSCRIBE_STRING

          public static final String SUBSCRIBE_STRING

      See Also:
        Constant Field Values

    - #### PROXY_STRING

          public static final String PROXY_STRING

      See Also:
        Constant Field Values

    - #### PROPAGATE_STRING

          public static final String PROPAGATE_STRING

      See Also:
        Constant Field Values

    - #### performatives

          public static final List<String> performatives

  - ### Constructor Detail

    - #### 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 Detail

    - #### 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

Fabien Michel, Olivier Gutknecht, Jacques Ferber - September 27 2016