fipaos.ont.fipa
Class ACL

java.lang.Object
  |
  +--fipaos.ont.fipa.ACL
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ACLMessage

public class ACL
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

This class provides the representation of an ACL communication within an Agent.

Implements XC00061D & XC00070F (except for support for ":encoding" field)

See Also:
Serialized Form

Field Summary
static int BYTELENGTH_ENCODING
           
static java.lang.String FIPA_OS_SERIALIZATION
          ACL Encoding using Java Serialisation
static java.lang.String FIPA00069
          ACL Encoding name as defined in FIPA00069
static java.lang.String FIPA00070
          ACL Encoding name as defined in FIPA00070
static java.lang.String FIPA00071
          ACL Encoding name as defined in FIPA00071
static int STRINGLITERAL_ENCODING
          Content encoding constants - see FIPA ACL spec.
 
Constructor Summary
ACL()
          Creates an empty ACL communication
ACL(ACL acl)
          Deprecated. Please use clone() instead
ACL(java.lang.String msg)
          Creates an ACL object from the given ACL string
 
Method Summary
 void addReceiverAID(AgentID aid)
           
 void addReplyToAID(AgentID aid)
           
static java.lang.String byteLengthDecode(java.lang.String in)
          Decodes the given String from a ByteLengthEncodedString format (see FIPA ACL definiton)
static java.lang.String byteLengthEncode(java.lang.String in)
          Encodes the given String into a ByteLengthEncodedString format (see FIPA ACL definiton)
 java.lang.Object clone()
           
 java.lang.String getContentEncoding()
           
 java.lang.Object getContentObject()
           
 java.lang.String getConversationID()
           
 java.lang.String getInReplyTo()
           
 java.lang.String getLanguage()
           
 java.lang.String getOntology()
           
 java.lang.String getPerformative()
           
 java.lang.String getProtocol()
           
 AgentID getReceiverAID()
          Get just the first AID of the receivers field, if present
 java.util.List getReceiverAIDs()
           
 UTCContainer getReplyByUTC()
           
 java.util.List getReplyToAIDs()
           
 java.lang.String getReplyWith()
           
 AgentID getSenderAID()
           
 void setContentEncoding(java.lang.String encoding)
           
 void setContentObject(java.lang.Object content)
           
 void setContentObject(java.lang.Object content, int encode)
          Sets the content, optionally encoding the content as the specified type (see FIPA specification), if it is Stringified
 void setContentObjectACLParser(java.lang.String s)
          Method to be invoked by the ACLParser to set the content - causes outer brakets to be stripped from SL
 void setConversationID(java.lang.String conv_id)
           
 void setInReplyTo(java.lang.String in_reply_to)
           
 void setLanguage(java.lang.String lang)
           
 void setOntology(java.lang.String ont)
           
 void setPerformative(java.lang.String perf)
           
 void setProtocol(java.lang.String protocol)
           
 void setReceiverAID(AgentID aid)
           
 void setReceiverAIDs(java.util.List aids)
           
 void setReplyByUTC(UTCContainer utc)
           
 void setReplyToAIDs(java.util.List aids)
           
 void setReplyWith(java.lang.String reply_with)
           
 void setSenderAID(AgentID aid)
           
static java.lang.String stringLiteralDecode(java.lang.String in)
          Decodes the given String from a StringLiteral format (see FIPA ACL definiton)
static java.lang.String stringLiteralEncode(java.lang.String in)
          Encodes the given String into a StringLiteral format (see FIPA ACL definiton)
 java.lang.String toString()
          toString returns a string representation of the message in default ACL encoding
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STRINGLITERAL_ENCODING

public static final int STRINGLITERAL_ENCODING
Content encoding constants - see FIPA ACL spec.

BYTELENGTH_ENCODING

public static final int BYTELENGTH_ENCODING

FIPA00070

public static final java.lang.String FIPA00070
ACL Encoding name as defined in FIPA00070

FIPA00069

public static final java.lang.String FIPA00069
ACL Encoding name as defined in FIPA00069

