aktbus.kqml
Class KqmlMessage

aktbus.core.AktMessage
  |
  +--aktbus.kqml.KqmlMessage

public class KqmlMessage
extends AktMessage

Representing a KQML message as a subclass of AktMessage. According to Soton's encoding.


Fields inherited from class aktbus.core.AktMessage
name_space
 
Constructor Summary
KqmlMessage(java.lang.String body)
          Construct a KqmlMessage by parsing a String.
KqmlMessage(java.lang.String performative, java.util.Collection params)
          Create a KqmlMessage from a java.util.Collection of KqmlParam.
KqmlMessage(java.lang.String performative, KqmlParam[] params)
          Construct a KqmlMessage from a performative (in a String) and an array of KqmlParam.
KqmlMessage(java.lang.String performative, java.util.Map params)
          Create a KqmlMessage from a java.util.Map of KqmlParam.
 
Method Summary
 java.util.Map get_parameter_map()
          Returns the set of KQML parameters as a java.util.Map of KqmlParam.
 java.util.Collection get_parameter_set()
          Return the set of KQML parameters as a java.util.Collection of KqmlParam.
 java.lang.String get_performative()
          Get the performative of a KqmlMessage.
protected  void initialise_namespace()
          Initialise name space Map, overridding the one in AktMessage.
 
Methods inherited from class aktbus.core.AktMessage
createDOM, find_element_node, find_element_node, get_element_node_text, get_element_node_text, get_first_child_node, get_first_child_node, get_next_sibling_node, get_next_sibling_node, get_receiver, get_sender, get_simple_message, get_subtree_text, get_subtree_text, print_node_type, print_tree_type, send_and_receive, send_and_receive, send, send, send, ugly_write, ugly_write, ugly_write, ugly_write, ugly_write, ugly_write, ugly_write, ugly_write
 

Constructor Detail

KqmlMessage

public KqmlMessage(java.lang.String body)
            throws org.xml.sax.SAXException,
                   java.lang.Exception
Construct a KqmlMessage by parsing a String.
Parameters:
body - The String to be parsed.
Throws:
org.xml.sax.SAXException - When a parsing error occurs.
java.lang.Exception - Other general errors.

KqmlMessage

public KqmlMessage(java.lang.String performative,
                   KqmlParam[] params)
            throws java.net.MalformedURLException,
                   java.lang.Exception
Construct a KqmlMessage from a performative (in a String) and an array of KqmlParam.
Parameters:
performative - The KQML performative in a String.
param - The KQML parameters in an array of KqmlParam.
Throws:
java.net.MalformedURLException - If sender/receiver URL is not valid.
java.lang.Exception - Other general errors.

KqmlMessage

public KqmlMessage(java.lang.String performative,
                   java.util.Map params)
            throws java.net.MalformedURLException,
                   java.lang.Exception
Create a KqmlMessage from a java.util.Map of KqmlParam.
Parameters:
performative - The KQML performative in a String.
params - A java.util.Map of KqmlParam.
Throws:
java.net.MalformedURLException - If either sender/receiver URI is not valid.
java.lang.Exception - When other errors occur.

KqmlMessage

public KqmlMessage(java.lang.String performative,
                   java.util.Collection params)
            throws java.net.MalformedURLException,
                   java.lang.Exception
Create a KqmlMessage from a java.util.Collection of KqmlParam.
Parameters:
performative - The KQML performative in a String.
param - A java.util.Collection of KqmlParam.
Throws:
java.net.MalformedURLException - When the sender/receiver URL string is not a valid HTTP URL.
java.lang.Exception - When other general errors occur.
Method Detail

get_performative

public java.lang.String get_performative()
Get the performative of a KqmlMessage.
Returns:
The performative in a String.

get_parameter_map

public java.util.Map get_parameter_map()
Returns the set of KQML parameters as a java.util.Map of KqmlParam. The returned java.util.Map allows the retrieval of KqmlParam (value) by specifying the parameter name (i.e. key). e.g. content. If you want to iterate through all KQML parameters, use the get_parameter_set() method instead.

get_parameter_set

public java.util.Collection get_parameter_set()
Return the set of KQML parameters as a java.util.Collection of KqmlParam. If you want to get a particular KQML parameter by specifying the KQML parameter name, use the get_parameter_map() method instead.

initialise_namespace

protected void initialise_namespace()
Initialise name space Map, overridding the one in AktMessage.
Overrides:
initialise_namespace in class AktMessage