public class DialogMessage
Version:
$Id: DialogMessage.java,v 1.1 2004/12/19 23:53:46 gonzo Exp $
Author:
james todd [gonzo at jxta dot org]
| Field Summary |
private String |
The command encapsulated by this DialogMessage |
public final static String |
The default group of the originator of this DialogMessage |
public final static String |
The default PeerGroup id of the originator of the DialogMessage |
public final static String |
The default value for the originator of the DialogMessage |
private Map |
|
private String |
The PeerGroup id of the originator of the DialogMessage |
private String |
The group of the originator of this DialogMessage |
|
|
|
|
private String |
The label of this DialogMesage instance |
private String |
The Message encapsulated by this DialogMessage object |
private final static char |
The character to use as a new line character |
private String |
The originator of this DialogMessage |
private Date |
The time this DialogMessage was created |
| Constructor Summary |
public |
Create a new DialogMessage object that encapsulates the
indicated message |
public |
DialogMessage(String originator, String message, String groupId, String groupName) Create a new DialogMessage object with the indicated originator
and message |
public |
|
public |
|
public |
|
public |
Create a new DialogMessage object using all the parameters
set in dm. |
| Method Summary |
public MessageElement |
|
public void |
|
public Object |
Create a copy of this DialogMessage object |
public String |
Get the command encapsulated by this DialogMessage object |
protected static String |
Get the content of the element with the indicated tag int the
Message object msg. |
protected static String |
getElement(Message msg, String tag, String defaultValue) Get the content of the element with the indicated tag int the
Message object msg. |
public String |
Get the PeerGroup Id of the originator of this DialogMessage object |
public String |
Get the PeerGroup name of the originator of this DialogMessage object |
|
|
public String |
Get the label encapsulated by this DialogMessage object |
public String |
Get the message encapsulated by this DialogMessage object |
public MessageElement |
|
public Iterator |
|
public Map |
|
public String |
Get the originator of this DialogMesage object |
public Date |
Get the time at which this DialogMessage object was created |
protected void |
Make sure that all the relevant tags of the DialogMessage
object are set to sensible default values |
public void |
Changes the command encapsulated by this DialogMessage object |
public void |
Changes the PeerGroup Id of the originator of this DialogMessage object |
public void |
Changes the PeerGroup name of the originator of this DialogMessage object |
protected void |
|
public void |
Changes the label encapsulated by this DialogMessage object |
public void |
Changes the message encapsulated by this DialogMessage object |
public void |
Changes the originator of this DialogMessage object |
private void |
Changes the time this DialogMessage was created |
public Message |
|
public String |
Get a string representation of this DialogMessage object |
private String command = null
The command encapsulated by this DialogMessage
public final static String DEFAULT_GROUP = "unknown"
The default group of the originator of this DialogMessage
public final static String DEFAULT_GROUP_ID = "unknown"
The default PeerGroup id of the originator of the DialogMessage
public final static String DEFAULT_ORIGINATOR = "anonymous"
The default value for the originator of the DialogMessage
private Map elements = null
private String groupId = null
The PeerGroup id of the originator of the DialogMessage
private String groupName = null
The group of the originator of this DialogMessage
private String label = null
The label of this DialogMesage instance
private String message = null
The Message encapsulated by this DialogMessage object
private final static char NEW_LINE = '\n'
The character to use as a new line character
private String originator = null
The originator of this DialogMessage
private Date timeStamp = null
The time this DialogMessage was created
public DialogMessage(String message)
Create a new DialogMessage object that encapsulates the
indicated message
Parameters:
message the message of the new DialogMessage object
public DialogMessage(String originator, String message, String groupId, String groupName)
Create a new DialogMessage object with the indicated originator
and message
Parameters:
originator the originator of this DialogMessage object
message the message of the new DialogMessage object
public DialogMessage(String originator, String message, String groupId, String groupName, DialogKeys keys)
public DialogMessage(Message msg)
public DialogMessage(Message msg, DialogKeys keys)
Create a new DialogMessage object using all the parameters
set in dm.
Parameters:
dm the DialogMessage object to clone
public MessageElement addMessageElement(String key, MessageElement me)
public void addMessageElements(Map me)
public Object clone()
Create a copy of this DialogMessage object
Return:
the newly created copy of this DialogMessage object
public String getCommand()
Get the command encapsulated by this DialogMessage object
Return:
the command encapsulated by this DialogMessage object
protected static String getElement(Message msg, String tag, String defaultValue)
Get the content of the element with the indicated tag int the
Message object msg.
Parameters:
msg the Message containing the desired tag
tag the desired tag
defaultValue the value to be returned if the desired
tag was not found
protected static String getElement(Message msg, String tag)
Get the content of the element with the indicated tag int the
Message object msg.
Parameters:
msg the Message containing the desired tag
tag the desired tag
public String getGroupId()
Get the PeerGroup Id of the originator of this DialogMessage object
Return:
the PeerGroup Id of the originator of this DialogMessage object
public String getGroupName()
Get the PeerGroup name of the originator of this DialogMessage object
Return:
the PeerGroup name
public String getLabel()
Get the label encapsulated by this DialogMessage object
Return:
the label encapsulated by this DialogMessage object
public String getMessage()
Get the message encapsulated by this DialogMessage object
Return:
the message encapsulated by this DialogMessage object
public MessageElement getMessageElement(String key)
getMessageElementIterator
public Iterator getMessageElementIterator()
public Map getMessageElements()
public String getOriginator()
Get the originator of this DialogMesage object
Return:
the originator of this DialogMesage object
public Date getTimeStamp()
Get the time at which this DialogMessage object was created
Return:
the timestamp of this DialogMessage object
Make sure that all the relevant tags of the DialogMessage
object are set to sensible default values
Parameters:
dm the DialogMessage which to check for sensible default
values
public void setCommand(String command)
Changes the command encapsulated by this DialogMessage object
Parameters:
command the new command encapsulated by this DialogMessage object
public void setGroupId(String groupId)
Changes the PeerGroup Id of the originator of this DialogMessage object
Parameters:
groupId the new PeerGroup Id
public void setGroupName(String groupName)
Changes the PeerGroup name of the originator of this DialogMessage object
Parameters:
groupName the new PeerGroup name
public void setLabel(String label)
Changes the label encapsulated by this DialogMessage object
Parameters:
label the new label encapsulated by this DialogMessage object
public void setMessage(String msg)
Changes the message encapsulated by this DialogMessage object
Parameters:
message the new message
Return:
the new message of this DialogMessage object
public void setOriginator(String originator)
Changes the originator of this DialogMessage object
Parameters:
originator the originator of this DialogMessage object
private void setTimeStamp(Date timeStamp)
Changes the time this DialogMessage was created
Parameters:
timeStamp the new timestamp of this DialogMessage object
public String toString()
Get a string representation of this DialogMessage object
Return:
a string representation of this DialogMessage object