diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java index 694445f735..7a38a251d9 100755 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java @@ -176,14 +176,8 @@ public class DataPublisherService extends Service { if (!mqttTransportHandler.isConnected()) { mqttTransportHandler.connect(); } - - - String topic = "wso2/" + LocalRegistry.getTenantDomain(context) + "/" + SenseConstants - .DEVICE_TYPE + "/" + deviceId + "/data"; - mqttTransportHandler.publishDeviceData(user, deviceId, jsonArray.toString(), topic); - - - + String topic = LocalRegistry.getTenantDomain(context) + "/" + SenseConstants.DEVICE_TYPE + "/" + deviceId + "/data"; + mqttTransportHandler.publishDeviceData(user, deviceId, jsonArray.toString(), topic); } } catch (JSONException e) { Log.e(TAG, "Json Data Parsing Exception", e); diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java index c2bd4b5d29..17884381c0 100755 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java @@ -77,7 +77,7 @@ public abstract class MQTTTransportHandler implements MqttCallback, TransportHan String username = LocalRegistry.getUsername(context); String deviceId = LocalRegistry.getDeviceId(context); this.clientId = deviceId + ":" + SenseConstants.DEVICE_TYPE; - this.subscribeTopic = "wso2/" + LocalRegistry.getTenantDomain(context)+ "/" + SenseConstants.DEVICE_TYPE + "/" + + this.subscribeTopic = LocalRegistry.getTenantDomain(context)+ "/" + SenseConstants.DEVICE_TYPE + "/" + deviceId + "/command/#"; this.clientWillTopic = DISCONNECTION_WILL_TOPIC_PREFIX + SenseConstants.DEVICE_TYPE; this.mqttBrokerEndPoint = LocalRegistry.getMqttEndpoint(context); diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/build.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/build.xml index fa8c79f574..7753265876 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/build.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/build.xml @@ -17,13 +17,14 @@ ~ under the License. --> - + - + + @@ -34,5 +35,8 @@ + + + diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventExecution_AndroidSense_1.0.0/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventExecution_AndroidSense_1.0.0/artifact.xml deleted file mode 100644 index f14c53a366..0000000000 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventExecution_AndroidSense_1.0.0/artifact.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - EventExecution_AndroidSense.siddhiql - - diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventPublisher_AndroidSense_1.0.0/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventPublisher_AndroidSense_1.0.0/artifact.xml deleted file mode 100644 index 3dd245c736..0000000000 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventPublisher_AndroidSense_1.0.0/artifact.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - EventPublisher_AndroidSense.xml - diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/artifacts.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/artifacts.xml deleted file mode 100644 index 76ee9774c4..0000000000 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/artifacts.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventExecution_AndroidSense_1.0.0/EventExecution_AndroidSense.siddhiql b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_execution/android_sense_execution.siddhiql similarity index 100% rename from components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventExecution_AndroidSense_1.0.0/EventExecution_AndroidSense.siddhiql rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_execution/android_sense_execution.siddhiql diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_execution/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_execution/artifact.xml new file mode 100644 index 0000000000..f2a5be12eb --- /dev/null +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_execution/artifact.xml @@ -0,0 +1,23 @@ + + + + + android_sense_execution.siddhiql + + diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventPublisher_AndroidSense_1.0.0/EventPublisher_AndroidSense.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_publisher/android_sense_publisher.xml similarity index 87% rename from components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventPublisher_AndroidSense_1.0.0/EventPublisher_AndroidSense.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_publisher/android_sense_publisher.xml index 1bb0d5c433..f2da5e909b 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventPublisher_AndroidSense_1.0.0/EventPublisher_AndroidSense.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_publisher/android_sense_publisher.xml @@ -17,7 +17,7 @@ ~ under the License. --> - + diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_publisher/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_publisher/artifact.xml new file mode 100644 index 0000000000..319b77ccf7 --- /dev/null +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_publisher/artifact.xml @@ -0,0 +1,22 @@ + + + + + android_sense_publisher.xml + diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventReceiver_AndroidSense_1.0.0/EventReceiver_AndroidSense.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/android_sense_receiver.xml similarity index 73% rename from components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventReceiver_AndroidSense_1.0.0/EventReceiver_AndroidSense.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/android_sense_receiver.xml index a72ab6ca2b..3533805799 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventReceiver_AndroidSense_1.0.0/EventReceiver_AndroidSense.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/android_sense_receiver.xml @@ -17,12 +17,13 @@ ~ under the License. --> - + carbon.super/android_sense/+/data admin - device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:2 - default + device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:2 + org.wso2.carbon.device.mgt.iot.input.adapter.mqtt.util.MQTTContentValidator + default https://localhost:${carbon.https.port}/dynamic-client-web/register tcp://${mqtt.broker.host}:${mqtt.broker.port} true diff --git a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Magnetic/Eventreceiver_magnetic_1.0.0/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/artifact.xml similarity index 87% rename from components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Magnetic/Eventreceiver_magnetic_1.0.0/artifact.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/artifact.xml index 4a9272db8d..5f7a73ce59 100644 --- a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Magnetic/Eventreceiver_magnetic_1.0.0/artifact.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/artifact.xml @@ -17,6 +17,6 @@ ~ under the License. --> - - EventReceiver_magnetic.xml + + android_sense_receiver.xml diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventStream_AndroidSense_1.0.0/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_stream/artifact.xml similarity index 87% rename from components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventStream_AndroidSense_1.0.0/artifact.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_stream/artifact.xml index 10ab23d9ba..efc77622fb 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventStream_AndroidSense_1.0.0/artifact.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_stream/artifact.xml @@ -17,7 +17,7 @@ ~ under the License. --> - + org.wso2.iot.android.sense_1.0.0.json diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventStream_AndroidSense_1.0.0/org.wso2.iot.android.sense_1.0.0.json b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_stream/org.wso2.iot.android.sense_1.0.0.json similarity index 100% rename from components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/EventStream_AndroidSense_1.0.0/org.wso2.iot.android.sense_1.0.0.json rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_stream/org.wso2.iot.android.sense_1.0.0.json diff --git a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Rotation/artifacts.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/artifacts.xml similarity index 59% rename from components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Rotation/artifacts.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/artifacts.xml index 7bbe4ac500..a03fa2c2de 100644 --- a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Rotation/artifacts.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/artifacts.xml @@ -18,12 +18,10 @@ --> - - - - - - - + + + + + diff --git a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Light/artifacts.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/artifacts.xml similarity index 70% rename from components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Light/artifacts.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/artifacts.xml index 39b009e53c..e3a25034f0 100644 --- a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Light/artifacts.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/artifacts.xml @@ -18,10 +18,10 @@ --> - - - - - + + + + + diff --git a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Light/Eventreceiver_light_1.0.0/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_receiver/artifact.xml similarity index 88% rename from components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Light/Eventreceiver_light_1.0.0/artifact.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_receiver/artifact.xml index 604e9384e4..81cc820090 100644 --- a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/Light/Eventreceiver_light_1.0.0/artifact.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_receiver/artifact.xml @@ -17,6 +17,6 @@ ~ under the License. --> - - EventReceiver_light.xml + + word_count_receiver.xml diff --git a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/WordCount/Eventreceiver_wordcount_1.0.0/EventReceiver_wordcount.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_receiver/word_count_receiver.xml similarity index 92% rename from components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/WordCount/Eventreceiver_wordcount_1.0.0/EventReceiver_wordcount.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_receiver/word_count_receiver.xml index dac705e766..fe17694e80 100644 --- a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/WordCount/Eventreceiver_wordcount_1.0.0/EventReceiver_wordcount.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_receiver/word_count_receiver.xml @@ -17,7 +17,7 @@ ~ under the License. --> - false diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_script/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_script/artifact.xml new file mode 100644 index 0000000000..be0d2bdcb3 --- /dev/null +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_script/artifact.xml @@ -0,0 +1,22 @@ + + + + + word_count_script.xml + diff --git a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/WordCount/Sparkscripts_1.0.0/Wordcount_Script.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_script/word_count_script.xml similarity index 97% rename from components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/WordCount/Sparkscripts_1.0.0/Wordcount_Script.xml rename to components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_script/word_count_script.xml index bfc3db8795..e20c5bcc44 100644 --- a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/WordCount/Sparkscripts_1.0.0/Wordcount_Script.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_script/word_count_script.xml @@ -18,7 +18,7 @@ --> - IoTServer_Sensor_Script + word_count_script