public interface ILifecycleListener
ILifecycleListener
can be registered withModifier and Type | Method and Description |
---|---|
void |
onConnected()
Triggered when the
Blaubot instance becomes part of a blaubot kingdom. |
void |
onDeviceJoined(IBlaubotDevice blaubotDevice)
Triggered when another
Blaubot instance on another IBlaubotDevice joined the network. |
void |
onDeviceLeft(IBlaubotDevice blaubotDevice)
Triggered when an
IBlaubotDevice left the blaubot kingdom. |
void |
onDisconnected()
Triggered when the
Blaubot instance is no longer part of a blaubot kingdom. |
void |
onKingDeviceChanged(IBlaubotDevice oldKing,
IBlaubotDevice newKing)
Triggered when the king device was changed.
|
void |
onPrinceDeviceChanged(IBlaubotDevice oldPrince,
IBlaubotDevice newPrince)
Triggered when a prince nomination was completed.
|
void onConnected()
Blaubot
instance becomes part of a blaubot kingdom.void onDisconnected()
Blaubot
instance is no longer part of a blaubot kingdom.void onDeviceJoined(IBlaubotDevice blaubotDevice)
Blaubot
instance on another IBlaubotDevice
joined the network.
It is guaranteed that for one specific IBlaubotDevice
onDeviceJoined(IBlaubotDevice)
is never called twice without a triggered onDeviceLeft(IBlaubotDevice)
in between.blaubotDevice
- the joined devicevoid onDeviceLeft(IBlaubotDevice blaubotDevice)
IBlaubotDevice
left the blaubot kingdom.blaubotDevice
- the device that just leftvoid onPrinceDeviceChanged(IBlaubotDevice oldPrince, IBlaubotDevice newPrince)
oldPrince
- the old prince (may be null, in case no prince was nominated previously)newPrince
- the new prince (may be null, in case there is no device to be prince)void onKingDeviceChanged(IBlaubotDevice oldKing, IBlaubotDevice newKing)
oldKing
- the old kingnewKing
- the new king