com.reticular.agentBuilder.agent.perception
Class KqmlMessage

java.lang.Object
  |
  +--com.reticular.agentBuilder.agent.perception.KqmlMessage
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

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

Description : This class encapsulates all of the information that is necessary for kqml style communication. This is the object passed to the perception system for sending to remote agents. The agent constructs KqmlMessage objects and then can pass them into the perception object for sending.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object _content
          A reference to the content.
protected  java.lang.Class _contentType
          The java.lang.Class object representing the content object class.
protected  java.lang.String _contentTypeName
          The fully qualified name of the the content type.
protected  java.lang.String _from
          When forwarding is used the from and to fields contain the important source and destination information.
protected  java.lang.String _inReplyTo
          The string that is used in conjunction with the replyWith parameter.
protected  java.lang.String _language
          The language field.
protected  java.lang.String _ontology
          The ontology field.
protected  java.lang.String _performative
          The performative.
protected  java.lang.String _protocol
          The protocol being used with this message.
protected  java.lang.String _receiver
          The agent name for the message receiver.
protected  java.lang.String _replyWith
          The string that needs to be used in the reply.
protected  java.lang.String _sender
          The agent name for the message sender.
protected  java.lang.String _senderURL
          The agent URL for the sending agent.
protected  java.lang.String _sentTime
          The time at which the message was sent.
protected  java.lang.String _to
           
 
Constructor Summary
KqmlMessage()
          Description : The constructor for a message.
 
Method Summary
 java.lang.Object clone()
          Description : Calls the super.clone() from lang.obj and catches the exceptions.
 boolean equals(java.lang.Object obj)
          Description : Compares the current KqmlMessage object with the passed in argument on a field by field basis.
 java.lang.Object getContent()
          Description : Return the content of the kqml message.
 java.lang.Class getContentType()
          Description : Returns the class (a java.lang.Class object) of the content object.
 java.lang.String getContentTypeName()
          Description : Returns the name of the content type.
 java.lang.String getFrom()
          Description : Returns the "from" kqml field of a message.
 java.lang.String getInReplyTo()
          Description : Gets the in-reply-to parameter
 java.lang.String getLanguage()
          Description : Returns the language.
 java.lang.String getOntology()
          Description : Returns the ontology.
 java.lang.String getPerformative()
          Description : Returns the current performative.
 java.lang.String getProtocol()
          Description : Returns the protocl.
 java.lang.String getReceiver()
          Description : The method to return the sender agent's name.
 java.lang.String getReceiverName()
          Deprecated. Use getReceiver
 java.lang.String getReplyWith()
          Description : gets the replyWith parameter
 java.lang.String getSender()
          Description : The method to return the sender agent's name.
 java.lang.String getSenderName()
          Deprecated. User getSender
 boolean getSendError()
          Returns the send error flag.
 java.lang.String getSenderURL()
          Description : Return the content of the kqml message.
 java.lang.String getSentTime()
          Description : Returns the sentTime.
 java.lang.String getTo()
          Description : Returns the "to" kqml field of a message.
 void setContent(java.lang.Object newContent)
          Description : Sets the content field.
 void setContentType(java.lang.Class newContentType)
          Sets the class (a java.lang.Class object) of the content object.
 void setContentTypeName(java.lang.String newContentType)
          Description :
 void setFrom(java.lang.String from)
          Description : Sets the "from" kqml fiedl of a message.
 void setInReplyTo(java.lang.String inReplyTo)
          Description : Sets the inReplyTo parameter.
 void setLanguage(java.lang.String language)
          Description : Sets the language field.
 void setOntology(java.lang.String ontology)
          Description : Sets the ontology field.
 void setPerformative(java.lang.String perf)
          Description : Set the performative to whichever performative is required.
 void setProtocol(java.lang.String protocol)
          Description : Sets the protocol field.
 void setReceiver(java.lang.String name)
          Description : The method to set the sender agent's name.
 void setReceiverName(java.lang.String name)
          Deprecated. Use setReceiver
 void setReplyWith(java.lang.String replyWith)
          Description : Sets the reply-with parameter.
 void setSender(java.lang.String name)
          Description : The method to set the sender agent's name.
 void setSenderName(java.lang.String name)
          Deprecated. User setSender
 void setSendError(boolean error)
          Sets the sendError flag when this message is undelivered.
 void setSenderURL(java.lang.String URL)
          Description : The method to set the sender's URL.
 void setSentTime(java.lang.String sentTime)
          Description : Sets the sentTime field.
 void setTo(java.lang.String to)
          Description : Sets the "to" kqml fiedl of a message.
 java.lang.String toString()
          Description : Return a string representation of this KQML message.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_performative

