public class BlaubotBeaconService
extends java.lang.Object
IBlaubotConnection
from a IBlaubotBeacon
the BeaconService exchanges State
s
with the remote peer.
The remote beacon implementation will most likely use the ExchangeStatesTask
to exchange their state with the
BeaconConnectionHandler
of this objects.Constructor and Description |
---|
BlaubotBeaconService(IBlaubotDevice ownDevice,
java.util.List<IBlaubotBeacon> blaubotBeacons,
java.util.List<IBlaubotConnectionAcceptor> connectionAcceptors,
ConnectionStateMachine connectionStateMachine) |
Modifier and Type | Method and Description |
---|---|
void |
addDiscoveryEventListener(IBlaubotDiscoveryEventListener discoveryEventListener)
Adds an
IBlaubotDiscoveryEventListener to the beacon service. |
java.util.List<IBlaubotBeacon> |
getBeacons()
Get all managed beacons
|
IBlaubotBeaconStore |
getBeaconStore()
Get the beacon store corresponding to the managed beacons
|
BeaconMessage |
getCurrentBeaconMessage()
The current beacon message holding our state and connection meta data
|
void |
onStateChanged(IBlaubotState newState)
Informs the BlaubotBeaconService that the blaubot connection state has changed.
|
void |
removeDiscoveryEventListener(IBlaubotDiscoveryEventListener discoveryEventListener)
Removes a listener
|
void |
startBeaconInterfaces() |
void |
stopBeaconInterfaces() |
public BlaubotBeaconService(IBlaubotDevice ownDevice, java.util.List<IBlaubotBeacon> blaubotBeacons, java.util.List<IBlaubotConnectionAcceptor> connectionAcceptors, ConnectionStateMachine connectionStateMachine)
ownDevice
- our own deviceblaubotBeacons
- the list of beacons to be managedconnectionAcceptors
- the acceptors to be exposed by the beaconsconnectionStateMachine
- the connection state machine which state should be exposed by the beaconspublic void addDiscoveryEventListener(IBlaubotDiscoveryEventListener discoveryEventListener)
IBlaubotDiscoveryEventListener
to the beacon service.
The listeners are called for each discovery event of any IBlaubotBeacon
.discoveryEventListener
- the listener to be addedpublic void removeDiscoveryEventListener(IBlaubotDiscoveryEventListener discoveryEventListener)
discoveryEventListener
- the listener to be removedpublic void startBeaconInterfaces()
public void stopBeaconInterfaces()
public void onStateChanged(IBlaubotState newState)
newState
- the new statepublic java.util.List<IBlaubotBeacon> getBeacons()
public IBlaubotBeaconStore getBeaconStore()
public BeaconMessage getCurrentBeaconMessage()