org.gvsig.mobile.sensor.lib.spi
This component provides the API necessary to manage the sensor data providers. It has a *SensorProviderLocator* that is the entry point to the library and it is used to get the instance of the *SensorProviderManager*. This object is a singleton that can be used for:
* Register all the implementations of sensor data providers in loading time. These implementations are registered using the standard *Library* mechanism. The registered object is a *Factory* called *SensorProviderFactory* that is able to create a concrete *SensorProvider*.
* Retrieve a list of all the provider names that ara registered in the system.
* Create a *SensorProvider* using a name.
* Return the list of variables that the provider is able to create (they are used to replace the wildcards in the template)
The *SensorProviderFactory* is the responsible to create a *SensorProvider*. It knows the sensor name and it provides a basic template for both *RegisterSensor* and *InsertObservation* that are used if the templates are not find in the file system.
There are different implementation of *SensorProvider*'s. Every implementation is the responsible to get data from a physical sensor (or from other mechanism like a web server, other library...) and return a list ok key-value pairs with the retrieved values. This list of key-value pairs is used by the consumer (the *SensorDataUploadService* in this case) to replace the values in the template that is sent to the server.
Next sequence diagram shows how the system works:
.. image:: images/SequenceDiagramSPI.png
:align: center