@Service public class ConsistentVirtualDeviceMastershipStore extends AbstractVirtualStore<org.onosproject.mastership.MastershipEvent,org.onosproject.mastership.MastershipStoreDelegate> implements VirtualNetworkMastershipStore
| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.store.cluster.messaging.ClusterCommunicationService |
clusterCommunicator |
protected org.onosproject.cluster.ClusterService |
clusterService |
protected org.onosproject.cluster.LeadershipAdminService |
leadershipAdminService |
protected org.onosproject.cluster.LeadershipService |
leadershipService |
static org.onosproject.store.service.Serializer |
SERIALIZER |
delegateMap| Constructor and Description |
|---|
ConsistentVirtualDeviceMastershipStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
deactivate() |
Set<org.onosproject.net.DeviceId> |
getDevices(NetworkId networkId,
org.onosproject.cluster.NodeId nodeId)
Returns the devices that a controller instance is master of.
|
org.onosproject.cluster.NodeId |
getMaster(NetworkId networkId,
org.onosproject.net.DeviceId deviceId)
Returns the master for a device.
|
org.onosproject.cluster.RoleInfo |
getNodes(NetworkId networkId,
org.onosproject.net.DeviceId deviceId)
Returns the master and backup nodes for a device.
|
org.onosproject.net.MastershipRole |
getRole(NetworkId networkId,
org.onosproject.cluster.NodeId nodeId,
org.onosproject.net.DeviceId deviceId)
Returns the role of a device for a specific controller instance.
|
org.onosproject.mastership.MastershipTerm |
getTermFor(NetworkId networkId,
org.onosproject.net.DeviceId deviceId)
Returns the current master and number of past mastership hand-offs
(terms) for a device.
|
void |
relinquishAllRole(NetworkId networkId,
org.onosproject.cluster.NodeId nodeId)
Removes all the roles for the specified controller instance.
|
CompletableFuture<org.onosproject.mastership.MastershipEvent> |
relinquishRole(NetworkId networkId,
org.onosproject.cluster.NodeId nodeId,
org.onosproject.net.DeviceId deviceId)
Allows a controller instance to give up its current role for a device.
|
CompletableFuture<org.onosproject.net.MastershipRole> |
requestRole(NetworkId networkId,
org.onosproject.net.DeviceId deviceId)
Requests role of the local node for the specified device.
|
CompletableFuture<org.onosproject.mastership.MastershipEvent> |
setMaster(NetworkId networkId,
org.onosproject.cluster.NodeId nodeId,
org.onosproject.net.DeviceId deviceId)
Sets a device's role for a specified controller instance.
|
CompletableFuture<org.onosproject.mastership.MastershipEvent> |
setStandby(NetworkId networkId,
org.onosproject.cluster.NodeId nodeId,
org.onosproject.net.DeviceId deviceId)
Sets a controller instance's mastership role to STANDBY for a device.
|
hasDelegate, notifyDelegate, notifyDelegate, setDelegate, unsetDelegateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasDelegate, setDelegate, unsetDelegate@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.LeadershipService leadershipService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.LeadershipAdminService leadershipAdminService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.ClusterService clusterService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.store.cluster.messaging.ClusterCommunicationService clusterCommunicator
public static final org.onosproject.store.service.Serializer SERIALIZER
public ConsistentVirtualDeviceMastershipStore()
@Activate public void activate()
@Deactivate public void deactivate()
public CompletableFuture<org.onosproject.net.MastershipRole> requestRole(NetworkId networkId, org.onosproject.net.DeviceId deviceId)
VirtualNetworkMastershipStorerequestRole in interface VirtualNetworkMastershipStorenetworkId - the virtual network identifierdeviceId - the device identifierpublic org.onosproject.net.MastershipRole getRole(NetworkId networkId, org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)
VirtualNetworkMastershipStoregetRole in interface VirtualNetworkMastershipStorenetworkId - virtual network identifiernodeId - the instance identifierdeviceId - the device identifierspublic org.onosproject.cluster.NodeId getMaster(NetworkId networkId, org.onosproject.net.DeviceId deviceId)
VirtualNetworkMastershipStoregetMaster in interface VirtualNetworkMastershipStorenetworkId - virtual network identifierdeviceId - the device identifierpublic org.onosproject.cluster.RoleInfo getNodes(NetworkId networkId, org.onosproject.net.DeviceId deviceId)
VirtualNetworkMastershipStoregetNodes in interface VirtualNetworkMastershipStorenetworkId - virtual network identifierdeviceId - the device identifierpublic Set<org.onosproject.net.DeviceId> getDevices(NetworkId networkId, org.onosproject.cluster.NodeId nodeId)
VirtualNetworkMastershipStoregetDevices in interface VirtualNetworkMastershipStorenetworkId - virtual network identifiernodeId - the instance identifierpublic CompletableFuture<org.onosproject.mastership.MastershipEvent> setMaster(NetworkId networkId, org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)
VirtualNetworkMastershipStoresetMaster in interface VirtualNetworkMastershipStorenetworkId - virtual network identifiernodeId - controller instance identifierdeviceId - device identifierpublic org.onosproject.mastership.MastershipTerm getTermFor(NetworkId networkId, org.onosproject.net.DeviceId deviceId)
VirtualNetworkMastershipStoregetTermFor in interface VirtualNetworkMastershipStorenetworkId - virtual network identifierdeviceId - the device identifierpublic CompletableFuture<org.onosproject.mastership.MastershipEvent> setStandby(NetworkId networkId, org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)
VirtualNetworkMastershipStoresetStandby in interface VirtualNetworkMastershipStorenetworkId - virtual network identifiernodeId - the controller instance identifierdeviceId - device to revoke mastership role forpublic CompletableFuture<org.onosproject.mastership.MastershipEvent> relinquishRole(NetworkId networkId, org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId)
VirtualNetworkMastershipStorerelinquishRole in interface VirtualNetworkMastershipStorenetworkId - virtual network identifiernodeId - the controller instance identifierdeviceId - device to revoke mastership role forpublic void relinquishAllRole(NetworkId networkId, org.onosproject.cluster.NodeId nodeId)
VirtualNetworkMastershipStorerelinquishAllRole in interface VirtualNetworkMastershipStorenetworkId - virtual network identifiernodeId - the controller instance identifier