|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.isr.yancees.GenericMessage
public class GenericMessage
Field Summary | |
---|---|
protected java.util.Date |
dateCreated
In order to have the proper comparison between dates, timezone differences must be considered here. |
protected java.util.Date |
dateReceivedInServer
|
protected org.w3c.dom.Node |
messageDOM
|
protected long |
myId
|
protected java.lang.String |
textContent
|
Constructor Summary | |
---|---|
GenericMessage()
|
|
GenericMessage(java.io.File file)
Initializes the message with a file. |
|
GenericMessage(org.w3c.dom.Node n)
|
|
GenericMessage(java.lang.String content)
Initializes the file with the content provided in a String We assume that the String has a XML message able to be parsed |
Method Summary | |
---|---|
protected org.w3c.dom.Document |
convertTextToMessageDOM(java.lang.String text)
Writes the contents of the file in memory to the disk, in a temporary directory, then parses it with a DOM parser, generating a data sturcture in memory. |
java.util.Date |
getDateCreated()
|
java.util.Date |
getDateReceivedInServer()
|
org.w3c.dom.Node |
getDOM()
|
long |
getId()
Messages have unique ids inside an address space. |
java.lang.String |
getXMLTextContent()
|
void |
setDateReceivedInServer(java.util.Date date)
This method is not shown in the MessageInterface and is used internally, by the Yancees APIs to stamp the date received |
void |
setDOM(org.w3c.dom.Node n)
Changes the content of this Message object to the message tree provided. |
void |
setXMLTextContent(java.lang.String content)
Changes the content of this message. |
java.lang.String |
toString()
|
protected java.lang.String |
writeTextToTempFile(java.lang.String text)
Writes the text to a temp file, with a special name and in the global temporary directory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient org.w3c.dom.Node messageDOM
protected java.lang.String textContent
protected java.util.Date dateCreated
protected java.util.Date dateReceivedInServer
protected long myId
Constructor Detail |
---|
public GenericMessage(org.w3c.dom.Node n) throws MessageParsingException
MessageParsingException
public GenericMessage()
public GenericMessage(java.io.File file) throws java.io.IOException
file
- is the XML file having the message text content.
java.io.IOException
public GenericMessage(java.lang.String content)
content
- Method Detail |
---|
public void setDOM(org.w3c.dom.Node n) throws MessageParsingException
setDOM
in interface MessageInterface
MessageParsingException
public org.w3c.dom.Node getDOM()
getDOM
in interface MessageInterface
protected java.lang.String writeTextToTempFile(java.lang.String text)
text
- the text to be written
protected org.w3c.dom.Document convertTextToMessageDOM(java.lang.String text)
return
- the document generatedpublic void setXMLTextContent(java.lang.String content)
setXMLTextContent
in interface MessageInterface
content
- is the new XML format contnet in the form of a String
MessageParsingException
- is thrown if the content is not syntatically correctpublic java.lang.String getXMLTextContent()
getXMLTextContent
in interface MessageInterface
public java.lang.String toString()
toString
in class java.lang.Object
public long getId()
getId
in interface MessageInterface
public java.util.Date getDateCreated()
getDateCreated
in interface MessageInterface
public java.util.Date getDateReceivedInServer()
getDateReceivedInServer
in interface MessageInterface
public void setDateReceivedInServer(java.util.Date date)
date
- is the current time and date
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |