net.hivecell.hive.shadow
Interface LocustShadow

All Known Implementing Classes:
LocustShadowImpl

public interface LocustShadow
extends SerialStreamShadow


Method Summary
 void addListener(Signalable o)
          Clients can call this to add themselves as a listener to this type of event
 int getCount()
          Get a count of all the events sent out
 boolean isDeviceThere()
          query the shadow as to whether or not the device is still connected.
 void notifySubscribers()
          Send a null event out to all subscribers
 void notifySubscribers(java.lang.Object information)
          Send a specific object out to the subscribers
 boolean removeListener(Signalable o)
          Clients can call this to remove themselves as listeners of this event
 
Methods inherited from interface net.hivecell.hive.shadow.SerialStreamShadow
getBaudRate, getSerialPort, setBaudRate, setSerialPort
 

Method Detail

addListener

public void addListener(Signalable o)
Clients can call this to add themselves as a listener to this type of event
Parameters:
o - the client

removeListener

public boolean removeListener(Signalable o)
Clients can call this to remove themselves as listeners of this event
Parameters:
o - the client
Returns:
whether or not the object was actually removed

getCount

public int getCount()
Get a count of all the events sent out
Returns:
the count

notifySubscribers

public void notifySubscribers()
Send a null event out to all subscribers

notifySubscribers

public void notifySubscribers(java.lang.Object information)
Send a specific object out to the subscribers
Parameters:
information - the object to send

isDeviceThere

public boolean isDeviceThere()
Description copied from interface: StreamShadow
query the shadow as to whether or not the device is still connected. this allows the server to remove shadows that are no longer connected to devices. in practice, implementations should err on the side of returning true, rather than false.