public class KingState extends java.lang.Object implements IBlaubotState
| Constructor and Description |
|---|
KingState() |
| Modifier and Type | Method and Description |
|---|---|
void |
handleState(StateMachineSession session)
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 |
setPeasantConnectionsListener(IBlaubotIncomingConnectionListener peasantConnectionsListener) |
java.lang.String |
toString() |
public IBlaubotState onConnectionEstablished(IBlaubotConnection connection)
IBlaubotStateIBlaubotDevice was established.onConnectionEstablished in interface IBlaubotStateconnection - the established connectionpublic IBlaubotState onConnectionClosed(IBlaubotConnection connection)
IBlaubotStateIBlaubotDevice
was closed due to an exception or intentionally.onConnectionClosed in interface IBlaubotStateconnection - the closed connectionpublic IBlaubotState onDeviceDiscoveryEvent(AbstractBlaubotDeviceDiscoveryEvent discoveryEvent)
IBlaubotStateIBlaubotBeacon discovered a IBlaubotDevice.
Note:
For each discoverable IBlaubotState a corresponding AbstractBlaubotDeviceDiscoveryEvent
subclass can be found in the de.hsrm.blaubot.statemachine.events package.onDeviceDiscoveryEvent in interface IBlaubotStatediscoveryEvent - the discovery event.public void handleState(StateMachineSession session)
IBlaubotStateConnectionStateMachine.handleState in interface IBlaubotStatesession - a session object with access to the relevant Blaubot components.public IBlaubotState onAdminMessage(AbstractAdminMessage adminMessage)
IBlaubotStateAbstractAdminMessage was received.onAdminMessage in interface IBlaubotStateadminMessage - the received admin messagepublic java.lang.String toString()
toString in class java.lang.Objectpublic IBlaubotState onTimeoutEvent(AbstractTimeoutStateMachineEvent timeoutEvent)
IBlaubotStateIBlaubotStates.
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.onTimeoutEvent in interface IBlaubotStatetimeoutEvent - the occured eventpublic void setPeasantConnectionsListener(IBlaubotIncomingConnectionListener peasantConnectionsListener)