protected java.lang.String _performative
The performative.

_sender

protected java.lang.String _sender
The agent name for the message sender.

_senderURL

protected java.lang.String _senderURL
The agent URL for the sending agent. Format= protocol:IPAddress:1299 Example for rmi would be rmi:harding.reticular.com:1299

_receiver

protected java.lang.String _receiver
The agent name for the message receiver.

_from

protected java.lang.String _from
When forwarding is used the from and to fields contain the important source and destination information.

_to

protected java.lang.String _to

_replyWith

protected java.lang.String _replyWith
The string that needs to be used in the reply.

_inReplyTo

protected java.lang.String _inReplyTo
The string that is used in conjunction with the replyWith parameter.

_sentTime

protected java.lang.String _sentTime
The time at which the message was sent.

_language

protected java.lang.String _language
The language field.

_ontology

protected java.lang.String _ontology
The ontology field.

_protocol

protected java.lang.String _protocol
The protocol being used with this message.

_content

protected java.lang.Object _content
A reference to the content. This could be a string object or any other type of object which needs to be communicated.

_contentType

protected java.lang.Class _contentType
The java.lang.Class object representing the content object class.

_contentTypeName

protected java.lang.String _contentTypeName
The fully qualified name of the the content type. This variable is not used by the runtime system, its for use in the protocol building and automatic rule generation from the protocols. So if the contentType was File, then this string would be java.lang.File
Constructor Detail

KqmlMessage

public KqmlMessage()
Description : The constructor for a message. Currently it is empty but it could be extended to do intialization work.
Parameters:
-  
Throws:
-  
Method Detail

clone

public java.lang.Object clone()
Description : Calls the super.clone() from lang.obj and catches the exceptions. It looks like all objects that are going to be included in kqml objects will need to implement this. ??? This may be undefined behavior that will have to be addressed later.
Overrides:
clone in class java.lang.Object
Parameters:
-  
Returns:
KqmlMessage
Throws:
-  

equals

public boolean equals(java.lang.Object obj)
Description : Compares the current KqmlMessage object with the passed in argument on a field by field basis.
Overrides:
equals in class java.lang.Object
Parameters:
Object - - The object to compare for semantic equality.
Returns:
boolean

setContent

public void setContent(java.lang.Object newContent)
Description : Sets the content field.
Parameters:
newContent - - The content to be put in the object.
Returns:
void
Throws:
-  

getContent

public java.lang.Object getContent()
Description : Return the content of the kqml message. (Object)
Parameters:
-  
Returns:
Object - The value of the content field.
Throws:
-  

setContentTypeName

public void setContentTypeName(java.lang.String newContentType)
Description :
Parameters:
newContentType - - A class name of the content.
Returns:
void

getContentTypeName

public java.lang.String getContentTypeName()
Description : Returns the name of the content type. It should be fully qualified.
Returns:
String

getContentType

public java.lang.Class getContentType()
Description : Returns the class (a java.lang.Class object) of the content object.
Returns:
Class

setContentType

public void setContentType(java.lang.Class newContentType)
Sets the class (a java.lang.Class object) of the content object. This method will be invoked automatically from setContent so the user will not need to explicitly set the content type unless they are not setting the content but only the type.
Parameters:
newContentType - - a java.lang.Class object representing the class of the new content object.
Returns:
void
Throws:
-  

getSenderURL

public java.lang.String getSenderURL()
Description : Return the content of the kqml message. (String)
Parameters:
-  
Returns:
String - The value of the senderURL field.
Throws:
-  

setSenderURL

public void setSenderURL(java.lang.String URL)
Description : The method to set the sender's URL.
Parameters:
name - - Agent name of sender.
Returns:
void
Throws:
-  

getSenderName

public java.lang.String getSenderName()
Deprecated. User getSender

Description : The method to return the sender agent's name.
Parameters:
-  
Returns:
String - Agent name.
Throws:
-  

setSenderName

public void setSenderName(java.lang.String name)
Deprecated. User setSender

Description : The method to set the sender agent's name.
Parameters:
name - - Agent name of sender.
Returns:
void
Throws:
-  

getSender

public java.lang.String getSender()
Description : The method to return the sender agent's name.
Parameters:
-  
Returns:
String - Agent name.
Throws:
-  

