Class DeviceMastershipManager
- java.lang.Object
-
- org.opendaylight.openflowplugin.applications.frm.impl.DeviceMastershipManager
-
- All Implemented Interfaces:
AutoCloseable
,EventListener
,org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener<FlowCapableNode>
,org.opendaylight.mdsal.binding.api.DataTreeChangeListener<FlowCapableNode>
,MastershipChangeService
public class DeviceMastershipManager extends Object implements org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener<FlowCapableNode>, AutoCloseable, MastershipChangeService
Manager for clustering service registrations ofDeviceMastership
.
-
-
Constructor Summary
Constructors Constructor Description DeviceMastershipManager(org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider clusterSingletonService, FlowNodeReconciliation reconcliationAgent, org.opendaylight.mdsal.binding.api.DataBroker dataBroker, MastershipChangeServiceManager mastershipChangeServiceManager, org.opendaylight.mdsal.binding.api.RpcProviderService rpcProviderService, FrmReconciliationService reconciliationService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowCapableNode> identifier, FlowCapableNode add, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowCapableNode> nodeIdent)
void
close()
boolean
isDeviceMastered(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
boolean
isNodeActive(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
void
onBecomeOwner(@NonNull DeviceInfo deviceInfo)
Event when device is ready as a master.void
onDataTreeChanged(@NonNull Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<FlowCapableNode>> changes)
void
onLoseOwnership(@NonNull DeviceInfo deviceInfo)
Event when device disconnected or become slave.void
remove(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowCapableNode> identifier, FlowCapableNode del, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowCapableNode> nodeIdent)
-
-
-
Constructor Detail
-
DeviceMastershipManager
public DeviceMastershipManager(org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider clusterSingletonService, FlowNodeReconciliation reconcliationAgent, org.opendaylight.mdsal.binding.api.DataBroker dataBroker, MastershipChangeServiceManager mastershipChangeServiceManager, org.opendaylight.mdsal.binding.api.RpcProviderService rpcProviderService, FrmReconciliationService reconciliationService)
-
-
Method Detail
-
isDeviceMastered
public boolean isDeviceMastered(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
-
isNodeActive
public boolean isNodeActive(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
-
onDataTreeChanged
public void onDataTreeChanged(@NonNull Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<FlowCapableNode>> changes)
- Specified by:
onDataTreeChanged
in interfaceorg.opendaylight.mdsal.binding.api.DataTreeChangeListener<FlowCapableNode>
-
remove
public void remove(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowCapableNode> identifier, FlowCapableNode del, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowCapableNode> nodeIdent)
-
add
public void add(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowCapableNode> identifier, FlowCapableNode add, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowCapableNode> nodeIdent)
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
onBecomeOwner
public void onBecomeOwner(@NonNull DeviceInfo deviceInfo)
Description copied from interface:MastershipChangeService
Event when device is ready as a master. This event is evoked byOwnershipChangeListener.becomeMaster(DeviceInfo)
- Specified by:
onBecomeOwner
in interfaceMastershipChangeService
- Parameters:
deviceInfo
- connected switch identification
-
onLoseOwnership
public void onLoseOwnership(@NonNull DeviceInfo deviceInfo)
Description copied from interface:MastershipChangeService
Event when device disconnected or become slave. This event is evoked byOwnershipChangeListener.becomeSlaveOrDisconnect(DeviceInfo)
- Specified by:
onLoseOwnership
in interfaceMastershipChangeService
- Parameters:
deviceInfo
- connected switch identification
-
-