FIPA00071

public static final java.lang.String FIPA00071
ACL Encoding name as defined in FIPA00071

FIPA_OS_SERIALIZATION

public static final java.lang.String FIPA_OS_SERIALIZATION
ACL Encoding using Java Serialisation
Constructor Detail

ACL

public ACL(ACL acl)
Deprecated. Please use clone() instead

Duplicates the content of the given ACL object


ACL

public ACL(java.lang.String msg)
    throws ParserException
Creates an ACL object from the given ACL string

ACL

public ACL()
Creates an empty ACL communication
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

setSenderAID

public void setSenderAID(AgentID aid)

getSenderAID

public AgentID getSenderAID()

addReceiverAID

public void addReceiverAID(AgentID aid)

setReceiverAID

public void setReceiverAID(AgentID aid)

setReceiverAIDs

public void setReceiverAIDs(java.util.List aids)

getReceiverAID

public AgentID getReceiverAID()
Get just the first AID of the receivers field, if present

getReceiverAIDs

public java.util.List getReceiverAIDs()

addReplyToAID

public void addReplyToAID(AgentID aid)

setReplyToAIDs

public void setReplyToAIDs(java.util.List aids)

getReplyToAIDs

public java.util.List getReplyToAIDs()

setContentObjectACLParser

public void setContentObjectACLParser(java.lang.String s)
Method to be invoked by the ACLParser to set the content - causes outer brakets to be stripped from SL

setContentObject

public void setContentObject(java.lang.Object content)

getContentObject

public java.lang.Object getContentObject()

setContentObject

public void setContentObject(java.lang.Object content,
                             int encode)
Sets the content, optionally encoding the content as the specified type (see FIPA specification), if it is Stringified
Parameters:
content - The content of the message
encode - Indicates the type of encoding to use for the string

setContentEncoding

public void setContentEncoding(java.lang.String encoding)

getContentEncoding

public java.lang.String getContentEncoding()

setConversationID

public void setConversationID(java.lang.String conv_id)

getConversationID

public java.lang.String getConversationID()

setInReplyTo

public void setInReplyTo(java.lang.String in_reply_to)

getInReplyTo

public java.lang.String getInReplyTo()

setLanguage

public void setLanguage(java.lang.String lang)

getLanguage

public java.lang.String getLanguage()

setOntology

public void setOntology(java.lang.String ont)

getOntology

public java.lang.String getOntology()

setPerformative

public void setPerformative(java.lang.String perf)

getPerformative

public java.lang.String getPerformative()

setProtocol

public void setProtocol(java.lang.String protocol)

getProtocol

public java.lang.String getProtocol()

setReplyByUTC

public void setReplyByUTC(UTCContainer utc)

getReplyByUTC

public UTCContainer getReplyByUTC()

setReplyWith

public void setReplyWith(java.lang.String reply_with)

getReplyWith

public java.lang.String getReplyWith()

toString

public java.lang.String toString()
toString returns a string representation of the message in default ACL encoding
Overrides:
toString in class java.lang.Object
Returns:
string

stringLiteralEncode

public static java.lang.String stringLiteralEncode(java.lang.String in)
Encodes the given String into a StringLiteral format (see FIPA ACL definiton)
Parameters:
in - The String to encode
Returns:
The encoded String

stringLiteralDecode

public static java.lang.String stringLiteralDecode(java.lang.String in)
Decodes the given String from a StringLiteral format (see FIPA ACL definiton)
Parameters:
in - The String to decode
Returns:
The decoded String

byteLengthEncode

public static java.lang.String byteLengthEncode(java.lang.String in)
Encodes the given String into a ByteLengthEncodedString format (see FIPA ACL definiton)
Parameters:
in - The String to encode
Returns:
The encoded String

byteLengthDecode

public static java.lang.String byteLengthDecode(java.lang.String in)
Decodes the given String from a ByteLengthEncodedString format (see FIPA ACL definiton)
Parameters:
in - The String to decode
Returns:
The decoded String