Class AbstractReplicatedMap.MapMessage

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Enclosing class:
    AbstractReplicatedMap<K,​V>

    public static class AbstractReplicatedMap.MapMessage
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable
    Represents a message sent between replicated map instances.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      MapMessage​(byte[] mapId, int msgtype, boolean diff, java.io.Serializable key, java.io.Serializable value, byte[] diffvalue, Member primary, Member[] nodes)
      Creates a new map message with the specified parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AbstractReplicatedMap.MapMessage clone()
      Creates a shallow copy of this map message.
      void deserialize​(java.lang.ClassLoader[] cls)
      Deserializes the key and value using the given class loaders.
      Member[] getBackupNodes()
      Gets the backup nodes.
      byte[] getDiffValue()
      Gets the diff value data.
      java.io.Serializable getKey()
      Gets the key for this message.
      byte[] getKeyData()
      Gets the serialized key data.
      byte[] getMapId()
      Gets the map identifier.
      int getMsgType()
      Gets the message type.
      Member getPrimary()
      Gets the primary member.
      java.lang.String getTypeDesc()
      Gets a description of the message type.
      java.io.Serializable getValue()
      Gets the value for this message.
      byte[] getValueData()
      Gets the serialized value data.
      boolean isDiff()
      Checks if this is a diff message.
      java.io.Serializable key​(java.lang.ClassLoader[] cls)
      Deserializes the key using the given class loaders.
      void setKey​(java.io.Serializable key)
      Sets the key for this message.
      void setValue​(java.io.Serializable value)
      Sets the value for this message.
      java.lang.String toString()
      Returns a string representation of this map message.
      java.io.Serializable value​(java.lang.ClassLoader[] cls)
      Deserializes the value using the given class loaders.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MapMessage

        public MapMessage​(byte[] mapId,
                          int msgtype,
                          boolean diff,
                          java.io.Serializable key,
                          java.io.Serializable value,
                          byte[] diffvalue,
                          Member primary,
                          Member[] nodes)
        Creates a new map message with the specified parameters.
        Parameters:
        mapId - The map identifier
        msgtype - The message type
        diff - Whether this is a diff message
        key - The key
        value - The value
        diffvalue - The serialized diff value
        primary - The primary member
        nodes - The backup nodes
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representation of this map message.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this map message
      • getTypeDesc

        public java.lang.String getTypeDesc()
        Gets a description of the message type.
        Returns:
        A string description of the message type
      • deserialize

        public void deserialize​(java.lang.ClassLoader[] cls)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Deserializes the key and value using the given class loaders.
        Parameters:
        cls - The class loaders to use for deserialization
        Throws:
        java.io.IOException - If deserialization fails
        java.lang.ClassNotFoundException - If a class is not found
      • getMsgType

        public int getMsgType()
        Gets the message type.
        Returns:
        the message type
      • isDiff

        public boolean isDiff()
        Checks if this is a diff message.
        Returns:
        true if this is a diff message
      • getKey

        public java.io.Serializable getKey()
        Gets the key for this message.
        Returns:
        The key
      • key

        public java.io.Serializable key​(java.lang.ClassLoader[] cls)
                                 throws java.io.IOException,
                                        java.lang.ClassNotFoundException
        Deserializes the key using the given class loaders.
        Parameters:
        cls - The class loaders to use for deserialization
        Returns:
        The deserialized key
        Throws:
        java.io.IOException - If deserialization fails
        java.lang.ClassNotFoundException - If the key class is not found
      • getKeyData

        public byte[] getKeyData()
        Gets the serialized key data.
        Returns:
        The serialized key data
      • getValue

        public java.io.Serializable getValue()
        Gets the value for this message.
        Returns:
        The value
      • value

        public java.io.Serializable value​(java.lang.ClassLoader[] cls)
                                   throws java.io.IOException,
                                          java.lang.ClassNotFoundException
        Deserializes the value using the given class loaders.
        Parameters:
        cls - The class loaders to use for deserialization
        Returns:
        The deserialized value
        Throws:
        java.io.IOException - If deserialization fails
        java.lang.ClassNotFoundException - If the value class is not found
      • getValueData

        public byte[] getValueData()
        Gets the serialized value data.
        Returns:
        The serialized value data
      • getDiffValue

        public byte[] getDiffValue()
        Gets the diff value data.
        Returns:
        The diff value data
      • getBackupNodes

        public Member[] getBackupNodes()
        Gets the backup nodes.
        Returns:
        The backup nodes
      • getPrimary

        public Member getPrimary()
        Gets the primary member.
        Returns:
        The primary member
      • getMapId

        public byte[] getMapId()
        Gets the map identifier.
        Returns:
        the map identifier
      • setValue

        public void setValue​(java.io.Serializable value)
        Sets the value for this message.
        Parameters:
        value - The value
      • setKey

        public void setKey​(java.io.Serializable key)
        Sets the key for this message.
        Parameters:
        key - The key
      • clone

        public AbstractReplicatedMap.MapMessage clone()
        Creates a shallow copy of this map message.
        Overrides:
        clone in class java.lang.Object
        Returns:
        a shallow copy of this map message