public class BlaubotKingdom
extends java.lang.Object
Constructor and Description |
---|
BlaubotKingdom(IBlaubotDevice ownDevice,
IBlaubotDevice kingDevice) |
Modifier and Type | Method and Description |
---|---|
void |
addDisconnectListener(IBlaubotConnectionListener disconnectListener)
Adds a listener that gets invoked, if this kingdom disconnected
|
void |
addLifecycleListener(ILifecycleListener lifecycleListener)
Adds a listener to this kingdom's life cycle events
|
void |
disconnectKingdom()
Closes all connections and releases resources regarding this kingdom.
|
boolean |
equals(java.lang.Object o) |
BlaubotChannelManager |
getChannelManager()
The channel manage to manage channels.
|
IBlaubotDevice |
getKingDevice()
Returns the king device, which is the discriminator for a kingdom.
|
KingdomCensusLifecycleListener |
getKingdomCensusLifecycleListener()
A KingdomCensusLifecycleListener keeping track of the connected devices.
|
IBlaubotDevice |
getOwnDevice()
our own device
|
int |
hashCode() |
protected void |
manageConnection(BlaubotKingdomConnection connection)
Choses the connection to the kingDevice and starts the kingdom management.
|
void |
removeLifecycleListener(ILifecycleListener lifecycleListener)
Removes a listener to this kingdom's life cycle events
|
java.lang.String |
toString() |
public BlaubotKingdom(IBlaubotDevice ownDevice, IBlaubotDevice kingDevice)
ownDevice
- the own devicekingDevice
- the device object for the kingdom's king deviceprotected void manageConnection(BlaubotKingdomConnection connection)
connection
- the king-connection that is to be managed by this kingdom instancejava.lang.IllegalStateException
- if manageConncetion was called beforepublic void addDisconnectListener(IBlaubotConnectionListener disconnectListener)
disconnectListener
- the listenerpublic void disconnectKingdom()
public void addLifecycleListener(ILifecycleListener lifecycleListener)
lifecycleListener
- the listener to be addedpublic void removeLifecycleListener(ILifecycleListener lifecycleListener)
lifecycleListener
- the listener to be removedpublic BlaubotChannelManager getChannelManager()
public IBlaubotDevice getKingDevice()
public IBlaubotDevice getOwnDevice()
public KingdomCensusLifecycleListener getKingdomCensusLifecycleListener()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object