diff --git a/modules/samples/doormanager/component/analytics/build.xml b/modules/samples/doormanager/component/analytics/build.xml
index 8ae090c7..6a72f27e 100644
--- a/modules/samples/doormanager/component/analytics/build.xml
+++ b/modules/samples/doormanager/component/analytics/build.xml
@@ -20,9 +20,9 @@
-
+
-
+
diff --git a/modules/samples/doormanager/component/analytics/pom.xml b/modules/samples/doormanager/component/analytics/pom.xml
index efa32fef..f2935ab4 100644
--- a/modules/samples/doormanager/component/analytics/pom.xml
+++ b/modules/samples/doormanager/component/analytics/pom.xml
@@ -1,3 +1,4 @@
+
-
org.homeautomation
- component
+ doormanager-component
1.0.0-SNAPSHOT
../pom.xml
4.0.0
- ${groupId}.doormanager.analytics
+ org.homeautomation.doormanager.analytics
1.0.0-SNAPSHOT
pom
- ${groupId}.doormanager.analytics
+ org.homeautomation.doormanager.analytics
http://wso2.org
@@ -65,7 +66,7 @@
maven-assembly-plugin
2.5.5
- ${project.artifactId}-1.0.0-SNAPSHOT
+ org.homeautomation.doormanager.analytics-1.0.0-SNAPSHOT
false
src/assembly/src.xml
diff --git a/modules/samples/doormanager/component/analytics/src/assembly/src.xml b/modules/samples/doormanager/component/analytics/src/assembly/src.xml
index a5a37501..5469255f 100644
--- a/modules/samples/doormanager/component/analytics/src/assembly/src.xml
+++ b/modules/samples/doormanager/component/analytics/src/assembly/src.xml
@@ -1,3 +1,4 @@
+
src
diff --git a/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/dto/DeviceJSON.java b/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/dto/DeviceJSON.java
index f812dade..4496b0b8 100644
--- a/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/dto/DeviceJSON.java
+++ b/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/dto/DeviceJSON.java
@@ -27,8 +27,12 @@ import javax.xml.bind.annotation.XmlRootElement;
@JsonIgnoreProperties(ignoreUnknown = true)
public class DeviceJSON {
- @XmlElement(required = true) public String owner;
- @XmlElement(required = true) public String deviceId;
- @XmlElement(required = true) public String UIDofUser;
- @XmlElement(required = true) public String serialNumber;
+ @XmlElement(required = true)
+ public String owner;
+ @XmlElement(required = true)
+ public String deviceId;
+ @XmlElement(required = true)
+ public String UIDofUser;
+ @XmlElement(required = true)
+ public String serialNumber;
}
diff --git a/modules/samples/doormanager/component/manager/src/main/java/org.homeautomation/doormanager/manager/api/dto/UserInfo.java b/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/dto/UserInfo.java
similarity index 75%
rename from modules/samples/doormanager/component/manager/src/main/java/org.homeautomation/doormanager/manager/api/dto/UserInfo.java
rename to modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/dto/UserInfo.java
index b7ef2c10..5d89ea2f 100644
--- a/modules/samples/doormanager/component/manager/src/main/java/org.homeautomation/doormanager/manager/api/dto/UserInfo.java
+++ b/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/dto/UserInfo.java
@@ -16,7 +16,7 @@
* under the License.
*/
-package org.homeautomation.doormanager.manager.api.dto;
+package org.homeautomation.doormanager.controller.api.dto;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
@@ -27,8 +27,10 @@ import javax.xml.bind.annotation.XmlRootElement;
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserInfo {
- @XmlElement(required = true) public String serialNumber;
- @XmlElement(required = true) public String deviceId;
- @XmlElement(required = true) public String cardNumber;
- @XmlElement(required = true) public String userName;
+ @XmlElement(required = true)
+ public String deviceId;
+ @XmlElement(required = true)
+ public String cardNumber;
+ @XmlElement(required = true)
+ public String userName;
}
diff --git a/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/exception/DoorManagerException.java b/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/exception/DoorManagerException.java
index 63673efc..554967bc 100644
--- a/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/exception/DoorManagerException.java
+++ b/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/exception/DoorManagerException.java
@@ -1,4 +1,3 @@
-package org.homeautomation.doormanager.controller.api.exception;
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
@@ -16,20 +15,16 @@ package org.homeautomation.doormanager.controller.api.exception;
* specific language governing permissions and limitations
* under the License.
*/
+
+package org.homeautomation.doormanager.controller.api.exception;
+
public class DoorManagerException extends Exception {
private static final long serialVersionUID = 2736466230451105441L;
private String errorMessage;
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
+ @SuppressWarnings("unused")
public DoorManagerException(String msg, DoorManagerException nestedEx) {
super(msg, nestedEx);
setErrorMessage(msg);
@@ -40,18 +35,30 @@ public class DoorManagerException extends Exception {
setErrorMessage(message);
}
+ @SuppressWarnings("unused")
public DoorManagerException(String msg) {
super(msg);
setErrorMessage(msg);
}
+ @SuppressWarnings("unused")
public DoorManagerException() {
super();
}
+ @SuppressWarnings("unused")
public DoorManagerException(Throwable cause) {
super(cause);
}
+ @SuppressWarnings("unused")
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ public void setErrorMessage(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+
}
diff --git a/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/util/DoorManagerMQTTConnector.java b/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/transport/DoorManagerMQTTConnector.java
similarity index 54%
rename from modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/util/DoorManagerMQTTConnector.java
rename to modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/transport/DoorManagerMQTTConnector.java
index bf61fdb8..6dc076ab 100644
--- a/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/util/DoorManagerMQTTConnector.java
+++ b/modules/samples/doormanager/component/controller/src/main/java/org.homeautomation/doormanager/controller/api/transport/DoorManagerMQTTConnector.java
@@ -1,37 +1,65 @@
-package org.homeautomation.doormanager.controller.api.util;
+/*
+ * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.homeautomation.doormanager.controller.api.transport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.homeautomation.doormanager.controller.api.exception.DoorManagerException;
+import org.homeautomation.doormanager.controller.api.util.DoorManagerServiceUtils;
import org.homeautomation.doormanager.plugin.constants.DoorManagerConstants;
+import org.wso2.carbon.device.mgt.analytics.exception.DataPublisherConfigurationException;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.iot.controlqueue.mqtt.MqttConfig;
import org.wso2.carbon.device.mgt.iot.sensormgt.SensorDataManager;
import org.wso2.carbon.device.mgt.iot.transport.TransportHandlerException;
import org.wso2.carbon.device.mgt.iot.transport.mqtt.MQTTTransportHandler;
-import javax.ws.rs.core.Response;
import java.io.File;
import java.util.Calendar;
import java.util.UUID;
+/**
+ * MQTT is used as transport protocol. So this will provide basic functional requirement in order to communicate over
+ * MQTT
+ */
@SuppressWarnings("no JAX-WS annotation")
public class DoorManagerMQTTConnector extends MQTTTransportHandler {
private static Log log = LogFactory.getLog(DoorManagerMQTTConnector.class);
- private static final String subscribeTopic =
- "wso2" + File.separator + "iot" + File.separator + "+" + File.separator +
- DoorManagerConstants.DEVICE_TYPE + File.separator + "+" + File.separator +
- "lockStatusPublisher"+ File.separator;
- private static String iotServerSubscriber = UUID.randomUUID().toString().substring(0, 5);
+ private static String PUBLISHER_CONTEXT = "publisher";
+ private static String SUBSCRIBER_CONTEXT = "subscriber";
+ private static String SUBCRIBER_TOPIC = "wso2" + File.separator + "iot" + File.separator + "+" + File.separator +
+ DoorManagerConstants.DEVICE_TYPE + File.separator + "+" + File.separator + PUBLISHER_CONTEXT;
+ private static String PUBLISHER_TOPIC = "wso2/iot/%s/" + DoorManagerConstants.DEVICE_TYPE + "/%s/"
+ + SUBSCRIBER_CONTEXT;
+ private static String SUBSCRIBER = UUID.randomUUID().toString().substring(0, 5);
private DoorManagerMQTTConnector() {
- super(iotServerSubscriber, DoorManagerConstants.DEVICE_TYPE,
- MqttConfig.getInstance().getMqttQueueEndpoint(), subscribeTopic);
+ super(SUBSCRIBER, DoorManagerConstants.DEVICE_TYPE,
+ MqttConfig.getInstance().getMqttQueueEndpoint(), SUBCRIBER_TOPIC);
}
+ /**
+ * This method will initialize connection with message broker
+ */
@Override
public void connect() {
Runnable connector = new Runnable() {
@@ -63,79 +91,103 @@ public class DoorManagerMQTTConnector extends MQTTTransportHandler {
connectorThread.start();
}
+ /**
+ * This callback function will be called by message broker when some messages available to subscribed topic
+ *
+ * @param message mqtt message which is coming form agent side
+ * @param messageParams metadata of mqtt message
+ */
@Override
public void processIncomingMessage(MqttMessage message, String... messageParams) {
String topic = messageParams[0];
String ownerAndId = topic.replace("wso2" + File.separator + "iot" + File.separator, "");
ownerAndId = ownerAndId.replace(File.separator + DoorManagerConstants.DEVICE_TYPE
+ File.separator, ":");
- ownerAndId = ownerAndId.replace(File.separator + "lockStatusPublisher", "");
+ ownerAndId = ownerAndId.replace(File.separator + PUBLISHER_CONTEXT, "");
String owner = ownerAndId.split(":")[0];
String deviceId = ownerAndId.split(":")[1];
log.warn(deviceId);
-
String[] messageData = message.toString().split(":");
-
- if (log.isDebugEnabled()){
+ if (log.isDebugEnabled()) {
log.debug("Received MQTT message for: [OWNER-" + owner + "] & [DEVICE.ID-" + deviceId + "]");
}
if (messageData.length == 2) {
- log.warn("-------------------------------------------");
- log.warn(messageData[0]);
- log.warn(messageData[1]);
String lockerCurrentState = messageData[1];
+ float lockerStatus;
+ if (lockerCurrentState.equals("LOCKED")) {
+ lockerStatus = 0;
+ } else {
+ lockerStatus = 1;
+ }
try {
- SensorDataManager.getInstance().setSensorRecord(deviceId, "door_locker_state",
- String.valueOf(1), Calendar.getInstance().getTimeInMillis());
- if (!DoorManagerServiceUtils.publishToDASCurrent(owner, deviceId, 1)) {
- log.warn("An error occured whilst trying to publish with ID [" + deviceId +
- "] of owner [" + owner + "]");
+ SensorDataManager.getInstance().setSensorRecord(deviceId, "doorLockerCurrentStatus",
+ String.valueOf(lockerStatus), Calendar.getInstance().getTimeInMillis());
+ if (!DoorManagerServiceUtils.publishToDASLockerStatus(owner, deviceId, lockerStatus)) {
+ log.warn("An error occurred while trying to publish with ID [" + deviceId + "] of owner ["
+ + owner + "]");
}
- } catch(Exception e){
- log.error(e);
- }
- if(log.isDebugEnabled()){
- //log.debug("Return result " + result + " for Request " + requestMessage);
+ } catch (Exception e) {
+ log.error(e);
}
}
}
+ /**
+ * Publish a MQTT message to device through message broker
+ *
+ * @param topic mqtt topic which will be used to uniquely identify who are the subscribers to this topic
+ * @param payLoad message is to be published
+ * @param qos level of qos(quality of service):1,2,3
+ * @param retained klkkl
+ * @throws TransportHandlerException
+ */
private void publishToAutomaticDoorLocker(String topic, String payLoad, int qos, boolean retained)
throws TransportHandlerException {
- if(log.isDebugEnabled()){
+ if (log.isDebugEnabled()) {
log.debug("Publishing message [" + payLoad + "to topic [" + topic + "].");
}
publishToQueue(topic, payLoad, qos, retained);
}
+ /**
+ * Publish a MQTT message to device through message broker
+ *
+ * @param deviceOwner person who own the device
+ * @param deviceId unique identifier for each device
+ * @param operation command is to executed at agent side e.g: off, on
+ * @param param additional payload
+ * @throws DeviceManagementException
+ * @throws DoorManagerException
+ */
public void sendCommandViaMQTT(String deviceOwner, String deviceId, String operation, String param)
throws DeviceManagementException, DoorManagerException {
- String PUBLISH_TOPIC = "wso2/iot/%s/doormanager/%s/lockController";
- String topic = String.format(PUBLISH_TOPIC, deviceOwner, deviceId);
+ String topic = String.format(PUBLISHER_TOPIC, deviceOwner, deviceId);
String payload = operation + param;
try {
publishToAutomaticDoorLocker(topic, payload, 2, false);
- if(param.equals("LOCK")){
- if (!DoorManagerServiceUtils.publishToDASCurrent(deviceOwner, deviceId, 0)) {
- log.warn("An error occured whilst trying to publish with ID [" + deviceId +
- "] of owner [" + deviceOwner + "]");
+ if (param.equals("LOCK")) {
+ if (!DoorManagerServiceUtils.publishToDASLockerStatus(deviceOwner, deviceId, 0)) {
+ log.warn("An error occurred whilst trying to publish with ID [" + deviceId + "] of owner [" +
+ deviceOwner + "]");
}
- }else{
- if (!DoorManagerServiceUtils.publishToDASCurrent(deviceOwner, deviceId, 1)) {
- log.warn("An error occured whilst trying to publish with ID [" + deviceId +
- "] of owner [" + deviceOwner + "]");
+ } else {
+ if (!DoorManagerServiceUtils.publishToDASLockerStatus(deviceOwner, deviceId, 1)) {
+ log.warn("An error occurred whilst trying to publish with ID [" + deviceId + "] of owner [" +
+ deviceOwner + "]");
}
}
- if (!DoorManagerServiceUtils.publishToDASCurrent(deviceOwner, deviceId, 1)) {
- log.warn("An error occured whilst trying to publish with ID [" + deviceId +
- "] of owner [" + deviceOwner + "]");
- }
} catch (TransportHandlerException e) {
String errorMessage = "Error publishing data to device with ID " + deviceId;
throw new DoorManagerException(errorMessage, e);
+ } catch (DataPublisherConfigurationException e) {
+ String errorMessage = "Error publishing data to DAS with ID " + deviceId;
+ throw new DoorManagerException(errorMessage, e);
}
}
+ /**
+ * Connection with message broker can be terminated
+ */
@Override
public void disconnect() {
Runnable stopConnection = new Runnable() {
@@ -143,8 +195,7 @@ public class DoorManagerMQTTConnector extends MQTTTransportHandler {
while (isConnected()) {
try {
closeConnection();
- }
- catch (MqttException e) {
+ } catch (MqttException e) {
if (log.isDebugEnabled()) {
log.warn("Unable to 'STOP' MQTT connection at broker at: " + mqttBrokerEndPoint);
}
diff --git a/modules/samples/doormanager/component/controller/src/main/webapp/WEB-INF/cxf-servlet.xml b/modules/samples/doormanager/component/controller/src/main/webapp/WEB-INF/cxf-servlet.xml
index 1d024638..1a62e429 100644
--- a/modules/samples/doormanager/component/controller/src/main/webapp/WEB-INF/cxf-servlet.xml
+++ b/modules/samples/doormanager/component/controller/src/main/webapp/WEB-INF/cxf-servlet.xml
@@ -16,9 +16,9 @@
~ limitations under the License.
-->
-
@@ -30,12 +30,12 @@
-
+
+ class="org.homeautomation.doormanager.controller.api.transport.DoorManagerMQTTConnector">
diff --git a/modules/samples/doormanager/component/manager/pom.xml b/modules/samples/doormanager/component/manager/pom.xml
index 130acacd..469db75c 100644
--- a/modules/samples/doormanager/component/manager/pom.xml
+++ b/modules/samples/doormanager/component/manager/pom.xml
@@ -19,15 +19,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
org.homeautomation
- component
+ doormanager-component
1.0.0-SNAPSHOT
../pom.xml
4.0.0
- ${groupId}.doormanager.manager
+ org.homeautomation.doormanager.manager
war
1.0.0-SNAPSHOT
- ${groupId}.doormanager.manager
+ org.homeautomation.doormanager.manager
http://wso2.org
${basedir}/src/main/java
@@ -46,7 +46,7 @@
maven-war-plugin
${maven-war-plugin.version}
- ${groupId}.doormanager.manager_mgt
+ org.homeautomation.doormanager.manager_mgt
@@ -54,7 +54,7 @@
org.homeautomation
- ${project-base-package}.plugin
+ org.homeautomation.doormanager.plugin
org.wso2.carbon.devicemgt
diff --git a/modules/samples/doormanager/component/pom.xml b/modules/samples/doormanager/component/pom.xml
index dd9ea9aa..5be5a50d 100644
--- a/modules/samples/doormanager/component/pom.xml
+++ b/modules/samples/doormanager/component/pom.xml
@@ -15,7 +15,9 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-*/-->
+*/-->
+
org.homeautomation
doormanager
@@ -24,7 +26,7 @@
4.0.0
1.0.0-SNAPSHOT
- component
+ doormanager-component
pom
@@ -271,12 +273,11 @@
-
- plugin
- controller
- manager
- agent
- analytics
- ui
-
+
+ plugin
+ controller
+ manager
+ analytics
+ ui
+
\ No newline at end of file
diff --git a/modules/samples/doormanager/component/ui/pom.xml b/modules/samples/doormanager/component/ui/pom.xml
index bbfca272..d618b978 100644
--- a/modules/samples/doormanager/component/ui/pom.xml
+++ b/modules/samples/doormanager/component/ui/pom.xml
@@ -16,18 +16,18 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
org.homeautomation
- component
+ doormanager-component
1.0.0-SNAPSHOT
../pom.xml
4.0.0
- ${groupId}.doormanager.ui
- ${groupId}.doormanager.ui
+ org.homeautomation.doormanager.ui
+ org.homeautomation.doormanager.ui
pom
@@ -35,7 +35,7 @@
maven-assembly-plugin
2.5.5
- ${project.artifactId}-1.0.0-SNAPSHOT
+ org.homeautomation.doormanager.ui-1.0.0-SNAPSHOT
false
src/assembly/src.xml
diff --git a/modules/samples/doormanager/component/ui/src/assembly/src.xml b/modules/samples/doormanager/component/ui/src/assembly/src.xml
index 8e784014..5e2e656a 100644
--- a/modules/samples/doormanager/component/ui/src/assembly/src.xml
+++ b/modules/samples/doormanager/component/ui/src/assembly/src.xml
@@ -17,8 +17,8 @@
-->
src
diff --git a/modules/samples/doormanager/feature/feature/pom.xml b/modules/samples/doormanager/feature/feature/pom.xml
index 1a76d94c..4e499c6d 100644
--- a/modules/samples/doormanager/feature/feature/pom.xml
+++ b/modules/samples/doormanager/feature/feature/pom.xml
@@ -1,3 +1,4 @@
+
-
org.homeautomation
- feature
+ doormanager-feature
1.0.0-SNAPSHOT
../pom.xml
4.0.0
1.0.0-SNAPSHOT
- ${groupId}.doormanager.feature
+ org.homeautomation.doormanager.feature
pom
- ${project.artifactId}
- http://wso2.org
+ ${project.artifactId}
+ http://wso2.org
org.homeautomation
@@ -47,12 +48,6 @@
1.0.0-SNAPSHOT
war
-
- org.homeautomation
- ${project-base-package}.agent
- 1.0.0-SNAPSHOT
- war
-
com.h2database.wso2
h2-database-engine
@@ -63,6 +58,7 @@
maven-resources-plugin
+ 2.7
copy-resources
@@ -104,7 +100,7 @@
zip
true
- ${basedir}/src/main/resources/carbonapps
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
**/*
@@ -115,7 +111,9 @@
${project.version}
zip
true
- ${basedir}/src/main/resources/jaggeryapps/
+
+ ${project.build.directory}/maven-shared-archive-resources/jaggeryapps
+
**/*
@@ -134,7 +132,9 @@
${project-base-package}.manager
war
true
- ${basedir}/src/main/resources/webapps/
+
+ ${project.build.directory}/maven-shared-archive-resources/webapps/
+
doormanager_mgt.war
@@ -153,31 +153,14 @@
${project-base-package}.controller
war
true
- ${basedir}/src/main/resources/webapps/
+
+ ${project.build.directory}/maven-shared-archive-resources/webapps/
+
doormanager.war
-
- copy-jaxrs-agent-war
- package
-
- copy
-
-
-
-
- org.homeautomation
- ${project-base-package}.agent
- war
- true
- ${basedir}/src/main/resources/webapps/
- doormanager_agent.war
-
-
-
-
@@ -198,7 +181,7 @@
+ value="jdbc:h2:file:${basedir}/${db.dir}/doormanagerDM_DB;DB_CLOSE_ON_EXIT=FALSE"/>
org.wso2.maven
carbon-p2-plugin
+ ${carbon-p2-plugin.version}
p2-feature-generation
diff --git a/modules/samples/doormanager/feature/feature/src/main/resources/carbonapps/Sensor.car b/modules/samples/doormanager/feature/feature/src/main/resources/carbonapps/Sensor.car
deleted file mode 100644
index af22e266..00000000
Binary files a/modules/samples/doormanager/feature/feature/src/main/resources/carbonapps/Sensor.car and /dev/null differ
diff --git a/modules/samples/doormanager/feature/feature/src/main/resources/configs/doormanager.json b/modules/samples/doormanager/feature/feature/src/main/resources/configs/doormanager.json
index 3d499fc2..729872a6 100644
--- a/modules/samples/doormanager/feature/feature/src/main/resources/configs/doormanager.json
+++ b/modules/samples/doormanager/feature/feature/src/main/resources/configs/doormanager.json
@@ -5,13 +5,25 @@
},
"analyticStreams": [
{
- "name": "sensorValue",
- "table": "DEVICE_SENSOR_DATA_SUMMARY",
+ "name": "smartLock",
+ "table": "DEVICE_smartLock_SUMMARY",
"ui_unit": {
"name": "cdmf.unit.analytics.line-chart",
- "data":[
- {"column": {"name":"TIME", "label":"time", "ui-mapping":"x-axis"}},
- {"column": {"name":"sensorValue", "label":"sensorValue", "ui-mapping":"y-axis"}}
+ "data": [
+ {
+ "column": {
+ "name": "TIME",
+ "label": "time",
+ "ui-mapping": "x-axis"
+ }
+ },
+ {
+ "column": {
+ "name": "smartLock",
+ "label": "smartLock",
+ "ui-mapping": "y-axis"
+ }
+ }
]
}
}
diff --git a/modules/samples/doormanager/feature/feature/src/main/resources/configs/doormanager.xml b/modules/samples/doormanager/feature/feature/src/main/resources/configs/doormanager.xml
index c130cc3a..e985bdf4 100644
--- a/modules/samples/doormanager/feature/feature/src/main/resources/configs/doormanager.xml
+++ b/modules/samples/doormanager/feature/feature/src/main/resources/configs/doormanager.xml
@@ -18,7 +18,7 @@
-->
-
- jdbc/doormanagerDM_DB
-
+
+ jdbc/doormanagerDM_DB
+
diff --git a/modules/samples/doormanager/feature/feature/src/main/resources/database/doormanagerDM_DB.h2.db b/modules/samples/doormanager/feature/feature/src/main/resources/database/doormanagerDM_DB.h2.db
index 6be5a907..e3cd583d 100644
Binary files a/modules/samples/doormanager/feature/feature/src/main/resources/database/doormanagerDM_DB.h2.db and b/modules/samples/doormanager/feature/feature/src/main/resources/database/doormanagerDM_DB.h2.db differ
diff --git a/modules/samples/doormanager/feature/feature/src/main/resources/datasources/doormanager-datasources.xml b/modules/samples/doormanager/feature/feature/src/main/resources/datasources/doormanager-datasources.xml
index 483b22df..ed8376e0 100644
--- a/modules/samples/doormanager/feature/feature/src/main/resources/datasources/doormanager-datasources.xml
+++ b/modules/samples/doormanager/feature/feature/src/main/resources/datasources/doormanager-datasources.xml
@@ -1,3 +1,4 @@
+
-
+
org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader
doormanagerDM_DB
- The datasource used for the this device type
+ The datasource used for the this device type
jdbc/doormanagerDM_DB