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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbecomeMaster(@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()booleanCheck if reconciliation framework is registered.reconciliationFrameworkRegistration(@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.
-
Constructor Details
-
MastershipChangeServiceManagerImpl
public MastershipChangeServiceManagerImpl()
-
-
Method Details
-
register
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 interfaceMastershipChangeServiceManager- Parameters:
service- implementation ofMastershipChangeService- Returns:
- registration
- See Also:
-
reconciliationFrameworkRegistration
public 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 interfaceMastershipChangeServiceManager- Parameters:
reconciliationFrameworkEvent- reconciliation framework- Returns:
- registration object, which can be closed to unregister
- Throws:
MastershipChangeException- if already reconciliation framework registered
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceMastershipChangeServiceManager
-
becomeMaster
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 interfaceOwnershipChangeListener- Parameters:
deviceInfo- connected switch identification
-
becomeSlaveOrDisconnect
Description copied from interface:OwnershipChangeListenerShould be called when device is disconnected or going to be slaved.- Specified by:
becomeSlaveOrDisconnectin interfaceOwnershipChangeListener- Parameters:
deviceInfo- connected switch identification
-
becomeMasterBeforeSubmittedDS
public 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 interfaceOwnershipChangeListener- Parameters:
deviceInfo- connected switch identification- Returns:
- future to be able handle device after reconciliation
- See Also:
-
setMasterChecker
Description copied from interface:OwnershipChangeListenerSet the device mastership checker.- Specified by:
setMasterCheckerin interfaceOwnershipChangeListener- Parameters:
masterChecker-MasterChecker
-
isReconciliationFrameworkRegistered
public 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 interfaceReconciliationFrameworkRegistrar- Returns:
- true if there exists any reconciliation framework registration
-