public class BlaubotNFCBeacon extends java.lang.Object implements IBlaubotBeacon, IBlaubotAndroidComponent
Constructor and Description |
---|
BlaubotNFCBeacon() |
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 |
onNewIntent(Intent intent)
Gets called when a new intent was received on the foreground activity
|
void |
onPause(Activity context)
Gets called when onPause was called on the foreground activity
|
void |
onResume(Activity context)
Gets called when onResume was called on the foreground activity
|
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 |
setCurrentContext(Context context)
Gets called if the android context changes (onResume).
|
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 |
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 void setBlaubot(Blaubot blaubot)
IBlaubotBeacon
setBlaubot
in interface IBlaubotBeacon
blaubot
- the blaubot instancepublic void setBeaconStore(IBlaubotBeaconStore beaconStore)
IBlaubotBeacon
setBeaconStore
in interface IBlaubotBeacon
setBeaconStore
in interface IBlaubotConnectionAcceptor
beaconStore
- the beacon store implementationpublic IBlaubotAdapter getAdapter()
IBlaubotConnectionAcceptor
getAdapter
in interface IBlaubotConnectionAcceptor
public void startListening()
IBlaubotConnectionAcceptor
startListening
in interface IBlaubotConnectionAcceptor
public void stopListening()
IBlaubotConnectionAcceptor
stopListening
in interface IBlaubotConnectionAcceptor
public boolean isStarted()
IBlaubotConnectionAcceptor
isStarted
in interface IBlaubotConnectionAcceptor
public void setListeningStateListener(IBlaubotListeningStateListener stateListener)
IBlaubotConnectionAcceptor
setListeningStateListener
in interface IBlaubotConnectionAcceptor
stateListener
- the listner to setpublic void setAcceptorListener(IBlaubotIncomingConnectionListener acceptorListener)
IBlaubotConnectionAcceptor
setAcceptorListener
in interface IBlaubotConnectionAcceptor
acceptorListener
- the listener to be setpublic ConnectionMetaDataDTO getConnectionMetaData()
IBlaubotConnectionAcceptor
getConnectionMetaData
in interface IBlaubotConnectionAcceptor
public void setDiscoveryEventListener(IBlaubotDiscoveryEventListener discoveryEventListener)
IBlaubotBeacon
BlaubotBeaconService
.setDiscoveryEventListener
in interface IBlaubotBeacon
discoveryEventListener
- the listener to be setpublic void onConnectionStateMachineStateChanged(IBlaubotState state)
IBlaubotBeacon
ConnectionStateMachine
's state has changed.
An implementation has to expose this state as soon as possible to compatible beacons.onConnectionStateMachineStateChanged
in interface IBlaubotBeacon
state
- the new state of the ConnectionStateMachinepublic void setDiscoveryActivated(boolean active)
IBlaubotBeacon
setDiscoveryActivated
in interface IBlaubotBeacon
active
- if set to true, the discovery (if running) will be active - inactive otherwisepublic void setCurrentContext(Context context)
IBlaubotAndroidComponent
setCurrentContext
in interface IBlaubotAndroidComponent
context
- the contextpublic void onResume(Activity context)
IBlaubotAndroidComponent
onResume
in interface IBlaubotAndroidComponent
context
- the foregroudn activitypublic void onPause(Activity context)
IBlaubotAndroidComponent
onPause
in interface IBlaubotAndroidComponent
context
- the current android contextpublic void onNewIntent(Intent intent)
IBlaubotAndroidComponent
onNewIntent
in interface IBlaubotAndroidComponent
intent
- the new intent