org.omus.data
Class Message

java.lang.Object
  |
  +--org.omus.data.Message
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

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

A message that can be sent to Flash clients or to other users and groups on the server. It corresponds to the client side Message object. The attachment is a DataRow which will be converted to a generic ActionScript object in the client and thus can carry any of the ActionScript datatypes that correspond to one of the server side DataField objects.

See Also:
Serialized Form

Constructor Summary
Message(java.lang.String subj)
          Creates a new message with the specified subject.
Message(java.lang.String subj, User snd)
          Creates a new message with the specified subject and the specified user set as the sender.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this message containing a deep copy of its attachment.
 DataRow getAttachment()
          Returns the attachment of this message.
 java.lang.String getSender()
          Returns the name of the sender.
 java.lang.String getSubject()
          Returns the subject of this message.
 Command getUndeliveredCommand()
          Returns the command that gets executed if the message can not be delivered to the recipient or null if none has been specified yet.
 void setUndeliveredCommand(Command com)
          Sets the command that gets executed if the message can not be delivered to the recipient.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message(java.lang.String subj)
Creates a new message with the specified subject.

Message

public Message(java.lang.String subj,
               User snd)
Creates a new message with the specified subject and the specified user set as the sender.
Method Detail

getSender

public java.lang.String getSender()
Returns the name of the sender.

getSubject

public java.lang.String getSubject()
Returns the subject of this message.

getAttachment

public DataRow getAttachment()
Returns the attachment of this message. Initially it is an empty DataRow, but you can put any DataField into it and all the values will be converted to their corresponding ActionScript datatypes, if you send the message to a client.

setUndeliveredCommand

public void setUndeliveredCommand(Command com)
Sets the command that gets executed if the message can not be delivered to the recipient. This is intended for messages that have a target on the server side. Note that the Command must be serializable if the Oregano Server runs on more than one machine.

getUndeliveredCommand

public Command getUndeliveredCommand()
Returns the command that gets executed if the message can not be delivered to the recipient or null if none has been specified yet.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of this message containing a deep copy of its attachment.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object