com.mischiefbox.dmud.message
Class Message

java.lang.Object
  |
  +--com.mischiefbox.dmud.message.Message

public class Message
extends Object

Message object. Stores a complete message, including the associated originating connection. Acts as a kind of "network event" that is consumed by the message handler, passed to a processor, modified, and passed back to the output queue where is is consumed by the connection handler.

Version:
$Id: Message.java,v 1.1.1.1 2001/06/27 01:33:17 cjones Exp $
Author:
Chris Jones

Field Summary
static String FOOTER
          The header that indicates the end of a message.
static String HEADER
          The header that indicates the start of a message.
protected  String sConnectionId
          Connection id.
protected  String sMessageContent
          Message content.
 
Constructor Summary
Message(String sConnectionId, String sMessageContent)
          Create a new Message object.
 
Method Summary
 byte[] getBytes()
          Get the message's byte representation.
 String getConnectionId()
          Get the Message's associated connection id.
 String getContent()
          Get the Message's content.
 void setConnectionId(String sConnectionId)
          Set the Message's associated connection id.
 void setContent(String sMessageContent)
          Set the Message's content.
 String toString()
          Get the message information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HEADER

public static final String HEADER
The header that indicates the start of a message.

FOOTER

public static final String FOOTER
The header that indicates the end of a message.

sConnectionId

protected String sConnectionId
Connection id. Used to associate messages with the originating connection or destination connection.

sMessageContent

protected String sMessageContent
Message content. The complete message content.
Constructor Detail

Message

public Message(String sConnectionId,
               String sMessageContent)
Create a new Message object. Creates a new Message object. The object will still need to be injected into the message handler input queue or connection handler output queue in order to be consumed.
Parameters:
sConnectionId - the source or destination connection id.
sMessageContent - the content of the message.
Method Detail

getConnectionId

public String getConnectionId()
Get the Message's associated connection id.
Returns:
the associated connection id.

setConnectionId

public void setConnectionId(String sConnectionId)
Set the Message's associated connection id.
Parameters:
sConnectionId - the source or destination connection id.

getContent

public String getContent()
Get the Message's content.
Returns:
the message content.

setContent

public void setContent(String sMessageContent)
Set the Message's content.
Parameters:
sMessageContent - the message content.

getBytes

public byte[] getBytes()
Get the message's byte representation.
Returns:
the message as an array of bytes.

toString

public String toString()
Get the message information.
Overrides:
toString in class Object
Returns:
a representation of the message.


Copyright © 2001 by Christopher R. Jones. All Rights Reserved.