Package com.jalios.jstore.jsync
Class Message
- java.lang.Object
-
- com.jalios.jstore.jsync.Message
-
- Direct Known Subclasses:
AckMessage
,CommitWorkMessage
,DisjoinMessage
,JoinMessage
,SuggestJoinMessage
,UpdateMessage
public abstract class Message extends java.lang.Object
This abstract class is the super class of all JSync message classes- Author:
- Olivier Dedieu
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description long
getTime()
java.lang.String
getUrid()
java.lang.String
getXmlFooter()
java.lang.String
getXmlHeader()
static Message
parse(java.lang.String xml)
Parse the given XML strings and builds the corresponding JSync messagejava.lang.String
stampToXml(Stamp stamp)
java.lang.String
toString()
abstract java.lang.String
toXml()
-
-
-
Constructor Detail
-
Message
public Message(java.lang.String urid)
Constructs a new Message- Parameters:
urid
- the urid of the sender (i.e. replica that sends this message)- Since:
- jcms-4.1
-
Message
public Message(org.jdom.Element root)
Constructs a new Message from an XML element- Parameters:
root
- the root element- Since:
- jcms-4.1
-
-
Method Detail
-
getUrid
public java.lang.String getUrid()
- Returns:
- the urid of the sender
- Since:
- jcms-4.1
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toXml
public abstract java.lang.String toXml()
- Returns:
- an XML representation of this message
- Since:
- jcms-4.1
-
stampToXml
public java.lang.String stampToXml(Stamp stamp)
- Parameters:
stamp
- the stamp to represents in XML- Returns:
- an XML representation of the given stamp
- Since:
- jcms-4.1
-
getXmlHeader
public java.lang.String getXmlHeader()
- Returns:
- the XML header of JSync messages
- Since:
- jcms-4.1
-
getXmlFooter
public java.lang.String getXmlFooter()
- Returns:
- the XML footer of JSync messages
- Since:
- jcms-4.1
-
parse
public static Message parse(java.lang.String xml) throws org.jdom.JDOMException, java.io.IOException
Parse the given XML strings and builds the corresponding JSync message- Parameters:
xml
- the XML to parse- Returns:
- a sub-class of Message or null if the message parsing has failed.
- Throws:
org.jdom.JDOMException
- if an error occursjava.io.IOException
- if an error occurs- Since:
- jcms-4.1
-
getTime
public long getTime()
-
-