Class NonBlockingCoordinator.CoordinationMessage
- java.lang.Object
-
- org.apache.catalina.tribes.group.interceptors.NonBlockingCoordinator.CoordinationMessage
-
- Enclosing class:
- NonBlockingCoordinator
public static class NonBlockingCoordinator.CoordinationMessage extends java.lang.ObjectRepresents a coordination message used in the election protocol.
-
-
Field Summary
Fields Modifier and Type Field Description protected XByteBufferbufThe byte buffer for the message.protected UniqueIdidThe message ID.protected MemberleaderThe leader member.protected MembersourceThe source member.protected byte[]typeThe message type.protected Member[]viewThe member view.
-
Constructor Summary
Constructors Constructor Description CoordinationMessage(XByteBuffer buf)Constructs a CoordinationMessage from a buffer.CoordinationMessage(Member leader, Member source, Member[] view, UniqueId id, byte[] type)Constructs a CoordinationMessage with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XByteBuffergetBuffer()Returns the message buffer.byte[]getHeader()Returns the coordination message header.UniqueIdgetId()Returns the message ID.MembergetLeader()Returns the leader member.Member[]getMembers()Returns the member view.MembergetSource()Returns the source member.byte[]getType()Returns the message type.voidparse()Parses the message from the buffer.voidwrite()Writes the message to the buffer.
-
-
-
Field Detail
-
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 Detail
-
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 membersource- The source memberview- The member viewid- The message IDtype- The message type
-
-
Method Detail
-
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.
-
-