@Service
public class LeadershipManager
extends org.onosproject.event.AbstractListenerManager<org.onosproject.cluster.LeadershipEvent,org.onosproject.cluster.LeadershipEventListener>
implements org.onosproject.cluster.LeadershipService, org.onosproject.cluster.LeadershipAdminService
LeadershipService and LeadershipAdminService.| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.cluster.ClusterService |
clusterService |
protected org.onosproject.cluster.LeadershipStore |
store |
| Constructor and Description |
|---|
LeadershipManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
deactivate() |
Map<String,org.onosproject.cluster.Leadership> |
getLeaderBoard() |
org.onosproject.cluster.Leadership |
getLeadership(String topic) |
boolean |
promoteToTopOfCandidateList(String topic,
org.onosproject.cluster.NodeId nodeId) |
org.onosproject.cluster.Leadership |
runForLeadership(String topic) |
boolean |
transferLeadership(String topic,
org.onosproject.cluster.NodeId to) |
void |
unregister(org.onosproject.cluster.NodeId nodeId) |
void |
withdraw(String topic) |
addListener, bindEventDispatcher, post, removeListener, unbindEventDispatcherclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.ClusterService clusterService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.LeadershipStore store
@Activate public void activate()
@Deactivate public void deactivate()
public org.onosproject.cluster.Leadership getLeadership(String topic)
getLeadership in interface org.onosproject.cluster.LeadershipServicepublic org.onosproject.cluster.Leadership runForLeadership(String topic)
runForLeadership in interface org.onosproject.cluster.LeadershipServicepublic void withdraw(String topic)
withdraw in interface org.onosproject.cluster.LeadershipServicepublic Map<String,org.onosproject.cluster.Leadership> getLeaderBoard()
getLeaderBoard in interface org.onosproject.cluster.LeadershipServicepublic boolean transferLeadership(String topic, org.onosproject.cluster.NodeId to)
transferLeadership in interface org.onosproject.cluster.LeadershipAdminServicepublic void unregister(org.onosproject.cluster.NodeId nodeId)
unregister in interface org.onosproject.cluster.LeadershipAdminServicepublic boolean promoteToTopOfCandidateList(String topic, org.onosproject.cluster.NodeId nodeId)
promoteToTopOfCandidateList in interface org.onosproject.cluster.LeadershipAdminService