All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.mitre.cvw.mcp.Message

java.lang.Object
   |
   +----java.util.Dictionary
           |
           +----java.util.Hashtable
                   |
                   +----org.mitre.cvw.mcp.Message

public class Message
extends Hashtable
The MOO Client Protocol Message object.

A MOO Client Protocol message has a name, an optional authorization, and a collection of key-value pairs. The value associated with a key is a string or an array of strings.

Names and keys are identifiers. An identifier is made of a letter or underscore followed by any number of letters, underscores, digits, or minus signs.

Message names and keywords are case-insensitive.


Constructor Index

 o Message(String, String)
Constructs a MOO Client Protocol message object without any arguments.

Method Index

 o display(PrintWriter)
Prints an MCP message on a print writer stream.
 o getArray(String)
Get a string array value associated with the key.
 o getAuth()
Get the authorization key The authorization key has been interned.
 o getName()
Get the name of the message.
 o getString(String)
Get a string value associated with the key.
 o isIdentifier(String)
Is the string an identifier?
 o isUnquotedString(String)
Does the string not require quoting?
 o makeMessage(String)
Create an MCP message with the authorization copied from this object.
 o put(String, Object)
Associates a value with a key.
 o toString()
Returns a string representation of the object.

Constructors

 o Message
 public Message(String name,
                String auth)
Constructs a MOO Client Protocol message object without any arguments.

Parameters:
name - the name of the message
auth - the authorization key

Methods

 o getName
 public String getName()
Get the name of the message. The name has been interned.

 o getAuth
 public String getAuth()
Get the authorization key The authorization key has been interned.

 o getString
 public String getString(String key)
Get a string value associated with the key. If the value associated with the key is not a string, null is return.

Parameters:
key - a symbol without the trailing colon character.
Returns:
the value for the key or null if the key is not associated with a string in the MCP message.
 o getArray
 public String[] getArray(String key)
Get a string array value associated with the key. If the value associated with the key is not a string array, null is return.

Parameters:
key - a symbol without the trailing colon character.
Returns:
the value for the key or null if the key is not associated with a string array in the MCP message.
 o put
 public Object put(String key,
                   Object value)
Associates a value with a key.

Parameters:
key - the specified key in the MCP message
value - associated with the key
Returns:
the old value of the key, or null if it did not have one.
 o makeMessage
 public Message makeMessage(String name)
Create an MCP message with the authorization copied from this object.

Parameters:
name - the name of the request.
 o display
 public void display(PrintWriter pw)
Prints an MCP message on a print writer stream. Complete lines are assemble and then supplied to the print writer. As a result, other threads can write text lines or MCP messages with multiline values to a shared print writer.

Parameters:
pw - the print writer for output.
 o toString
 public String toString()
Returns a string representation of the object.

Returns:
this message as a string.
Overrides:
toString in class Hashtable
 o isIdentifier
 public static boolean isIdentifier(String s)
Is the string an identifier?

Parameters:
s - the string
Returns:
true if string is an identifier
 o isUnquotedString
 public static boolean isUnquotedString(String s)
Does the string not require quoting?

Parameters:
s - the string
Returns:
true if string is a string that does not require quoting

All Packages  Class Hierarchy  This Package  Previous  Next  Index