com.abiquo.api.resources.SquidFakeResource Class Reference

This class represents a SquidFakeResource, and it emulates the behavior of an SquidResource, but without needing an actual Squid device on the middlewares. More...

Inherits ResourceInstance.

List of all members.

Public Member Functions

 SquidFakeResource ()
 Creates a new SquidFakeResource with the default values.
 SquidFakeResource (ResourceInstance resourceInstance)
 Creates a new SquidFakeResource based on a generic ResourceInstance.
Job getSample (String sensor)
 Creates a new Job which once executed, returns the last value returned by this method plus one, starting with zero.
Job getSamples ()
 Creates a new Job which once executed, returns the last value returned by this method plus one, starting with zero.

Static Public Member Functions

static SquidFakeResource cast (ResourceInstance resourceInstance)
 Converts a generic ResourceInstance into a new one of type SquidFakeResource.

Static Public Attributes

static final String ID = "SquidFake"
 String containing the identifier for this resource.


Detailed Description

This class represents a SquidFakeResource, and it emulates the behavior of an SquidResource, but without needing an actual Squid device on the middlewares.

It is conceived to do some tests easily, therefore reducing dependencies.

See also:
SquidPlusResource

Constructor & Destructor Documentation

com.abiquo.api.resources.SquidFakeResource.SquidFakeResource ( ResourceInstance  resourceInstance  ) 

Creates a new SquidFakeResource based on a generic ResourceInstance.

Parameters:
resourceInstance The generic ResourceInstance


Member Function Documentation

static SquidFakeResource com.abiquo.api.resources.SquidFakeResource.cast ( ResourceInstance  resourceInstance  )  [static]

Converts a generic ResourceInstance into a new one of type SquidFakeResource.

Parameters:
resourceInstance The generic ResourceInstance
Returns:
The resultant SquidFakeResource

Job com.abiquo.api.resources.SquidFakeResource.getSample ( String  sensor  ) 

Creates a new Job which once executed, returns the last value returned by this method plus one, starting with zero.

Note:
The value represents the captured value of a sensor.
Parameters:
sensor An string containing the name of the sensor which we want to capture. Sample values: humidity, lightness, temperature.
Returns:
The Job to perform the demand

Job com.abiquo.api.resources.SquidFakeResource.getSamples (  ) 

Creates a new Job which once executed, returns the last value returned by this method plus one, starting with zero.

Note:
The value represents the captured value of a sensor. It has the same logic as getSample(), but returning different values, each for the existing sensors.
Returns:
The Job to perform the demand


Member Data Documentation

final String com.abiquo.api.resources.SquidFakeResource.ID = "SquidFake" [static]

String containing the identifier for this resource.

Note:
To avoid misspellings when provision a resource, you should use this constant ID instead of a manually typed string.


The documentation for this class was generated from the following file:

Generated on Mon Sep 15 20:13:10 2008 for FrameworkAPI by  doxygen 1.5.5