From 50e90fa8de7c9c119c9dcdd513f9a685911e5eed Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 23 Oct 2015 01:04:32 +0530 Subject: [PATCH] generalizing inmemory map into any sensor --- ...mperatureRecord.java => DeviceRecord.java} | 4 ++-- .../service/impl/dao/SensorRecord.java | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) rename modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/{TemperatureRecord.java => DeviceRecord.java} (92%) create mode 100644 modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/SensorRecord.java diff --git a/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/TemperatureRecord.java b/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/DeviceRecord.java similarity index 92% rename from modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/TemperatureRecord.java rename to modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/DeviceRecord.java index 3b3074c9..c4358ae2 100644 --- a/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/TemperatureRecord.java +++ b/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/DeviceRecord.java @@ -20,11 +20,11 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement -public class TemperatureRecord { +public class DeviceRecord { private double temperature; private long time; - public TemperatureRecord(double temperature, long time) { + public DeviceRecord(double temperature, long time) { this.temperature = temperature; this.time = time; } diff --git a/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/SensorRecord.java b/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/SensorRecord.java new file mode 100644 index 00000000..e52e722c --- /dev/null +++ b/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/dao/SensorRecord.java @@ -0,0 +1,24 @@ +package org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl.dao; + +import javax.xml.bind.annotation.XmlElement; + +public class SensorRecord { + private String sensorValue; + private long time; + + public SensorRecord(String sensorValue, long time) { + this.sensorValue = sensorValue; + this.time = time; + } + + @XmlElement + public String getSensorValue() { + return sensorValue; + } + + @XmlElement + public long getTime() { + return time; + } + +} \ No newline at end of file