Class Message

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long time  
      protected java.lang.String urid  
    • Constructor Summary

      Constructors 
      Constructor Description
      Message​(java.lang.String urid)
      Constructs a new Message
      Message​(org.jdom.Element root)
      Constructs a new Message from an XML element
    • Field Detail

      • urid

        protected java.lang.String urid
      • time

        protected long time
    • 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 class java.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 occurs
        java.io.IOException - if an error occurs
        Since:
        jcms-4.1
      • getTime

        public long getTime()