|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.sensorshell.command.Command
org.hackystat.sensorshell.command.SensorDataCommand
public class SensorDataCommand
Implements the SensorData commands, of which there is "add", "send", and "statechange".
Field Summary |
---|
Fields inherited from class org.hackystat.sensorshell.command.Command |
---|
cr, email, host, password, properties, shell |
Constructor Summary | |
---|---|
SensorDataCommand(SingleSensorShell shell,
SensorShellProperties properties,
PingCommand pingCommand,
org.hackystat.sensorbase.client.SensorBaseClient client)
Creates the SensorDataCommand. |
Method Summary | |
---|---|
void |
add(java.util.Map<java.lang.String,java.lang.String> keyValMap)
Given a Map containing key-value pairs corresponding to SensorData fields and properties, constructs a SensorData instance and stores it for subsequent sending to the SensorBase. |
void |
add(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
Adds the SensorData instance, invoking send if the max buffer size has been exceeded. |
long |
getTotalSent()
Returns the total number of sensor data instances sent so far. |
boolean |
hasUnsentData()
Returns true if this SensorDataCommand instance has remaining unsent data. |
int |
send()
Sends accumulated data, including offline and current data from the AddCommand. |
void |
statechange(long resourceCheckSum,
java.util.Map<java.lang.String,java.lang.String> keyValMap)
Provides an easy way for sensors to implement "StateChange" behavior. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SensorDataCommand(SingleSensorShell shell, SensorShellProperties properties, PingCommand pingCommand, org.hackystat.sensorbase.client.SensorBaseClient client)
shell
- The sensorshell.properties
- The sensorproperties.pingCommand
- The Ping Command.client
- The SensorBase client.Method Detail |
---|
public int send() throws SensorShellException
SensorShellException
- If problems occur sending the data.public void add(java.util.Map<java.lang.String,java.lang.String> keyValMap) throws SensorShellException
keyValMap
- The map of key-value pairs.
SensorShellException
- If problems occur sending the data.public void add(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data) throws SensorShellException
data
- The SensorData instance to be added.
SensorShellException
- If problems occur sending the data.public void statechange(long resourceCheckSum, java.util.Map<java.lang.String,java.lang.String> keyValMap) throws java.lang.Exception
resourceCheckSum
- Indicates the state of the resource, typically via its size.keyValMap
- The map of key-value pairs.
java.lang.Exception
- If problems occur while invoking the 'add' command.public long getTotalSent()
public boolean hasUnsentData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |