public class VirtualNetworkMastershipManager extends AbstractVirtualListenerManager<org.onosproject.mastership.MastershipEvent,org.onosproject.mastership.MastershipListener> implements org.onosproject.mastership.MastershipService, org.onosproject.mastership.MastershipAdminService, org.onosproject.mastership.MastershipTermService, org.onosproject.core.MetricsHelper
| Modifier and Type | Class and Description |
|---|---|
class |
VirtualNetworkMastershipManager.InternalDelegate |
| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.cluster.ClusterService |
clusterService |
eventDispatcher, manager, networkId, serviceDirectory| Constructor and Description |
|---|
VirtualNetworkMastershipManager(VirtualNetworkService manager,
NetworkId networkId)
Creates a new VirtualNetworkMastershipManager object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
balanceRoles() |
Set<org.onosproject.net.DeviceId> |
getDevicesOf(org.onosproject.cluster.NodeId nodeId) |
org.onosproject.net.MastershipRole |
getLocalRole(org.onosproject.net.DeviceId deviceId) |
org.onosproject.cluster.NodeId |
getMasterFor(org.onosproject.net.DeviceId deviceId) |
org.onosproject.mastership.MastershipTerm |
getMastershipTerm(org.onosproject.net.DeviceId deviceId) |
org.onosproject.cluster.RoleInfo |
getNodesFor(org.onosproject.net.DeviceId deviceId) |
org.onlab.metrics.MetricsService |
metricsService() |
CompletableFuture<Void> |
relinquishMastership(org.onosproject.net.DeviceId deviceId) |
CompletableFuture<org.onosproject.net.MastershipRole> |
requestRoleFor(org.onosproject.net.DeviceId deviceId) |
CompletableFuture<Void> |
setRole(org.onosproject.cluster.NodeId nodeId,
org.onosproject.net.DeviceId deviceId,
org.onosproject.net.MastershipRole role) |
addListener, networkId, post, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic VirtualNetworkMastershipManager(VirtualNetworkService manager, NetworkId networkId)
manager - virtual network manager servicenetworkId - virtual network identifierpublic CompletableFuture<Void> setRole(org.onosproject.cluster.NodeId nodeId, org.onosproject.net.DeviceId deviceId, org.onosproject.net.MastershipRole role)
setRole in interface org.onosproject.mastership.MastershipAdminServicepublic org.onosproject.net.MastershipRole getLocalRole(org.onosproject.net.DeviceId deviceId)
getLocalRole in interface org.onosproject.mastership.MastershipServicepublic CompletableFuture<org.onosproject.net.MastershipRole> requestRoleFor(org.onosproject.net.DeviceId deviceId)
requestRoleFor in interface org.onosproject.mastership.MastershipServicepublic CompletableFuture<Void> relinquishMastership(org.onosproject.net.DeviceId deviceId)
relinquishMastership in interface org.onosproject.mastership.MastershipServicepublic org.onosproject.cluster.NodeId getMasterFor(org.onosproject.net.DeviceId deviceId)
getMasterFor in interface org.onosproject.mastership.MastershipServicepublic org.onosproject.cluster.RoleInfo getNodesFor(org.onosproject.net.DeviceId deviceId)
getNodesFor in interface org.onosproject.mastership.MastershipServicepublic Set<org.onosproject.net.DeviceId> getDevicesOf(org.onosproject.cluster.NodeId nodeId)
getDevicesOf in interface org.onosproject.mastership.MastershipServicepublic org.onosproject.mastership.MastershipTerm getMastershipTerm(org.onosproject.net.DeviceId deviceId)
getMastershipTerm in interface org.onosproject.mastership.MastershipTermServicepublic org.onlab.metrics.MetricsService metricsService()
metricsService in interface org.onosproject.core.MetricsHelperpublic void balanceRoles()
balanceRoles in interface org.onosproject.mastership.MastershipAdminService