Class MastershipChangeServiceManagerImpl
- java.lang.Object
- 
- org.opendaylight.openflowplugin.impl.mastership.MastershipChangeServiceManagerImpl
 
- 
- All Implemented Interfaces:
- AutoCloseable,- OwnershipChangeListener,- ReconciliationFrameworkRegistrar,- MastershipChangeServiceManager
 
 @Singleton public final class MastershipChangeServiceManagerImpl extends Object implements MastershipChangeServiceManager 
- 
- 
Constructor SummaryConstructors Constructor Description MastershipChangeServiceManagerImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbecomeMaster(@NonNull DeviceInfo deviceInfo)This event is called when device is fully mastered.com.google.common.util.concurrent.ListenableFuture<ResultState>becomeMasterBeforeSubmittedDS(@NonNull DeviceInfo deviceInfo)Should be called when device is being mastered as inOwnershipChangeListener.becomeMaster(DeviceInfo).voidbecomeSlaveOrDisconnect(@NonNull DeviceInfo deviceInfo)Should be called when device is disconnected or going to be slaved.voidclose()booleanisReconciliationFrameworkRegistered()Check if reconciliation framework is registered.ReconciliationFrameworkRegistrationreconciliationFrameworkRegistration(@NonNull ReconciliationFrameworkEvent reconciliationFrameworkEvent)Setter for reconciliation framework event listener.@NonNull MastershipChangeRegistrationregister(@NonNull MastershipChangeService service)Register of mastership change listener.voidsetMasterChecker(@NonNull MasterChecker masterChecker)Set the device mastership checker.
 
- 
- 
- 
Method Detail- 
registerpublic @NonNull MastershipChangeRegistration register(@NonNull MastershipChangeService service) Description copied from interface:MastershipChangeServiceManagerRegister of mastership change listener. Returned registration need to be closed by client. It doesn't contain event for reconciliation framework event.- Specified by:
- registerin interface- MastershipChangeServiceManager
- Parameters:
- service- implementation of- MastershipChangeService
- Returns:
- registration
- See Also:
- ReconciliationFrameworkEvent
 
 - 
reconciliationFrameworkRegistrationpublic ReconciliationFrameworkRegistration reconciliationFrameworkRegistration(@NonNull ReconciliationFrameworkEvent reconciliationFrameworkEvent) throws MastershipChangeException Description copied from interface:MastershipChangeServiceManagerSetter for reconciliation framework event listener. It can be registered only once. Another registrations will throw an exception- Specified by:
- reconciliationFrameworkRegistrationin interface- MastershipChangeServiceManager
- Parameters:
- reconciliationFrameworkEvent- reconciliation framework
- Returns:
- registration object, which can be closed to unregister
- Throws:
- MastershipChangeException- if already reconciliation framework registered
 
 - 
closepublic void close() - Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- MastershipChangeServiceManager
 
 - 
becomeMasterpublic void becomeMaster(@NonNull DeviceInfo deviceInfo) Description copied from interface:OwnershipChangeListenerThis event is called when device is fully mastered. All condition have to been done successful.- Transaction chain created
- RPC services started
- Initial statistics gathering.
- Initial DS submit.
- Flow registry filled. - this step is not mandatory
 - Specified by:
- becomeMasterin interface- OwnershipChangeListener
- Parameters:
- deviceInfo- connected switch identification
 
 - 
becomeSlaveOrDisconnectpublic void becomeSlaveOrDisconnect(@NonNull DeviceInfo deviceInfo) Description copied from interface:OwnershipChangeListenerShould be called when device is disconnected or going to be slaved.- Specified by:
- becomeSlaveOrDisconnectin interface- OwnershipChangeListener
- Parameters:
- deviceInfo- connected switch identification
 
 - 
becomeMasterBeforeSubmittedDSpublic com.google.common.util.concurrent.ListenableFuture<ResultState> becomeMasterBeforeSubmittedDS(@NonNull DeviceInfo deviceInfo) Description copied from interface:OwnershipChangeListenerShould be called when device is being mastered as inOwnershipChangeListener.becomeMaster(DeviceInfo).But before: Initial DS submit This is special call designed only for reconciliation framework.- Specified by:
- becomeMasterBeforeSubmittedDSin interface- OwnershipChangeListener
- Parameters:
- deviceInfo- connected switch identification
- Returns:
- future to be able handle device after reconciliation
- See Also:
- OwnershipChangeListener.becomeMaster(DeviceInfo),- ReconciliationFrameworkRegistrar.isReconciliationFrameworkRegistered()
 
 - 
setMasterCheckerpublic void setMasterChecker(@NonNull MasterChecker masterChecker) Description copied from interface:OwnershipChangeListenerSet the device mastership checker.- Specified by:
- setMasterCheckerin interface- OwnershipChangeListener
- Parameters:
- masterChecker-- MasterChecker
 
 - 
isReconciliationFrameworkRegisteredpublic boolean isReconciliationFrameworkRegistered() Description copied from interface:ReconciliationFrameworkRegistrarCheck if reconciliation framework is registered. If not the eventOwnershipChangeListener.becomeMasterBeforeSubmittedDS(DeviceInfo)will not be triggered.- Specified by:
- isReconciliationFrameworkRegisteredin interface- ReconciliationFrameworkRegistrar
- Returns:
- true if there exists any reconciliation framework registration
 
 
- 
 
-