|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.biocomfort.TO.data_consumer.DataConsumer com.biocomfort.TO.data_consumer.RestDataConsumer
public class RestDataConsumer
The class RestDataConsumer is a concrete implementation of the
DataConsumer class that will send the received measurement data
to a restful web service.
The received measurement data is transformed into XML and sent as POST data
to the following URLs:
<?xml version="1.0" encoding="UTF-8"?> <blood-pressure-measurement> <manually-entered type="boolean">false</manually-entered> <timestamp type="datetime">2008-05-13T12:00:00+00:00</timestamp> <user-id nil="true" type="integer"/> <systolic> <value type="decimal">121.0</value> </systolic> <diastolic> <value type="decimal">82.0</value> </diastolic> <pulse> <value type="integer">93</value> </pulse> </blood-pressure-measurement>The data of blood glucose monitors is transformed into the following XML format:
<?xml version="1.0" encoding="UTF-8"?> <blood-glucose-measurement> <manually-entered type="boolean">false</manually-entered> <timestamp type="datetime">2008-05-13T12:00:00+00:00</timestamp> <user-id nil="true" type="integer"/> <glucose> <value type="decimal">123.0</value> </glucose> </blood-glucose-measurement>The data of body diagnostic scales is transformed into the following XML format:
<?xml version="1.0" encoding="UTF-8"?> <body-weight-measurement> <manually-entered type="boolean">false</manually-entered> <timestamp type="datetime">2008-05-13T12:00:00+00:00</timestamp> <user-id nil="true" type="integer"/> <weight> <value type="decimal">80.0</value> </weight> <impedance> <value type="decimal">600.0</value> </impedance> <body-fat> <value type="decimal">20.0</value> </body-fat> <body-water> <value type="decimal">60.0</value> </body-water> <muscle-mass> <value type="decimal">22.0</value> </muscle-mass> </body-weight-measurement>In order to process measurement data with an object of this data consumer register an instance with a SDK implementation by calling the method SDK.addSDKDataListener(SDKDataListener).
SDK.addSDKDataListener(SDKDataListener)
Constructor Summary | |
---|---|
RestDataConsumer(java.lang.String urlString)
Constructs a RestDataConsumer object with specifying the
URL string by the given parameter urlString. |
Method Summary | |
---|---|
java.lang.String |
getUrlString()
Returns the URL string thats represents the URL basis to which the transformed measurement data is sent. |
boolean |
isEnabledBloodGlucoseProcessing()
Returns true if the processing of received blood glucose measurement data is enabled, false otherwise. |
boolean |
isEnabledBloodPressureProcessing()
Returns true if the processing of received blood pressure measurement data is enabled, false otherwise. |
boolean |
isEnabledWeightProcessing()
Returns true if the processing of received weight measurement data is enabled, false otherwise. |
protected void |
processData(MedicalDeviceTO medicalDevice,
TO data)
Sends the received measurement data to a restful web service in case that the processing for the corresponding measurement data type is enabled. |
void |
setEnabledBloodGlucoseProcessing(boolean enabled)
Enables or disables the processing of received blood glucose measurement data. |
void |
setEnabledBloodPressureProcessing(boolean enabled)
Enables or disables the processing of received blood pressure measurement data. |
void |
setEnabledWeightProcessing(boolean enabled)
Enables or disables the processing of received weight measurement data. |
void |
setUrlString(java.lang.String urlString)
Sets the URL string thats represents the URL basis to which the transformed measurement data is sent. |
Methods inherited from class com.biocomfort.TO.data_consumer.DataConsumer |
---|
addDataConsumerListener, fireOnErrorEvent, fireOnSuccessEvent, isEnabled, onDataReceived, removeDataConsumerListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RestDataConsumer(java.lang.String urlString)
RestDataConsumer
object with specifying the
URL string by the given parameter urlString.
urlString
- SDK.addSDKDataListener(SDKDataListener)
Method Detail |
---|
public java.lang.String getUrlString()
public void setUrlString(java.lang.String urlString)
urlString
- the new URL string basisprotected void processData(MedicalDeviceTO medicalDevice, TO data)
processData
in class DataConsumer
medicalDevice
- the medical device that sends the datadata
- the received measurement datasetEnabledBloodPressureProcessing(boolean)
,
setEnabledBloodGlucoseProcessing(boolean)
,
setEnabledWeightProcessing(boolean)
,
setUrlString(String)
public boolean isEnabledBloodPressureProcessing()
public void setEnabledBloodPressureProcessing(boolean enabled)
enabled
- true to enable the processing of blood
pressure measurementspublic boolean isEnabledBloodGlucoseProcessing()
public void setEnabledBloodGlucoseProcessing(boolean enabled)
enabled
- true to enable the processing of blood
glucose measurementspublic boolean isEnabledWeightProcessing()
public void setEnabledWeightProcessing(boolean enabled)
enabled
- true to enable the processing of weight
measurements
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |