lime.motes
Class LimeMoteReaction

java.lang.Object
  extended bymoteaccess.MoteReaction
      extended bylime.motes.LimeMoteReaction

public class LimeMoteReaction
extends MoteReaction

This class extends MoteReaction in order to exploit the injection of a reaction with the MoteAccess module.

Version:
1.0 alpha
Author:
Carlo Curino, Matteo Giani, Marco Giorgetta, Alessandro Giusti
See Also:
MoteReaction

Field Summary
 
Fields inherited from class moteaccess.MoteReaction
cond, mid, persistentMode, st
 
Constructor Summary
LimeMoteReaction(MoteID mid, SensorType stype, Condition cond, java.lang.Boolean oncepertuple)
           
LimeMoteReaction(MoteID mid, SensorType stype, IAggregationOptions aggOpts, Condition cond, java.lang.Boolean oncepertuple)
           
 
Method Summary
static LimeMoteReaction fromAggrTuple(lights.interfaces.ITuple tuple)
          This method returns a LimeMoteReaction object built from a Tuple that refers to a request for a reaction on aggregated data.
static LimeMoteReaction fromTuple(lights.interfaces.ITuple t)
          This method returns a LimeMoteReaction object built from a Tuple.
 java.lang.Boolean getOncePerTupleMode()
           
 
Methods inherited from class moteaccess.MoteReaction
getCondition, getMoteID, getSensorType, isOnce, isPersistent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimeMoteReaction

public LimeMoteReaction(MoteID mid,
                        SensorType stype,
                        Condition cond,
                        java.lang.Boolean oncepertuple)

LimeMoteReaction

public LimeMoteReaction(MoteID mid,
                        SensorType stype,
                        IAggregationOptions aggOpts,
                        Condition cond,
                        java.lang.Boolean oncepertuple)
Method Detail

getOncePerTupleMode

public java.lang.Boolean getOncePerTupleMode()

fromTuple

public static LimeMoteReaction fromTuple(lights.interfaces.ITuple t)
                                  throws BadRequestFormatException
This method returns a LimeMoteReaction object built from a Tuple. Typically needed when the MoteAgent reacts to a request for a reaction, and needs to inject it to the motes network via the MoteAccess. This method builds the MoteRequest as needed by the MoteAccess.

Parameters:
t - the tuple that describes the request. No check is made on the tuple.
Returns:
a LimeMoteReaction object that describes the reaction to the MoteAccess.
Throws:
BadRequestFormatException

fromAggrTuple

public static LimeMoteReaction fromAggrTuple(lights.interfaces.ITuple tuple)
                                      throws BadRequestFormatException
This method returns a LimeMoteReaction object built from a Tuple that refers to a request for a reaction on aggregated data. Typically needed when the MoteAgent reacts to a request for a reaction, and needs to inject it to the motes network via the MoteAccess. This method builds the MoteRequest as needed by the MoteAccess.

Returns:
a LimeMoteReaction object that describes the reaction to the MoteAccess.
Throws:
BadRequestFormatException