diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_execution/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_execution/artifact.xml new file mode 100644 index 0000000000..f14c53a366 --- /dev/null +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_execution/artifact.xml @@ -0,0 +1,23 @@ + + + + + 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/android_sense_receiver/android_sense_receiver.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_receiver/android_sense_receiver.xml new file mode 100644 index 0000000000..3533805799 --- /dev/null +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_receiver/android_sense_receiver.xml @@ -0,0 +1,34 @@ + + + + + + carbon.super/android_sense/+/data + admin + 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/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_receiver/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_receiver/artifact.xml new file mode 100644 index 0000000000..1a154bc928 --- /dev/null +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_receiver/artifact.xml @@ -0,0 +1,22 @@ + + + + + EventReceiver_AndroidSense.xml + diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_stream/artifact.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_stream/artifact.xml new file mode 100644 index 0000000000..10ab23d9ba --- /dev/null +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/Android_Sense/android_sense_stream/artifact.xml @@ -0,0 +1,23 @@ + + + + + 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/androidsense/android_sense_execution/android_sense_execution.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 new file mode 100644 index 0000000000..2304e2eca3 --- /dev/null +++ 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 @@ -0,0 +1,87 @@ +/* Enter a unique ExecutionPlan */ +@Plan:name('android_sense_execution') + +/* Enter a unique description for ExecutionPlan */ +-- @Plan:description('android_sense_execution') + +/* define streams/tables and write queries here ... */ + +@Export('org.wso2.iot.devices.wordcount:1.0.0') +define stream words (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, sessionId string, word string, status string); + +@Export('org.wso2.iot.devices.rotation:1.0.0') +define stream rotation (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, x float, y float, z float); + +@Export('org.wso2.iot.devices.proximity:1.0.0') +define stream proximity (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, proximity float); + +@Export('org.wso2.iot.devices.pressure:1.0.0') +define stream pressure (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, pressure float); + +@Export('org.wso2.iot.devices.magnetic:1.0.0') +define stream magnetic (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, x float, y float, z float); + +@Export('org.wso2.iot.devices.light:1.0.0') +define stream light (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, light float); + +@Export('org.wso2.iot.devices.gyroscope:1.0.0') +define stream gyroscope (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, x float, y float, z float); + +@Export('org.wso2.iot.devices.gravity:1.0.0') +define stream gravity (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, x float, y float, z float); + +@Export('org.wso2.iot.devices.gps:1.0.0') +define stream gps (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, latitude double, longitude double); + +@Export('org.wso2.iot.devices.battery:1.0.0') +define stream battery (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, level int); + +@Export('org.wso2.iot.devices.accelerometer:1.0.0') +define stream accelerometer (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, x float, y float, z float); + +@Import('org.wso2.iot.android.sense:1.0.0') +define stream androidsense (meta_owner string, meta_deviceId string, meta_type string, meta_timestamp long, battery int, gps_lat double, gps_long double, accelerometer_x float, accelerometer_y float, accelerometer_z float, magnetic_x float, magnetic_y float, magnetic_z float, gyroscope_x float, gyroscope_y float, gyroscope_z float, light float, pressure float, proximity float, gravity_x float, gravity_y float, gravity_z float, rotation_x float, rotation_y float, rotation_z float, word string, word_sessionId string, word_status string); + +from androidsense[meta_type == 'accelerometer'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, accelerometer_x as x, accelerometer_y as y, accelerometer_z as z +insert into accelerometer; + +from androidsense[meta_type == 'battery'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, battery as level +insert into battery; + +from androidsense[meta_type == 'gps'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, gps_lat as latitude, gps_long as longitude +insert into gps; + +from androidsense[meta_type == 'gravity'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, gravity_x as x, gravity_y as y, gravity_z as z +insert into gravity; + +from androidsense[meta_type == 'gyroscope'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, gyroscope_x as x, gyroscope_y as y, gyroscope_z as z +insert into gyroscope; + +from androidsense[meta_type == 'light'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, light +insert into light; + +from androidsense[meta_type == 'magnetic'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, magnetic_x as x, magnetic_y as y, magnetic_z as z +insert into magnetic; + +from androidsense[meta_type == 'pressure'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, pressure +insert into pressure; + +from androidsense[meta_type == 'proximity'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, proximity +insert into proximity; + +from androidsense[meta_type == 'rotation'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, rotation_x as x, rotation_y as y, rotation_z as z +insert into rotation; + +from androidsense[meta_type == 'word'] +select meta_owner, 'android_sense' as meta_deviceType, meta_deviceId, meta_timestamp as meta_time, word_sessionId as sessionId, word as word, word_status as status +insert into words; \ No newline at end of file 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/androidsense/android_sense_publisher/android_sense_publisher.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 new file mode 100644 index 0000000000..f2da5e909b --- /dev/null +++ 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 @@ -0,0 +1,25 @@ + + + + + + + + + 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/androidsense/android_sense_receiver/android_sense_receiver.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 new file mode 100644 index 0000000000..3533805799 --- /dev/null +++ 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 @@ -0,0 +1,34 @@ + + + + + + carbon.super/android_sense/+/data + admin + 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/androidsense/android_sense_stream/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 new file mode 100644 index 0000000000..efc77622fb --- /dev/null +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_stream/artifact.xml @@ -0,0 +1,23 @@ + + + + + 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/androidsense/android_sense_stream/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 new file mode 100644 index 0000000000..f9048dd33b --- /dev/null +++ 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 @@ -0,0 +1,38 @@ +{ + "name": "org.wso2.iot.android.sense", + "version": "1.0.0", + "nickName": "android_sense_stream", + "description": "This hold the device type stream of android sense", + "metaData": [ + {"name": "owner", "type": "STRING"}, + {"name": "deviceId", "type": "STRING"}, + {"name": "type", "type": "STRING"}, + {"name": "timestamp", "type": "LONG"} + ], + "payloadData": [ + {"name": "battery", "type": "INT"}, + {"name": "gps_lat", "type": "DOUBLE"}, + {"name": "gps_long", "type": "DOUBLE"}, + {"name": "accelerometer_x", "type": "FLOAT"}, + {"name": "accelerometer_y", "type": "FLOAT"}, + {"name": "accelerometer_z", "type": "FLOAT"}, + {"name": "magnetic_x", "type": "FLOAT"}, + {"name": "magnetic_y", "type": "FLOAT"}, + {"name": "magnetic_z", "type": "FLOAT"}, + {"name": "gyroscope_x", "type": "FLOAT"}, + {"name": "gyroscope_y", "type": "FLOAT"}, + {"name": "gyroscope_z", "type": "FLOAT"}, + {"name": "light", "type": "FLOAT"}, + {"name": "pressure", "type": "FLOAT"}, + {"name": "proximity", "type": "FLOAT"}, + {"name": "gravity_x", "type": "FLOAT"}, + {"name": "gravity_y", "type": "FLOAT"}, + {"name": "gravity_z", "type": "FLOAT"}, + {"name": "rotation_x", "type": "FLOAT"}, + {"name": "rotation_y", "type": "FLOAT"}, + {"name": "rotation_z", "type": "FLOAT"}, + {"name": "word", "type": "STRING"}, + {"name": "word_sessionId", "type": "STRING"}, + {"name": "word_status", "type": "STRING"} + ] +} \ No newline at end of file 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/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/word_count/word_count_receiver/word_count_receiver.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 new file mode 100644 index 0000000000..fe17694e80 --- /dev/null +++ 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 @@ -0,0 +1,27 @@ + + + + + + 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