Interface ContextChainMastershipWatcher
-
- All Known Subinterfaces:
ContextChainHolder
- All Known Implementing Classes:
ContextChainHolderImpl
public interface ContextChainMastershipWatcher
Watcher if able to start mastership for device.- Since:
- 0.4.0 Carbon
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
onMasterRoleAcquired(DeviceInfo deviceInfo, @NonNull ContextChainMastershipState mastershipState)
Changed to MASTER role on device.void
onNotAbleToStartMastership(DeviceInfo deviceInfo, String reason, boolean mandatory)
Event occurs if there was a try to acquire MASTER role.default void
onNotAbleToStartMastershipMandatory(DeviceInfo deviceInfo, String reason)
Event occurs if there was a try to acquire MASTER role.void
onSlaveRoleAcquired(DeviceInfo deviceInfo)
Change to SLAVE role on device was successful.void
onSlaveRoleNotAcquired(DeviceInfo deviceInfo, String reason)
Change to SLAVE role on device was not able.
-
-
-
Method Detail
-
onNotAbleToStartMastership
void onNotAbleToStartMastership(DeviceInfo deviceInfo, String reason, boolean mandatory)
Event occurs if there was a try to acquire MASTER role. But it was not possible to start this MASTER role on device.- Parameters:
deviceInfo
- connected switch identificationreason
- reasonmandatory
- if it is mandatory connection will be dropped
-
onNotAbleToStartMastershipMandatory
default void onNotAbleToStartMastershipMandatory(DeviceInfo deviceInfo, String reason)
Event occurs if there was a try to acquire MASTER role. But it was not possible to start this MASTER role on device.- Parameters:
deviceInfo
- connected switch identificationreason
- reason
-
onMasterRoleAcquired
void onMasterRoleAcquired(DeviceInfo deviceInfo, @NonNull ContextChainMastershipState mastershipState)
Changed to MASTER role on device.- Parameters:
deviceInfo
- connected switch identificationmastershipState
- state
-
onSlaveRoleAcquired
void onSlaveRoleAcquired(DeviceInfo deviceInfo)
Change to SLAVE role on device was successful.- Parameters:
deviceInfo
- connected switch identification
-
onSlaveRoleNotAcquired
void onSlaveRoleNotAcquired(DeviceInfo deviceInfo, String reason)
Change to SLAVE role on device was not able.- Parameters:
deviceInfo
- connected switch identificationreason
- reason
-
-