Package org.onosproject.cluster
Interface LeadershipAdminService
- 
public interface LeadershipAdminServiceInterface for administratively manipulating leadership assignments. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,Leadership>getLeaderBoard()Returns the current leader board.booleanpromoteToTopOfCandidateList(String topic, NodeId nodeId)Make a node to be the next leader by promoting it to top of candidate list.booleantransferLeadership(String topic, NodeId nodeId)Attempts to assign leadership for a topic to a specified node.voidunregister(NodeId nodeId)Removes all active leadership registrations for a given node. 
 - 
 
- 
- 
Method Detail
- 
transferLeadership
boolean transferLeadership(String topic, NodeId nodeId)
Attempts to assign leadership for a topic to a specified node.- Parameters:
 topic- leadership topicnodeId- identifier of the node to be made leader- Returns:
 - true is the transfer was successfully executed. This method returns 
falseifnodeIdis not one of the candidates for for the topic. 
 
- 
promoteToTopOfCandidateList
boolean promoteToTopOfCandidateList(String topic, NodeId nodeId)
Make a node to be the next leader by promoting it to top of candidate list.- Parameters:
 topic- leadership topicnodeId- identifier of node to be next leader- Returns:
 trueif nodeId is now the top candidate. This method returnsfalseifnodeIdis not one of the candidates for for the topic.
 
- 
unregister
void unregister(NodeId nodeId)
Removes all active leadership registrations for a given node.This method will also evict the node from leaderships that it currently owns.
- Parameters:
 nodeId- node identifier
 
- 
getLeaderBoard
Map<String,Leadership> getLeaderBoard()
Returns the current leader board.- Returns:
 - mapping from topic to leadership info.
 
 
 - 
 
 -