Class NonBlockingCoordinator.CoordinationMessage

java.lang.Object
org.apache.catalina.tribes.group.interceptors.NonBlockingCoordinator.CoordinationMessage
Enclosing class:
NonBlockingCoordinator

public static class NonBlockingCoordinator.CoordinationMessage extends Object
Represents a coordination message used in the election protocol.
  • Field Details

    • buf

      protected final XByteBuffer buf
      The byte buffer for the message.
    • leader

      protected Member leader
      The leader member.
    • source

      protected Member source
      The source member.
    • view

      protected Member[] view
      The member view.
    • id

      protected UniqueId id
      The message ID.
    • type

      protected byte[] type
      The message type.
  • Constructor Details

    • CoordinationMessage

      public CoordinationMessage(XByteBuffer buf)
      Constructs a CoordinationMessage from a buffer.
      Parameters:
      buf - The byte buffer containing the message
    • CoordinationMessage

      public CoordinationMessage(Member leader, Member source, Member[] view, UniqueId id, byte[] type)
      Constructs a CoordinationMessage with the given parameters.
      Parameters:
      leader - The leader member
      source - The source member
      view - The member view
      id - The message ID
      type - The message type
  • Method Details

    • getHeader

      public byte[] getHeader()
      Returns the coordination message header.
      Returns:
      The header bytes
    • getLeader

      public Member getLeader()
      Returns the leader member.
      Returns:
      The leader member
    • getSource

      public Member getSource()
      Returns the source member.
      Returns:
      The source member
    • getId

      public UniqueId getId()
      Returns the message ID.
      Returns:
      The message ID
    • getMembers

      public Member[] getMembers()
      Returns the member view.
      Returns:
      The array of members
    • getType

      public byte[] getType()
      Returns the message type.
      Returns:
      The type bytes
    • getBuffer

      public XByteBuffer getBuffer()
      Returns the message buffer.
      Returns:
      The byte buffer
    • parse

      public void parse()
      Parses the message from the buffer.
    • write

      public void write()
      Writes the message to the buffer.