Class ConsistentDeviceMastershipStore
- java.lang.Object
-
- org.onosproject.store.AbstractStore<org.onosproject.mastership.MastershipEvent,org.onosproject.mastership.MastershipStoreDelegate>
-
- org.onosproject.store.mastership.impl.ConsistentDeviceMastershipStore
-
- All Implemented Interfaces:
org.onosproject.mastership.MastershipStore,org.onosproject.store.Store<org.onosproject.mastership.MastershipEvent,org.onosproject.mastership.MastershipStoreDelegate>
public class ConsistentDeviceMastershipStore extends org.onosproject.store.AbstractStore<org.onosproject.mastership.MastershipEvent,org.onosproject.mastership.MastershipStoreDelegate> implements org.onosproject.mastership.MastershipStoreImplementation of the MastershipStore on top of Leadership Service.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.onosproject.store.cluster.messaging.ClusterCommunicationServiceclusterCommunicatorprotected org.onosproject.cluster.ClusterServiceclusterServiceprotected org.onosproject.cluster.LeadershipAdminServiceleadershipAdminServiceprotected org.onosproject.cluster.LeadershipServiceleadershipServicestatic org.onosproject.store.service.SerializerSERIALIZER
-
Constructor Summary
Constructors Constructor Description ConsistentDeviceMastershipStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()voiddeactivate()java.util.Set<org.onosproject.net.DeviceId>getDevices(org.onosproject.cluster.NodeId nodeId)org.onosproject.cluster.NodeIdgetMaster(org.onosproject.net.DeviceId deviceId)org.onosproject.mastership.MastershipInfogetMastership(org.onosproject.net.DeviceId deviceId)org.onosproject.cluster.RoleInfogetNodes(org.onosproject.net.DeviceId deviceId)org.onosproject.net.MastershipRolegetRole(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)org.onosproject.mastership.MastershipTermgetTermFor(org.onosproject.net.DeviceId deviceId)voidrelinquishAllRole(org.onosproject.cluster.NodeId nodeId)java.util.concurrent.CompletableFuture<org.onosproject.mastership.MastershipEvent>relinquishRole(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)java.util.concurrent.CompletableFuture<org.onosproject.net.MastershipRole>requestRole(org.onosproject.net.DeviceId deviceId)java.util.concurrent.CompletableFuture<org.onosproject.mastership.MastershipEvent>setMaster(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)java.util.concurrent.CompletableFuture<org.onosproject.mastership.MastershipEvent>setStandby(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)-
Methods inherited from class org.onosproject.store.AbstractStore
hasDelegate, notifyDelegate, notifyDelegate, setDelegate, unsetDelegate
-
-
-
-
Field Detail
-
leadershipService
protected org.onosproject.cluster.LeadershipService leadershipService
-
leadershipAdminService
protected org.onosproject.cluster.LeadershipAdminService leadershipAdminService
-
clusterService
protected org.onosproject.cluster.ClusterService clusterService
-
clusterCommunicator
protected org.onosproject.store.cluster.messaging.ClusterCommunicationService clusterCommunicator
-
SERIALIZER
public static final org.onosproject.store.service.Serializer SERIALIZER
-
-
Method Detail
-
activate
public void activate()
-
deactivate
public void deactivate()
-
requestRole
public java.util.concurrent.CompletableFuture<org.onosproject.net.MastershipRole> requestRole(org.onosproject.net.DeviceId deviceId)
- Specified by:
requestRolein interfaceorg.onosproject.mastership.MastershipStore
-
getRole
public org.onosproject.net.MastershipRole getRole(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)- Specified by:
getRolein interfaceorg.onosproject.mastership.MastershipStore
-
getMaster
public org.onosproject.cluster.NodeId getMaster(org.onosproject.net.DeviceId deviceId)
- Specified by:
getMasterin interfaceorg.onosproject.mastership.MastershipStore
-
getNodes
public org.onosproject.cluster.RoleInfo getNodes(org.onosproject.net.DeviceId deviceId)
- Specified by:
getNodesin interfaceorg.onosproject.mastership.MastershipStore
-
getMastership
public org.onosproject.mastership.MastershipInfo getMastership(org.onosproject.net.DeviceId deviceId)
- Specified by:
getMastershipin interfaceorg.onosproject.mastership.MastershipStore
-
getDevices
public java.util.Set<org.onosproject.net.DeviceId> getDevices(org.onosproject.cluster.NodeId nodeId)
- Specified by:
getDevicesin interfaceorg.onosproject.mastership.MastershipStore
-
setMaster
public java.util.concurrent.CompletableFuture<org.onosproject.mastership.MastershipEvent> setMaster(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)- Specified by:
setMasterin interfaceorg.onosproject.mastership.MastershipStore
-
getTermFor
public org.onosproject.mastership.MastershipTerm getTermFor(org.onosproject.net.DeviceId deviceId)
- Specified by:
getTermForin interfaceorg.onosproject.mastership.MastershipStore
-
setStandby
public java.util.concurrent.CompletableFuture<org.onosproject.mastership.MastershipEvent> setStandby(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)- Specified by:
setStandbyin interfaceorg.onosproject.mastership.MastershipStore
-
relinquishRole
public java.util.concurrent.CompletableFuture<org.onosproject.mastership.MastershipEvent> relinquishRole(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)- Specified by:
relinquishRolein interfaceorg.onosproject.mastership.MastershipStore
-
relinquishAllRole
public void relinquishAllRole(org.onosproject.cluster.NodeId nodeId)
- Specified by:
relinquishAllRolein interfaceorg.onosproject.mastership.MastershipStore
-
-