Consumers of Measurement Data

With the abstract class DataConsumer it is possible to define custom data processing functionality. Simply extend this class and add it as SDKDataListener to the SDK.

Send Measurement Data to Restful Web Services

Use the class RestDataConsumer to send measurement data to a rest web web service. To get result from this data consumer add an implementation of the listener interface RestDataConsumerListener to it.

// define a data consumer
DataConsumer restDataConsumer = new RestDataConsumer("www.medicalWebService.com");
restDataConsumer.addRestDataConsumerListener(
    new CustomRestDataConsumerListener());
// connect the data consumer with the sdk
sdk.addSDKDataListener(restDataConsumer);

The generated xml data for blood pressure measurements will be the following:

<?xml version="1.0" encoding="UTF-8"?>
<blood-pressure-measurement>
    <manually-entered type="boolean">false</manually-entered>
    <timestamp type="datetime">2008-05-14T20:16:00+00:00</timestamp>
    <user-id type="integer">1</user-id>
    <systolic>
        <value type="decimal">120.0</value>
    </systolic>
    <diastolic>
        <value type="decimal">80.0</value>
    </diastolic>
    <pulse>
        <value type="integer">60</value>
    </pulse>
</blood-pressure-measurement>

 
SourceForge.net Logo