Package org.onosproject.cluster
Class Leadership
- java.lang.Object
-
- org.onosproject.cluster.Leadership
-
public class Leadership extends Object
-
-
Constructor Summary
Constructors Constructor Description Leadership(String topic, Leader leader, List<NodeId> candidates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<NodeId>
candidates()
Returns an preference-ordered list of nodes that are in the leadership race for this topic.boolean
equals(Object obj)
int
hashCode()
Leader
leader()
Returns the leader for this topic.NodeId
leaderNodeId()
Returns thenodeId
of the leader.String
topic()
Returns the leadership topic.String
toString()
-
-
-
Method Detail
-
topic
public String topic()
Returns the leadership topic.- Returns:
- leadership topic.
-
leaderNodeId
public NodeId leaderNodeId()
Returns thenodeId
of the leader.- Returns:
- leader node identifier; will be null if there is no leader
-
leader
public Leader leader()
Returns the leader for this topic.- Returns:
- leader; will be null if there is no leader for topic
-
candidates
public List<NodeId> candidates()
Returns an preference-ordered list of nodes that are in the leadership race for this topic.- Returns:
- a list of NodeIds in priority-order, or an empty list.
-
-