madkit.message

## Class ACLMessage

- java.lang.Object
- - madkit.kernel.Message
  - - madkit.message.ActMessage
    - - madkit.message.ACLMessage

- All Implemented Interfaces:
    java.io.Serializable, java.lang.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 java.lang.String` | `ACCEPT_PROPOSAL_STRING`
    `static int` | `AGREE` constant identifying the FIPA performative
    `static java.lang.String` | `AGREE_STRING`
    `static int` | `CANCEL` constant identifying the FIPA performative
    `static java.lang.String` | `CANCEL_STRING`
    `static int` | `CFP` constant identifying the FIPA performative
    `static java.lang.String` | `CFP_STRING`
    `static int` | `CONFIRM` constant identifying the FIPA performative
    `static java.lang.String` | `CONFIRM_STRING`
    `static int` | `DISCONFIRM` constant identifying the FIPA performative
    `static java.lang.String` | `DISCONFIRM_STRING`
    `static int` | `FAILURE` constant identifying the FIPA performative
    `static java.lang.String` | `FAILURE_STRING`
    `static int` | `INFORM` constant identifying the FIPA performative
    `static int` | `INFORM_IF` constant identifying the FIPA performative
    `static java.lang.String` | `INFORM_IF_STRING`
    `static int` | `INFORM_REF` constant identifying the FIPA performative
    `static java.lang.String` | `INFORM_REF_STRING`
    `static java.lang.String` | `INFORM_STRING`
    `static int` | `NOT_UNDERSTOOD` constant identifying the FIPA performative
    `static java.lang.String` | `NOT_UNDERSTOOD_STRING`
    `static java.util.List<java.lang.String>` | `performatives`
    `static int` | `PROPAGATE` constant identifying the FIPA performative
    `static java.lang.String` | `PROPAGATE_STRING`
    `static int` | `PROPOSE` constant identifying the FIPA performative
    `static java.lang.String` | `PROPOSE_STRING`
    `static int` | `PROXY` constant identifying the FIPA performative
    `static java.lang.String` | `PROXY_STRING`
    `static int` | `QUERY_IF` constant identifying the FIPA performative
    `static java.lang.String` | `QUERY_IF_STRING`
    `static int` | `QUERY_REF` constant identifying the FIPA performative
    `static java.lang.String` | `QUERY_REF_STRING`
    `static int` | `REFUSE` constant identifying the FIPA performative
    `static java.lang.String` | `REFUSE_STRING`
    `static int` | `REJECT_PROPOSAL` constant identifying the FIPA performative
    `static java.lang.String` | `REJECT_PROPOSAL_STRING`
    `static int` | `REQUEST` constant identifying the FIPA performative
    `static java.lang.String` | `REQUEST_STRING`
    `static int` | `REQUEST_WHEN` constant identifying the FIPA performative
    `static java.lang.String` | `REQUEST_WHEN_STRING`
    `static int` | `REQUEST_WHENEVER` constant identifying the FIPA performative
    `static java.lang.String` | `REQUEST_WHENEVER_STRING`
    `static int` | `SUBSCRIBE` constant identifying the FIPA performative
    `static java.lang.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, java.lang.String cont)`
    `ACLMessage(java.lang.String actType)` Constructor for ACLMessage class
    `ACLMessage(java.lang.String actType, java.lang.String cont)` Constructor for ACLMessage class

  - ### Method Summary

    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.
    `java.lang.String` | `getAct()`
    `java.lang.String` | `getConversationIDentifier()`
    `java.lang.String` | `getEncoding()`
    `java.lang.String` | `getEnvelope()`
    `java.lang.String` | `getInReplyTo()`
    `java.lang.String` | `getLanguage()`
    `java.lang.String` | `getOntology()`
    `java.lang.String` | `getPerformative()`
    `java.lang.String` | `getProtocol()`
    `java.util.List<AgentAddress>` | `getReceivers()` Return the list of receivers..
    `java.lang.String` | `getReplyBy()`
    `java.lang.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(java.lang.String s)`
    `void` | `setConversationID(java.lang.String s)`
    `void` | `setEncoding(java.lang.String s)`
    `void` | `setEnvelope(java.lang.String s)`
    `void` | `setInReplyTo(java.lang.String s)`
    `void` | `setLanguage(java.lang.String s)`
    `void` | `setOntology(java.lang.String s)`
    `void` | `setPerformative(java.lang.String s)`
    `void` | `setProtocol(java.lang.String s)`
    `void` | `setReplyBy(java.util.Date s)`
    `void` | `setReplyBy(java.lang.String s)`
    `void` | `setReplyWith(java.lang.String s)`
    `java.lang.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 java.lang.String ACCEPT_PROPOSAL_STRING

      See Also:
        Constant Field Values

    - #### AGREE_STRING

          public static final java.lang.String AGREE_STRING

      See Also:
        Constant Field Values

    - #### CANCEL_STRING

          public static final java.lang.String CANCEL_STRING

      See Also:
        Constant Field Values

    - #### CFP_STRING

          public static final java.lang.String CFP_STRING

      See Also:
        Constant Field Values

    - #### CONFIRM_STRING

          public static final java.lang.String CONFIRM_STRING

      See Also:
        Constant Field Values

    - #### DISCONFIRM_STRING

          public static final java.lang.String DISCONFIRM_STRING

      See Also:
        Constant Field Values

    - #### FAILURE_STRING

          public static final java.lang.String FAILURE_STRING

      See Also:
        Constant Field Values

    - #### INFORM_STRING

          public static final java.lang.String INFORM_STRING

      See Also:
        Constant Field Values

    - #### INFORM_IF_STRING

          public static final java.lang.String INFORM_IF_STRING

      See Also:
        Constant Field Values

    - #### INFORM_REF_STRING

          public static final java.lang.String INFORM_REF_STRING

      See Also:
        Constant Field Values

    - #### NOT_UNDERSTOOD_STRING

          public static final java.lang.String NOT_UNDERSTOOD_STRING

      See Also:
        Constant Field Values

    - #### PROPOSE_STRING

          public static final java.lang.String PROPOSE_STRING

      See Also:
        Constant Field Values

    - #### QUERY_IF_STRING

          public static final java.lang.String QUERY_IF_STRING

      See Also:
        Constant Field Values

    - #### QUERY_REF_STRING

          public static final java.lang.String QUERY_REF_STRING

      See Also:
        Constant Field Values

    - #### REFUSE_STRING

          public static final java.lang.String REFUSE_STRING

      See Also:
        Constant Field Values

    - #### REJECT_PROPOSAL_STRING

          public static final java.lang.String REJECT_PROPOSAL_STRING

      See Also:
        Constant Field Values

    - #### REQUEST_STRING

          public static final java.lang.String REQUEST_STRING

      See Also:
        Constant Field Values

    - #### REQUEST_WHEN_STRING

          public static final java.lang.String REQUEST_WHEN_STRING

      See Also:
        Constant Field Values

    - #### REQUEST_WHENEVER_STRING

          public static final java.lang.String REQUEST_WHENEVER_STRING

      See Also:
        Constant Field Values

    - #### SUBSCRIBE_STRING

          public static final java.lang.String SUBSCRIBE_STRING

      See Also:
        Constant Field Values

    - #### PROXY_STRING

          public static final java.lang.String PROXY_STRING

      See Also:
        Constant Field Values

    - #### PROPAGATE_STRING

          public static final java.lang.String PROPAGATE_STRING

      See Also:
        Constant Field Values

    - #### performatives

          public static final java.util.List<java.lang.String> performatives

  - ### Constructor Detail

    - #### ACLMessage

          public ACLMessage()

      Default constructor for ACLMessage class

    - #### ACLMessage

          public ACLMessage(java.lang.String actType)

      Constructor for ACLMessage class

    - #### ACLMessage

          public ACLMessage(java.lang.String actType,
                    java.lang.String cont)

      Constructor for ACLMessage class

    - #### ACLMessage

          public ACLMessage(int perf,
                    java.lang.String cont)

  - ### Method Detail

    - #### getAct

          public java.lang.String getAct()

    - #### setContent

          public void setContent(java.lang.String s)

      Overrides:
        `setContent` in class `ActMessage`

    - #### getPerformative

          public java.lang.String getPerformative()

    - #### setPerformative

          public void setPerformative(java.lang.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 java.util.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 java.lang.String getEnvelope()

    - #### setEnvelope

          public void setEnvelope(java.lang.String s)

    - #### getConversationIDentifier

          public java.lang.String getConversationIDentifier()

    - #### setConversationID

          public void setConversationID(java.lang.String s)

    - #### getProtocol

          public java.lang.String getProtocol()

    - #### setProtocol

          public void setProtocol(java.lang.String s)

    - #### getReplyWith

          public java.lang.String getReplyWith()

    - #### setReplyWith

          public void setReplyWith(java.lang.String s)

    - #### getReplyBy

          public java.lang.String getReplyBy()

    - #### setReplyBy

          public void setReplyBy(java.lang.String s)

    - #### setReplyBy

          public void setReplyBy(java.util.Date s)

    - #### getInReplyTo

          public java.lang.String getInReplyTo()

      Overrides:
        `getInReplyTo` in class `ActMessage`

    - #### setInReplyTo

          public void setInReplyTo(java.lang.String s)

      Overrides:
        `setInReplyTo` in class `ActMessage`

    - #### getLanguage

          public java.lang.String getLanguage()

    - #### setLanguage

          public void setLanguage(java.lang.String s)

    - #### getEncoding

          public java.lang.String getEncoding()

    - #### setEncoding

          public void setEncoding(java.lang.String s)

    - #### getOntology

          public java.lang.String getOntology()

    - #### setOntology

          public void setOntology(java.lang.String s)

    - #### toString

          public java.lang.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 - November 18 2014