public interface IBlaubotState
ConnectionStateMachine.
A state may do it's setup in the handleState() method and wait for
events received from it's on...() methods.
These methods are partly equivalent to the IBlaubotConnectionManagerListener and
IBlaubotDiscoveryEventListener methods.
After each call of one of the on...() methods, a IBlaubotState has
to be returned. If the ConnectionStateMachine should stay in
the current state (this), simply return this - the state will not be dismissed
then.
If a state is dismissed by the ConnectionStateMachine, the onDismiss()
method will be called to allow a state to clean up.| Modifier and Type | Method and Description |
|---|---|
void |
handleState(StateMachineSession stateMachineSession)
Gets called if this state was set as currentState by the
ConnectionStateMachine. |
IBlaubotState |
onAdminMessage(AbstractAdminMessage adminMessage)
Gets called when an
AbstractAdminMessage was received. |
IBlaubotState |
onConnectionClosed(IBlaubotConnection connection)
Gets called if a previously established connection from a remote
IBlaubotDevice
was closed due to an exception or intentionally. |
IBlaubotState |
onConnectionEstablished(IBlaubotConnection connection)
Gets called if a new connection from a remote
IBlaubotDevice was established. |
IBlaubotState |
onDeviceDiscoveryEvent(AbstractBlaubotDeviceDiscoveryEvent discoveryEvent)
Gets called if a
IBlaubotBeacon discovered a IBlaubotDevice. |
IBlaubotState |
onTimeoutEvent(AbstractTimeoutStateMachineEvent timeoutEvent)
This is a helper for Timeout-Events needed for some
IBlaubotStates. |
void handleState(StateMachineSession stateMachineSession)
ConnectionStateMachine.stateMachineSession - a session object with access to the relevant Blaubot components.IBlaubotState onAdminMessage(AbstractAdminMessage adminMessage)
AbstractAdminMessage was received.adminMessage - the received admin messageIBlaubotState onDeviceDiscoveryEvent(AbstractBlaubotDeviceDiscoveryEvent discoveryEvent)
IBlaubotBeacon discovered a IBlaubotDevice.
Note:
For each discoverable IBlaubotState a corresponding AbstractBlaubotDeviceDiscoveryEvent
subclass can be found in the de.hsrm.blaubot.statemachine.events package.discoveryEvent - the discovery event.IBlaubotState onConnectionEstablished(IBlaubotConnection connection)
IBlaubotDevice was established.connection - the established connectionIBlaubotState onConnectionClosed(IBlaubotConnection connection)
IBlaubotDevice
was closed due to an exception or intentionally.connection - the closed connectionIBlaubotState onTimeoutEvent(AbstractTimeoutStateMachineEvent timeoutEvent)
IBlaubotStates.
A IBlaubotState can subclass the AbstractTimeoutStateMachineEvent
and push it to the ConnectionStateMachine.
A timeout event contains the state that issued the timeout so a IBlaubotState
can check if the timeout event belongs to himself or ignore it when this is not the
case.timeoutEvent - the occured event