Package org.onosproject.cluster
Interface LeadershipStore
- 
- All Superinterfaces:
- Store<LeadershipEvent,LeadershipStoreDelegate>
 
 public interface LeadershipStore extends Store<LeadershipEvent,LeadershipStoreDelegate> Store interface for managingLeadershipServicestate.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description LeadershipaddRegistration(String topic)Adds registration for the local instance to be part of the leadership contest for topic.LeadershipgetLeadership(String topic)Returns the current leadership for topic.Map<String,Leadership>getLeaderships()Return current leadership for all topics.booleanmakeTopCandidate(String topic, NodeId nodeId)Attempts to make a node the top candidate.booleanmoveLeadership(String topic, NodeId toNodeId)Updates state so that given node is leader for a topic.voidremoveRegistration(String topic)Unregisters the local instance from leadership contest for topic.voidremoveRegistration(NodeId nodeId)Unregisters an instance from all leadership contests.- 
Methods inherited from interface org.onosproject.store.StorehasDelegate, setDelegate, unsetDelegate
 
- 
 
- 
- 
- 
Method Detail- 
addRegistrationLeadership addRegistration(String topic) Adds registration for the local instance to be part of the leadership contest for topic.- Parameters:
- topic- leadership topic
- Returns:
- Updated leadership after operation is completed
 
 - 
removeRegistrationvoid removeRegistration(String topic) Unregisters the local instance from leadership contest for topic.- Parameters:
- topic- leadership topic
 
 - 
removeRegistrationvoid removeRegistration(NodeId nodeId) Unregisters an instance from all leadership contests.- Parameters:
- nodeId- node identifier
 
 - 
moveLeadershipboolean moveLeadership(String topic, NodeId toNodeId) Updates state so that given node is leader for a topic.- Parameters:
- topic- leadership topic
- toNodeId- identifier of the desired leader
- Returns:
- trueif the transfer succeeded;- falseotherwise. This method can return- falseif the node is not registered for the topic
 
 - 
makeTopCandidateboolean makeTopCandidate(String topic, NodeId nodeId) Attempts to make a node the top candidate.- Parameters:
- topic- leadership topic
- nodeId- node identifier
- Returns:
- trueif the specified node is now the top candidate. This method will return- falseif the node is not registered for the topic
 
 - 
getLeadershipLeadership getLeadership(String topic) Returns the current leadership for topic.- Parameters:
- topic- leadership topic
- Returns:
- current leadership
 
 - 
getLeadershipsMap<String,Leadership> getLeaderships() Return current leadership for all topics.- Returns:
- topic to leadership mapping
 
 
- 
 
-