Package org.onosproject.cluster
Class Leadership
- java.lang.Object
-
- org.onosproject.cluster.Leadership
-
public class Leadership extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Leadership(java.lang.String topic, Leader leader, java.util.List<NodeId> candidates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<NodeId>
candidates()
Returns an preference-ordered list of nodes that are in the leadership race for this topic.boolean
equals(java.lang.Object obj)
int
hashCode()
Leader
leader()
Returns the leader for this topic.NodeId
leaderNodeId()
Returns thenodeId
of the leader.java.lang.String
topic()
Returns the leadership topic.java.lang.String
toString()
-
-
-
Method Detail
-
topic
public java.lang.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 java.util.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.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-