setSender

public void setSender(java.lang.String name)
Description : The method to set the sender agent's name.
Parameters:
name - - Agent name of sender.
Returns:
void
Throws:
-  

setReceiverName

public void setReceiverName(java.lang.String name)
Deprecated. Use setReceiver

Description : The method to set the sender agent's name.
Parameters:
name - - Agent name of message receiver.
Returns:
void
Throws:
-  

getReceiverName

public java.lang.String getReceiverName()
Deprecated. Use getReceiver

Description : The method to return the sender agent's name.
Parameters:
-  
Returns:
String - Receiver agent's name.
Throws:
-  

setReceiver

public void setReceiver(java.lang.String name)
Description : The method to set the sender agent's name.
Parameters:
name - - Agent name of message receiver.
Returns:
void
Throws:
-  

getReceiver

public java.lang.String getReceiver()
Description : The method to return the sender agent's name.
Parameters:
-  
Returns:
String - Receiver agent's name.
Throws:
-  

setPerformative

public void setPerformative(java.lang.String perf)
Description : Set the performative to whichever performative is required. Currently no check is being done to make sure it is valid. This should be done in the future.
Parameters:
perf - = New performative.
Returns:
void
Throws:
-  

getPerformative

public java.lang.String getPerformative()
Description : Returns the current performative. Null if never set.
Parameters:
-  
Returns:
String - The performative (null if not set).
Throws:
-  

getOntology

public java.lang.String getOntology()
Description : Returns the ontology.
Returns:
String The ontology (null if not set).
Throws:
-  

setOntology

public void setOntology(java.lang.String ontology)
Description : Sets the ontology field.
Parameters:
String - - The new ontology.
Returns:
void
Throws:
-  

getLanguage

public java.lang.String getLanguage()
Description : Returns the language.
Returns:
String The language (null if not set).
Throws:
-  

setLanguage

public void setLanguage(java.lang.String language)
Description : Sets the language field.
Parameters:
String - - The new language.
Returns:
void
Throws:
-  

getProtocol

public java.lang.String getProtocol()
Description : Returns the protocl.
Returns:
String The protocol (null if not set).
Throws:
-  

setProtocol

public void setProtocol(java.lang.String protocol)
Description : Sets the protocol field.
Parameters:
String - - The new protocol.
Returns:
void
Throws:
-  

getSentTime

public java.lang.String getSentTime()
Description : Returns the sentTime.
Returns:
String The sentTime (null if not set).
Throws:
-  

setSentTime

public void setSentTime(java.lang.String sentTime)
Description : Sets the sentTime field.
Parameters:
String - - The new sentTime.
Returns:
void
Throws:
-  

getReplyWith

public java.lang.String getReplyWith()
Description : gets the replyWith parameter
Returns:
String The replyWith token.
Throws:
-  

setReplyWith

public void setReplyWith(java.lang.String replyWith)
Description : Sets the reply-with parameter.
Parameters:
String - - The new replyWith token.
Returns:
void
Throws:
-  

getInReplyTo

public java.lang.String getInReplyTo()
Description : Gets the in-reply-to parameter
Returns:
String The inReplyTo token.
Throws:
-  

setInReplyTo

public void setInReplyTo(java.lang.String inReplyTo)
Description : Sets the inReplyTo parameter.
Parameters:
String - - The new inReplyTo token.
Returns:
void
Throws:
-  

getTo

public java.lang.String getTo()
Description : Returns the "to" kqml field of a message.
Parameters:
-  
Returns:
String
Throws:
-  

setTo

public void setTo(java.lang.String to)
Description : Sets the "to" kqml fiedl of a message.
Parameters:
String - - The new "to" value.
Returns:
void
Throws:
-  

getFrom

public java.lang.String getFrom()
Description : Returns the "from" kqml field of a message.
Parameters:
-  
Returns:
String
Throws:
-  

setSendError

public void setSendError(boolean error)
Sets the sendError flag when this message is undelivered.
Parameters:
boolean -  
Returns:
void

getSendError

public boolean getSendError()
Returns the send error flag.
Returns:
boolean

setFrom

public void setFrom(java.lang.String from)
Description : Sets the "from" kqml fiedl of a message.
Parameters:
String - - The new "from" value.
Returns:
void
Throws:
-  

toString

public java.lang.String toString()
Description : Return a string representation of this KQML message.
Overrides:
toString in class java.lang.Object
Returns:
String
Throws:
-