Class UpdateMsg

    • Constructor Detail

      • UpdateMsg

        public UpdateMsg​(CSN csn)
        Creates a new UpdateMsg with the given informations.

        This constructor is only used for testing.

        Parameters:
        csn - The CSN associated with the change encoded in this message.
    • Method Detail

      • accept

        public abstract <E extends Exception> void accept​(UpdateMsgVisitor<E> visitor)
                                                   throws E extends Exception
        Applies an UpdateMsgVisitor to this UpdateMsg.
        Type Parameters:
        E - The type of the exception thrown by the visitor method if it fails, or NeverThrowsException if the visitor cannot fail.
        Parameters:
        visitor - The message visitor.
        Throws:
        E - If the visitor failed.
        E extends Exception
      • getCSN

        public CSN getCSN()
        Get the CSN from the message.
        Returns:
        the CSN
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getVersion

        public short getVersion()
        Get the version included in the update message. Means the replication protocol version with which this update message was instantiated.
        Returns:
        The version with which this update message was instantiated.
      • size

        public abstract int size()
        Return the number of bytes used by this message.
        Returns:
        The number of bytes used by this message.
      • getBytes

        public byte[] getBytes()
        Returns the encoded representation of this update message using the latest protocol version.
        Returns:
        The encoded representation of this update message.
      • getBytes

        public abstract byte[] getBytes​(short protocolVersion)
        Description copied from class: ReplicationMsg
        Serializes the PDU using the provided replication protocol version. WARNING: should be overwritten by a PDU (sub class) we want to support older protocol version serialization for.
        Specified by:
        getBytes in class ReplicationMsg
        Parameters:
        protocolVersion - The protocol version to use for serialization. The version should normally be older than the current one.
        Returns:
        The encoded PDU, or null if the message isn't supported in that protocol version.
      • toJson

        public JsonValue toJson()
        Returns the json representation of this update message.
        Returns:
        The json representation of this update message.