From bb0b10f14cf5eee4d8b0f26d311593fe458d50c8 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Sun, 15 May 2016 11:59:10 +0530 Subject: [PATCH] resolved xmpp issues in virtual fire alarm --- .../service/impl/AndroidSenseManagerServiceImpl.java | 4 ++-- .../mgt/iot/arduino/service/impl/util/ZipUtil.java | 2 +- .../java/org/wso2/carbon/device/mgt/iot/util/Utils.java | 2 +- .../mgt/iot/raspberrypi/service/impl/util/ZipUtil.java | 2 +- .../communication/xmpp/FireAlarmXMPPCommunicator.java | 7 ++----- .../agent/advanced/core/AgentConfiguration.java | 9 +++++++++ .../agent/advanced/core/AgentConstants.java | 2 ++ .../agent/advanced/core/AgentUtilOperations.java | 4 ++++ .../src/main/resources/deviceConfig.properties | 1 + .../communication/xmpp/FireAlarmXMPPCommunicator.java | 8 +++----- .../virtualfirealarm/agent/core/AgentConfiguration.java | 9 +++++++++ .../iot/virtualfirealarm/agent/core/AgentConstants.java | 1 + .../virtualfirealarm/agent/core/AgentUtilOperations.java | 4 ++++ .../src/main/resources/deviceConfig.properties | 1 + .../impl/VirtualFireAlarmControllerServiceImpl.java | 8 +++++--- .../iot/virtualfirealarm/service/impl/util/ZipUtil.java | 4 ++-- .../plugin/constants/VirtualFireAlarmConstants.java | 3 ++- .../plugin/impl/util/VirtualFireAlarmUtils.java | 3 +++ .../util/VirtualFirealarmEventAdapterSubscription.java | 3 +++ .../mgt/iot/virtualfirealarm/plugin/xmpp/XmppConfig.java | 8 +++++++- .../virtualfirealarm/plugin/xmpp/XmppServerClient.java | 5 ++--- .../mgt/iot/virtualfirealarm/plugin/xmpp/XmppUtil.java | 4 ++-- .../device-view.js | 3 +-- .../src/main/resources/conf/xmpp.properties | 3 ++- .../resources/advanced_agent/deviceConfig.properties | 2 +- .../src/main/resources/agent/deviceConfig.properties | 2 +- 26 files changed, 72 insertions(+), 32 deletions(-) diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseManagerServiceImpl.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseManagerServiceImpl.java index e5a794f50..5e109aaf7 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseManagerServiceImpl.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseManagerServiceImpl.java @@ -62,7 +62,7 @@ public class AndroidSenseManagerServiceImpl implements AndroidSenseManagerServic androidConfiguration.setTenantDomain(APIUtil.getAuthenticatedUserTenantDomain()); String mqttEndpoint = MqttConfig.getInstance().getBrokerEndpoint(); if (mqttEndpoint.contains(Constants.LOCALHOST)) { - mqttEndpoint = mqttEndpoint.replace(Constants.LOCALHOST, Utils.getHostName()); + mqttEndpoint = mqttEndpoint.replace(Constants.LOCALHOST, Utils.getServerUrl()); } androidConfiguration.setMqttEndpoint(mqttEndpoint); return Response.status(Response.Status.ACCEPTED.getStatusCode()).entity(androidConfiguration.toString()) @@ -85,7 +85,7 @@ public class AndroidSenseManagerServiceImpl implements AndroidSenseManagerServic androidConfiguration.setTenantDomain(APIUtil.getAuthenticatedUserTenantDomain()); String mqttEndpoint = MqttConfig.getInstance().getBrokerEndpoint(); if (mqttEndpoint.contains(Constants.LOCALHOST)) { - mqttEndpoint = mqttEndpoint.replace(Constants.LOCALHOST, Utils.getHostName()); + mqttEndpoint = mqttEndpoint.replace(Constants.LOCALHOST, Utils.getServerUrl()); } androidConfiguration.setMqttEndpoint(mqttEndpoint); return Response.ok(androidConfiguration.toString()).build(); diff --git a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/impl/util/ZipUtil.java b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/impl/util/ZipUtil.java index 9f3dca269..1cad52120 100644 --- a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/impl/util/ZipUtil.java +++ b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/impl/util/ZipUtil.java @@ -47,7 +47,7 @@ public class ZipUtil { String iotServerIP; try { - iotServerIP = Utils.getHostName(); + iotServerIP = Utils.getServerUrl(); String httpServerPort = System.getProperty(HTTP_PORT_PROPERTY); Map contextParams = new HashMap<>(); diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/util/Utils.java b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/util/Utils.java index 4bc6a6164..26aaf2aa7 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/util/Utils.java +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/util/Utils.java @@ -55,7 +55,7 @@ public class Utils { public static final String HOST_NAME = "HostName"; private static final Log log = LogFactory.getLog(Utils.class); - public static String getHostName() { + public static String getServerUrl() { String hostName = ServerConfiguration.getInstance().getFirstProperty(HOST_NAME); try { if (hostName == null) { diff --git a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/impl/util/ZipUtil.java b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/impl/util/ZipUtil.java index b90c145ad..6c9fd54b3 100644 --- a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/impl/util/ZipUtil.java +++ b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/impl/util/ZipUtil.java @@ -52,7 +52,7 @@ public class ZipUtil { String iotServerIP; try { - iotServerIP = Utils.getHostName(); + iotServerIP = Utils.getServerUrl(); String httpsServerPort = System.getProperty(HTTPS_PORT_PROPERTY); String httpServerPort = System.getProperty(HTTP_PORT_PROPERTY); String httpsServerEP = HTTPS_PROTOCOL_APPENDER + iotServerIP + ":" + httpsServerPort; diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/communication/xmpp/FireAlarmXMPPCommunicator.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/communication/xmpp/FireAlarmXMPPCommunicator.java index f1fe40bd9..5beebd415 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/communication/xmpp/FireAlarmXMPPCommunicator.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/communication/xmpp/FireAlarmXMPPCommunicator.java @@ -68,11 +68,8 @@ public class FireAlarmXMPPCommunicator extends XMPPTransportHandler { final AgentManager agentManager = AgentManager.getInstance(); username = agentManager.getAgentConfigs().getDeviceId(); password = agentManager.getAgentConfigs().getAuthToken(); - resource = agentManager.getAgentConfigs().getDeviceOwner(); - - xmppDeviceJID = username + "@" + server; - xmppAdminJID = "wso2_" + AgentConstants.DEVICE_TYPE + "@" + server; - + xmppDeviceJID = username + "@" + agentManager.getAgentConfigs().getXmppServerName(); + xmppAdminJID = "wso2admin_" + AgentConstants.DEVICE_TYPE + "@" + agentManager.getAgentConfigs().getXmppServerName(); Runnable connect = new Runnable() { public void run() { diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentConfiguration.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentConfiguration.java index 7a54be78e..d79e6b029 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentConfiguration.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentConfiguration.java @@ -39,6 +39,7 @@ public class AgentConfiguration { private String authToken; private String refreshToken; private int dataPushInterval; + private String xmppServerName; public String getTenantDomain() { return tenantDomain; @@ -159,6 +160,14 @@ public class AgentConfiguration { public void setScepContext(String scepContext) { this.scepContext = scepContext; } + + public String getXmppServerName() { + return xmppServerName; + } + + public void setXmppServerName(String xmppServerName) { + this.xmppServerName = xmppServerName; + } } diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentConstants.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentConstants.java index 09975cde4..84267523f 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentConstants.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentConstants.java @@ -134,4 +134,6 @@ public class AgentConstants { "select deviceID, temp\n" + "insert into bulbOffStream;"; + + public static final String XMPP_SERVER_NAME_PROPERTY = "xmpp-server-name"; } diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java index 440582c7f..822327301 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java @@ -102,6 +102,8 @@ public class AgentUtilOperations { AgentConstants.MQTT_BROKER_EP_PROPERTY)); iotServerConfigs.setXmppServerEndpoint(properties.getProperty( AgentConstants.XMPP_SERVER_EP_PROPERTY)); + iotServerConfigs.setXmppServerName(properties.getProperty( + AgentConstants.XMPP_SERVER_NAME_PROPERTY)); iotServerConfigs.setAuthMethod(properties.getProperty( AgentConstants.AUTH_METHOD_PROPERTY)); iotServerConfigs.setAuthToken(properties.getProperty( @@ -138,6 +140,8 @@ public class AgentUtilOperations { iotServerConfigs.getRefreshToken()); log.info(AgentConstants.LOG_APPENDER + "Data Push Interval: " + iotServerConfigs.getDataPushInterval()); + log.info(AgentConstants.LOG_APPENDER + "XMPP Server Name: " + + iotServerConfigs.getXmppServerName()); } catch (FileNotFoundException ex) { log.error(AgentConstants.LOG_APPENDER + "Unable to find " + propertiesFileName + diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/resources/deviceConfig.properties b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/resources/deviceConfig.properties index 1dc1374b9..4eba166c1 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/resources/deviceConfig.properties +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/resources/deviceConfig.properties @@ -32,3 +32,4 @@ auth-token=79d68b50ae5f5a06e812889979b3453 refresh-token=8bdda6359dddad218cff3354d5a8cb3b network-interface=en0 push-interval=14 +xmpp-server-name=localhost \ No newline at end of file diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/communication/xmpp/FireAlarmXMPPCommunicator.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/communication/xmpp/FireAlarmXMPPCommunicator.java index b29cd492e..45d103adc 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/communication/xmpp/FireAlarmXMPPCommunicator.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/communication/xmpp/FireAlarmXMPPCommunicator.java @@ -21,6 +21,7 @@ package org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.communication.xmpp import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jivesoftware.smack.packet.Message; +import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.core.AgentConfiguration; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.core.AgentConstants; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.core.AgentManager; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.core.AgentUtilOperations; @@ -68,11 +69,8 @@ public class FireAlarmXMPPCommunicator extends XMPPTransportHandler { final AgentManager agentManager = AgentManager.getInstance(); username = agentManager.getAgentConfigs().getDeviceId(); password = agentManager.getAgentConfigs().getAuthToken(); - resource = agentManager.getAgentConfigs().getDeviceOwner(); - - xmppDeviceJID = username + "@" + server; - xmppAdminJID = "wso2_" + AgentConstants.DEVICE_TYPE + "@" + server; - + xmppDeviceJID = username + "@" + agentManager.getAgentConfigs().getXmppServerName(); + xmppAdminJID = "wso2admin_" + AgentConstants.DEVICE_TYPE + "@" + agentManager.getAgentConfigs().getXmppServerName(); Runnable connect = new Runnable() { public void run() { diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java index 68cb58ee8..64b52b8b7 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java @@ -39,6 +39,7 @@ public class AgentConfiguration { private String authToken; private String refreshToken; private int dataPushInterval; + private String xmppServerName; public String getTenantDomain() { return tenantDomain; @@ -159,6 +160,14 @@ public class AgentConfiguration { public void setScepContext(String scepContext) { this.scepContext = scepContext; } + + public String getXmppServerName() { + return xmppServerName; + } + + public void setXmppServerName(String xmppServerName) { + this.xmppServerName = xmppServerName; + } } diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java index 1a9771b8e..8836aa09c 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java @@ -77,6 +77,7 @@ public class AgentConstants { public static final String APIM_GATEWAY_EP_PROPERTY = "apim-ep"; public static final String MQTT_BROKER_EP_PROPERTY = "mqtt-ep"; public static final String XMPP_SERVER_EP_PROPERTY = "xmpp-ep"; + public static final String XMPP_SERVER_NAME_PROPERTY = "xmpp-server-name"; public static final String AUTH_METHOD_PROPERTY = "auth-method"; public static final String AUTH_TOKEN_PROPERTY = "auth-token"; public static final String REFRESH_TOKEN_PROPERTY = "refresh-token"; diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java index c7eb9d342..656ce8490 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java @@ -106,6 +106,8 @@ public class AgentUtilOperations { AgentConstants.MQTT_BROKER_EP_PROPERTY)); iotServerConfigs.setXmppServerEndpoint(properties.getProperty( AgentConstants.XMPP_SERVER_EP_PROPERTY)); + iotServerConfigs.setXmppServerName(properties.getProperty( + AgentConstants.XMPP_SERVER_NAME_PROPERTY)); iotServerConfigs.setAuthMethod(properties.getProperty( AgentConstants.AUTH_METHOD_PROPERTY)); iotServerConfigs.setAuthToken(properties.getProperty( @@ -142,6 +144,8 @@ public class AgentUtilOperations { iotServerConfigs.getRefreshToken()); log.info(AgentConstants.LOG_APPENDER + "Data Push Interval: " + iotServerConfigs.getDataPushInterval()); + log.info(AgentConstants.LOG_APPENDER + "XMPP Server Name: " + + iotServerConfigs.getXmppServerName()); } catch (FileNotFoundException ex) { String errorMsg = "[" + propertiesFileName + "] file not found at: " + AgentConstants.PROPERTIES_FILE_PATH; diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/resources/deviceConfig.properties b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/resources/deviceConfig.properties index 1dc1374b9..4eba166c1 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/resources/deviceConfig.properties +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/resources/deviceConfig.properties @@ -32,3 +32,4 @@ auth-token=79d68b50ae5f5a06e812889979b3453 refresh-token=8bdda6359dddad218cff3354d5a8cb3b network-interface=en0 push-interval=14 +xmpp-server-name=localhost \ No newline at end of file diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/impl/VirtualFireAlarmControllerServiceImpl.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/impl/VirtualFireAlarmControllerServiceImpl.java index 213cb3fbc..e4a8aa55f 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/impl/VirtualFireAlarmControllerServiceImpl.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/impl/VirtualFireAlarmControllerServiceImpl.java @@ -28,6 +28,7 @@ import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorization import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.impl.util.VirtualFirealarmSecurityManager; +import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.xmpp.XmppConfig; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.dto.SensorRecord; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.exception.VirtualFireAlarmException; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.APIUtil; @@ -83,7 +84,8 @@ public class VirtualFireAlarmControllerServiceImpl implements VirtualFireAlarmCo Map dynamicProperties = new HashMap<>(); switch (protocolString) { case XMPP_PROTOCOL: - dynamicProperties.put(VirtualFireAlarmConstants.JID_PROPERTY_KEY, deviceId); + dynamicProperties.put(VirtualFireAlarmConstants.JID_PROPERTY_KEY, + deviceId + "@" + XmppConfig.getInstance().getXmppServerName()); dynamicProperties.put(VirtualFireAlarmConstants.SUBJECT_PROPERTY_KEY, "CONTROL-REQUEST"); dynamicProperties.put(VirtualFireAlarmConstants.MESSAGE_TYPE_PROPERTY_KEY, VirtualFireAlarmConstants.CHAT_PROPERTY_KEY); @@ -91,7 +93,6 @@ public class VirtualFireAlarmControllerServiceImpl implements VirtualFireAlarmCo dynamicProperties, encryptedMsg); break; default: - String publishTopic = APIUtil.getTenantDomainOftheUser() + "/" + VirtualFireAlarmConstants.DEVICE_TYPE + "/" + deviceId; dynamicProperties.put(VirtualFireAlarmConstants.ADAPTER_TOPIC_PROPERTY, publishTopic); @@ -131,7 +132,8 @@ public class VirtualFireAlarmControllerServiceImpl implements VirtualFireAlarmCo Map dynamicProperties = new HashMap<>(); switch (protocolString) { case XMPP_PROTOCOL: - dynamicProperties.put(VirtualFireAlarmConstants.JID_PROPERTY_KEY, deviceId); + dynamicProperties.put(VirtualFireAlarmConstants.JID_PROPERTY_KEY, + deviceId + "@" + XmppConfig.getInstance().getXmppServerName()); dynamicProperties.put(VirtualFireAlarmConstants.SUBJECT_PROPERTY_KEY, "POLICTY-REQUEST"); dynamicProperties.put(VirtualFireAlarmConstants.MESSAGE_TYPE_PROPERTY_KEY, VirtualFireAlarmConstants.CHAT_PROPERTY_KEY); diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/impl/util/ZipUtil.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/impl/util/ZipUtil.java index 792987306..4d7fed54c 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/impl/util/ZipUtil.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/impl/util/ZipUtil.java @@ -53,7 +53,7 @@ public class ZipUtil { String iotServerIP; try { - iotServerIP = Utils.getHostName(); + iotServerIP = Utils.getServerUrl(); String httpsServerPort = System.getProperty(HTTPS_PORT_PROPERTY); String httpServerPort = System.getProperty(HTTP_PORT_PROPERTY); String httpsServerEP = HTTPS_PROTOCOL_APPENDER + iotServerIP + ":" + httpsServerPort; @@ -80,7 +80,7 @@ public class ZipUtil { contextParams.put("XMPP_EP", "XMPP:" + xmppEndpoint); contextParams.put("DEVICE_TOKEN", token); contextParams.put("DEVICE_REFRESH_TOKEN", refreshToken); - + contextParams.put("SERVER_NAME", XmppConfig.getInstance().getXmppServerName()); ZipArchive zipFile; zipFile = Utils.getSketchArchive(archivesPath, templateSketchPath, contextParams, deviceName); return zipFile; diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/constants/VirtualFireAlarmConstants.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/constants/VirtualFireAlarmConstants.java index 64d4e50fd..693eb3524 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/constants/VirtualFireAlarmConstants.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/constants/VirtualFireAlarmConstants.java @@ -80,11 +80,12 @@ public class VirtualFireAlarmConstants { public static final String IS_ENABLED_KEY = "enabled"; public static final String HOST_KEY = "host"; public static final String PORT_KEY = "port"; - public static final String CONNECTION_PORT = "connection.port"; public static final String ADMIN_USERNAME = "admin.username"; public static final String ADMIN_PASSWORD = "admin.password"; public static final String XMPP_SERVER_PASSWORD = "admin@123456789"; + public static final String SERVER_NAME = "serverName"; + public static final String MQTT_CONFIG_LOCATION = CarbonUtils.getEtcCarbonConfigDirPath() + File.separator + "mqtt.properties"; public static final String XMPP_CONFIG_LOCATION = CarbonUtils.getEtcCarbonConfigDirPath() + File.separator diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/util/VirtualFireAlarmUtils.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/util/VirtualFireAlarmUtils.java index 011334538..875072379 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/util/VirtualFireAlarmUtils.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/util/VirtualFireAlarmUtils.java @@ -38,6 +38,8 @@ import org.wso2.carbon.event.output.adapter.core.MessageType; import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterConfiguration; import org.wso2.carbon.event.output.adapter.core.exception.OutputEventAdapterException; import org.json.JSONObject; +import org.wso2.carbon.utils.NetworkUtils; + import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; @@ -45,6 +47,7 @@ import javax.sql.DataSource; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.net.SocketException; import java.security.PublicKey; import java.security.cert.X509Certificate; import java.sql.Connection; diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/util/VirtualFirealarmEventAdapterSubscription.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/util/VirtualFirealarmEventAdapterSubscription.java index ee3ec6a6e..25489d9b5 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/util/VirtualFirealarmEventAdapterSubscription.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/util/VirtualFirealarmEventAdapterSubscription.java @@ -14,6 +14,9 @@ public class VirtualFirealarmEventAdapterSubscription implements InputEventAdapt if (actualMessage.contains("PUBLISHER")) { float temperature = Float.parseFloat(actualMessage.split(":")[2]); VirtualFireAlarmUtils.publishToDAS(deviceId, temperature); + } else { + float temperature = Float.parseFloat(actualMessage.split(":")[1]); + VirtualFireAlarmUtils.publishToDAS(deviceId, temperature); } } } diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppConfig.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppConfig.java index 3a0eebebb..12f9b5fcc 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppConfig.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppConfig.java @@ -21,6 +21,7 @@ package org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.xmpp; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants; +import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.impl.util.VirtualFireAlarmUtils; import java.io.File; import java.io.IOException; @@ -37,6 +38,7 @@ public class XmppConfig { private String virtualFirealarmAdminUsername; private String virtualFirealarmAdminPassword; private String virtualFirealarmAdminJID; + private String xmppServerName; private static XmppConfig xmppConfig = new XmppConfig(); private static final Log log = LogFactory.getLog(XmppConfig.class); @@ -48,12 +50,13 @@ public class XmppConfig { Properties properties = new Properties(); properties.load(propertyStream); xmppServerIP = properties.getProperty(VirtualFireAlarmConstants.HOST_KEY); + xmppServerName = properties.getProperty(VirtualFireAlarmConstants.SERVER_NAME); xmppServerPort = Integer.parseInt(properties.getProperty(VirtualFireAlarmConstants.PORT_KEY)); isEnabled = Boolean.parseBoolean(properties.getProperty(VirtualFireAlarmConstants.IS_ENABLED_KEY)); xmppUsername = properties.getProperty(VirtualFireAlarmConstants.ADMIN_USERNAME); xmppPassword = properties.getProperty(VirtualFireAlarmConstants.ADMIN_PASSWORD); virtualFirealarmAdminUsername = "wso2admin_" + VirtualFireAlarmConstants.DEVICE_TYPE; - virtualFirealarmAdminJID = virtualFirealarmAdminUsername + "@" + xmppServerIP; + virtualFirealarmAdminJID = virtualFirealarmAdminUsername + "@" + xmppServerName; virtualFirealarmAdminPassword = VirtualFireAlarmConstants.XMPP_SERVER_PASSWORD; } catch (IOException e) { log.error(e); @@ -97,4 +100,7 @@ public class XmppConfig { return virtualFirealarmAdminJID; } + public String getXmppServerName() { + return xmppServerName; + } } diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppServerClient.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppServerClient.java index fccb6c70a..e2607b71a 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppServerClient.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppServerClient.java @@ -18,8 +18,6 @@ package org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.xmpp; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jivesoftware.smack.AccountManager; import org.jivesoftware.smack.ConnectionConfiguration; import org.jivesoftware.smack.XMPPConnection; @@ -36,7 +34,8 @@ public class XmppServerClient { if (xmppAccount != null) { try { ConnectionConfiguration config = new ConnectionConfiguration(XmppConfig.getInstance().getXmppServerIP(), - XmppConfig.getInstance().getXmppServerPort()); + XmppConfig.getInstance().getXmppServerPort(), + "Accounts"); XMPPConnection xmppConnection = new XMPPConnection(config); xmppConnection.connect(); xmppConnection.login(XmppConfig.getInstance().getXmppUsername(), XmppConfig.getInstance().getXmppPassword()); diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppUtil.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppUtil.java index fa6f3c089..4e60862b8 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppUtil.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/xmpp/XmppUtil.java @@ -32,10 +32,10 @@ public class XmppUtil { XmppServerClient xmppServerClient = new XmppServerClient(); try { XmppAccount xmppAccount = new XmppAccount(); - xmppAccount.setAccountName(XmppConfig.getInstance().getVirtualFirealarmAdminJID()); + xmppAccount.setAccountName(XmppConfig.getInstance().getVirtualFirealarmAdminUsername()); xmppAccount.setUsername(XmppConfig.getInstance().getVirtualFirealarmAdminUsername()); xmppAccount.setPassword(XmppConfig.getInstance().getVirtualFirealarmAdminPassword()); - xmppAccount.setEmail(""); + xmppAccount.setEmail(XmppConfig.getInstance().getVirtualFirealarmAdminJID()); xmppServerClient.createAccount(xmppAccount); } catch (VirtualFirealarmDeviceMgtPluginException e) { String errorMsg = "An error was encountered whilst trying to create Server XMPP account for device-type - " diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.js b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.js index 2009b37fc..4dd97dd23 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.js +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.js @@ -21,8 +21,7 @@ function onRequest(context) { var deviceType = context.uriParams.deviceType; var deviceId = request.getParameter("id"); var autoCompleteParams = [ - {"name" : "deviceId", "value" : deviceId}, - {"name" : "protocol", "value" : "MQTT"} + {"name" : "deviceId", "value" : deviceId} ]; if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { diff --git a/features/iot-plugins-feature/iot-base-plugin-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/conf/xmpp.properties b/features/iot-plugins-feature/iot-base-plugin-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/conf/xmpp.properties index 23e272d69..c85a6e6b5 100644 --- a/features/iot-plugins-feature/iot-base-plugin-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/conf/xmpp.properties +++ b/features/iot-plugins-feature/iot-base-plugin-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/conf/xmpp.properties @@ -2,4 +2,5 @@ enabled=false host=localhost port=5222 admin.username=admin -admin.password=admin \ No newline at end of file +admin.password=admin +serverName=localhost \ No newline at end of file diff --git a/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/deviceConfig.properties b/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/deviceConfig.properties index 874f87585..47a3a73a6 100644 --- a/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/deviceConfig.properties +++ b/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/deviceConfig.properties @@ -31,5 +31,5 @@ auth-method=token auth-token=${DEVICE_TOKEN} refresh-token=${DEVICE_REFRESH_TOKEN} push-interval=15 - +xmpp-server-name=${SERVER_NAME} diff --git a/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/deviceConfig.properties b/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/deviceConfig.properties index 874f87585..47a3a73a6 100644 --- a/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/deviceConfig.properties +++ b/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/deviceConfig.properties @@ -31,5 +31,5 @@ auth-method=token auth-token=${DEVICE_TOKEN} refresh-token=${DEVICE_REFRESH_TOKEN} push-interval=15 - +xmpp-server-name=${SERVER_NAME}