Class AbstractReplicatedMap.MapMessage

java.lang.Object
org.apache.catalina.tribes.tipis.AbstractReplicatedMap.MapMessage
All Implemented Interfaces:
Serializable, Cloneable
Enclosing class:
AbstractReplicatedMap<K,V>

public static class AbstractReplicatedMap.MapMessage extends Object implements Serializable, Cloneable
Represents a message sent between replicated map instances.
See Also:
  • Field Details

  • Constructor Details

    • MapMessage

      public MapMessage(byte[] mapId, int msgtype, boolean diff, Serializable key, 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 Details

    • toString

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

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

      public void deserialize(ClassLoader[] cls) throws IOException, ClassNotFoundException
      Deserializes the key and value using the given class loaders.
      Parameters:
      cls - The class loaders to use for deserialization
      Throws:
      IOException - If deserialization fails
      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 Serializable getKey()
      Gets the key for this message.
      Returns:
      The key
    • key

      Deserializes the key using the given class loaders.
      Parameters:
      cls - The class loaders to use for deserialization
      Returns:
      The deserialized key
      Throws:
      IOException - If deserialization fails
      ClassNotFoundException - If the key class is not found
    • getKeyData

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

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

      Deserializes the value using the given class loaders.
      Parameters:
      cls - The class loaders to use for deserialization
      Returns:
      The deserialized value
      Throws:
      IOException - If deserialization fails
      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(Serializable value)
      Sets the value for this message.
      Parameters:
      value - The value
    • setKey

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

      Creates a shallow copy of this map message.
      Overrides:
      clone in class Object
      Returns:
      a shallow copy of this map message