public abstract class GeoLocationBeacon extends java.lang.Object implements IBlaubotBeacon
| Constructor and Description |
|---|
GeoLocationBeacon(IBlaubotBeaconStore beaconStore,
IBlaubotConnector... connectors) |
| Modifier and Type | Method and Description |
|---|---|
IBlaubotAdapter |
getAdapter()
Get the adapter of which this acceptor is part of.
|
ConnectionMetaDataDTO |
getConnectionMetaData()
Get the connection meta data needed to connect to this connector
This infos can range from mac addresses over ip addresses to port numbers.
|
boolean |
isStarted()
Retrieves the started state of this acceptor.
|
void |
onConnectionStateMachineStateChanged(IBlaubotState state)
Called when the
ConnectionStateMachine's state has changed. |
void |
setAcceptorListener(IBlaubotIncomingConnectionListener acceptorListener)
Sets a listener that receives callbacks whenever a connection was accepted by the acceptor.
|
void |
setBeaconStore(IBlaubotBeaconStore beaconStore)
Setter method for the dependency injection of a beacon store.
|
void |
setBlaubot(Blaubot blaubot)
Dependency injecton of the blaubot instance the beacon is working for.
|
void |
setDiscoveryActivated(boolean active)
Enables and disables the discovery of other (remote) blaubot devices.
|
void |
setDiscoveryEventListener(IBlaubotDiscoveryEventListener discoveryEventListener)
Sets the discovery event listener which gets called whenever another remote device's
state was discovered by this beacon or the
BlaubotBeaconService. |
void |
setGeoData(GeoData geoData)
Sets the current geo data
|
void |
setListeningStateListener(IBlaubotListeningStateListener stateListener)
Sets a listener that receives callbacks, when the acceptor started accepting connections (is listening).
|
void |
startListening()
Starts the connection acceptor.
|
void |
stopListening()
Stops a running acceptor.
|
public GeoLocationBeacon(IBlaubotBeaconStore beaconStore, IBlaubotConnector... connectors)
beaconStore - The beacon store holding the connection meta data for the given connectors to connect to the GeoBeaconServer's acceptors.connectors - connectors to be used to establish a connection to the beacon serverpublic void setBlaubot(Blaubot blaubot)
IBlaubotBeaconsetBlaubot in interface IBlaubotBeaconblaubot - the blaubot instancepublic void setBeaconStore(IBlaubotBeaconStore beaconStore)
IBlaubotBeaconsetBeaconStore in interface IBlaubotBeaconsetBeaconStore in interface IBlaubotConnectionAcceptorbeaconStore - the beacon store implementationpublic IBlaubotAdapter getAdapter()
IBlaubotConnectionAcceptorgetAdapter in interface IBlaubotConnectionAcceptorpublic void startListening()
IBlaubotConnectionAcceptorstartListening in interface IBlaubotConnectionAcceptorpublic void stopListening()
IBlaubotConnectionAcceptorstopListening in interface IBlaubotConnectionAcceptorpublic boolean isStarted()
IBlaubotConnectionAcceptorisStarted in interface IBlaubotConnectionAcceptorpublic void setListeningStateListener(IBlaubotListeningStateListener stateListener)
IBlaubotConnectionAcceptorsetListeningStateListener in interface IBlaubotConnectionAcceptorstateListener - the listner to setpublic void setAcceptorListener(IBlaubotIncomingConnectionListener acceptorListener)
IBlaubotConnectionAcceptorsetAcceptorListener in interface IBlaubotConnectionAcceptoracceptorListener - the listener to be setpublic ConnectionMetaDataDTO getConnectionMetaData()
IBlaubotConnectionAcceptorgetConnectionMetaData in interface IBlaubotConnectionAcceptorpublic void setDiscoveryEventListener(IBlaubotDiscoveryEventListener discoveryEventListener)
IBlaubotBeaconBlaubotBeaconService.setDiscoveryEventListener in interface IBlaubotBeacondiscoveryEventListener - the listener to be setpublic void onConnectionStateMachineStateChanged(IBlaubotState state)
IBlaubotBeaconConnectionStateMachine's state has changed.
An implementation has to expose this state as soon as possible to compatible beacons.onConnectionStateMachineStateChanged in interface IBlaubotBeaconstate - the new state of the ConnectionStateMachinepublic void setDiscoveryActivated(boolean active)
IBlaubotBeaconsetDiscoveryActivated in interface IBlaubotBeaconactive - if set to true, the discovery (if running) will be active - inactive otherwisepublic void setGeoData(GeoData geoData)
geoData - the best known location of this device