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
IBlaubotState s. |
void |
setPeasantConnectionsListener(IBlaubotIncomingConnectionListener peasantConnectionsListener) |
java.lang.String |
toString() |
public IBlaubotState onConnectionEstablished(IBlaubotConnection connection)
IBlaubotState
IBlaubotDevice
was established.onConnectionEstablished
in interface IBlaubotState
connection
- the established connectionpublic IBlaubotState onConnectionClosed(IBlaubotConnection connection)
IBlaubotState
IBlaubotDevice
was closed due to an exception or intentionally.onConnectionClosed
in interface IBlaubotState
connection
- the closed connectionpublic IBlaubotState onDeviceDiscoveryEvent(AbstractBlaubotDeviceDiscoveryEvent discoveryEvent)
IBlaubotState
IBlaubotBeacon
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 IBlaubotState
discoveryEvent
- the discovery event.public void handleState(StateMachineSession session)
IBlaubotState
ConnectionStateMachine
.handleState
in interface IBlaubotState
session
- a session object with access to the relevant Blaubot
components.public IBlaubotState onAdminMessage(AbstractAdminMessage adminMessage)
IBlaubotState
AbstractAdminMessage
was received.onAdminMessage
in interface IBlaubotState
adminMessage
- the received admin messagepublic java.lang.String toString()
toString
in class java.lang.Object
public IBlaubotState onTimeoutEvent(AbstractTimeoutStateMachineEvent timeoutEvent)
IBlaubotState
IBlaubotState
s.
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 IBlaubotState
timeoutEvent
- the occured eventpublic void setPeasantConnectionsListener(IBlaubotIncomingConnectionListener peasantConnectionsListener)