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.booleanequals(Object obj)inthashCode()Leaderleader()Returns the leader for this topic.NodeIdleaderNodeId()Returns thenodeIdof the leader.Stringtopic()Returns the leadership topic.StringtoString()
-
-
-
Method Detail
-
topic
public String topic()
Returns the leadership topic.- Returns:
- leadership topic.
-
leaderNodeId
public NodeId leaderNodeId()
Returns thenodeIdof 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.
-
-