refactored connected cup analytics scripts

application-manager-new
ayyoob 9 years ago
parent c5ce89c68b
commit 0b893ad64c

@ -23,8 +23,8 @@
<property name="target-dir" value="target/carbonapps"/> <property name="target-dir" value="target/carbonapps"/>
<property name="src-dir" value="src/main/resources/carbonapps"/> <property name="src-dir" value="src/main/resources/carbonapps"/>
<property name="ConnectedCup_dir" value="ConnectedCup"/> <property name="ConnectedCup_dir" value="connected_cup"/>
<property name="CoffeeLevel_Sensor_dir" value="CoffeeLevel_Sensor"/> <property name="CoffeeLevel_Sensor_dir" value="coffee_level"/>
<target name="clean"> <target name="clean">
<delete dir="${target-dir}" /> <delete dir="${target-dir}" />

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<artifact name="EventExecution_ConnectedCup" version="1.0.0" type="event/execution-plan" serverRole="DataAnalyticsServer">
<file>EventExecution_ConnectedCup.siddhiql</file>
</artifact>

@ -18,10 +18,10 @@
--> -->
<artifacts> <artifacts>
<artifact name="ConnectedCup_CAPP" version="1.0.0" type="carbon/application"> <artifact name="coffee_level" version="1.0.0" type="carbon/application">
<dependency artifact="EventStream_ConnectedCup" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/> <dependency artifact="coffee_level_stream" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="connectedcup_reciever" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/> <dependency artifact="coffee_level_store" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="EventPublisher_ConnectedCup" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/> <dependency artifact="coffee_level_receiver" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="EventExecution_ConnectedCup" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/> <dependency artifact="coffee_level_script" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
</artifact> </artifact>
</artifacts> </artifacts>

@ -17,6 +17,6 @@
~ under the License. ~ under the License.
--> -->
<artifact name="Eventreceiver_coffeelevel" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer"> <artifact name="coffee_level_receiver" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer">
<file>EventReceiver_coffeelevel.xml</file> <file>coffee_level_receiver.xml</file>
</artifact> </artifact>

@ -17,7 +17,7 @@
~ under the License. ~ under the License.
--> -->
<eventReceiver name="EventReceiver_coffeelevel" statistics="disable" trace="disable" <eventReceiver name="coffee_level_receiver" statistics="disable" trace="disable"
xmlns="http://wso2.org/carbon/eventreceiver"> xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="wso2event"> <from eventAdapterType="wso2event">
<property name="events.duplicated.in.cluster">false</property> <property name="events.duplicated.in.cluster">false</property>

@ -18,5 +18,5 @@
--> -->
<artifact name="Sparkscripts" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer"> <artifact name="Sparkscripts" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>CoffeeLevel_Sensor_Script.xml</file> <file>coffee_level_script.xml</file>
</artifact> </artifact>

@ -18,7 +18,7 @@
--> -->
<Analytics> <Analytics>
<Name>CoffeeLevel_Sensor_Script</Name> <Name>coffee_level_script</Name>
<Script> <Script>
CREATE TEMPORARY TABLE DeviceCoffeeLevelData USING CarbonAnalytics OPTIONS(tableName CREATE TEMPORARY TABLE DeviceCoffeeLevelData USING CarbonAnalytics OPTIONS(tableName
"ORG_WSO2_IOT_DEVICES_COFFEELEVEL"); "ORG_WSO2_IOT_DEVICES_COFFEELEVEL");

@ -17,6 +17,6 @@
~ under the License. ~ under the License.
--> -->
<artifact name="Eventstore_coffeelevel" version="1.0.0" type="analytics/eventstore" serverRole="DataAnalyticsServer"> <artifact name="coffee_level_store" version="1.0.0" type="analytics/eventstore" serverRole="DataAnalyticsServer">
<file>org_wso2_iot_devices_coffeelevel.xml</file> <file>org_wso2_iot_devices_coffeelevel.xml</file>
</artifact> </artifact>

@ -17,7 +17,7 @@
~ under the License. ~ under the License.
--> -->
<artifact name="Eventstream_coffeelevel" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer"> <artifact name="coffee_level_stream" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.devices.coffeelevel_1.0.0.json</file> <file>org.wso2.iot.devices.coffeelevel_1.0.0.json</file>
</artifact> </artifact>

@ -18,13 +18,10 @@
--> -->
<artifacts> <artifacts>
<artifact name="CoffeeLevel_CAPP" version="1.0.0" type="carbon/application"> <artifact name="connected_cup" version="1.0.0" type="carbon/application">
<dependency artifact="connected_cup_stream" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="Eventstream_coffeelevel" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/> <dependency artifact="connected_cup_receiver" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="Eventstore_coffeelevel" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/> <dependency artifact="connected_cup_publisher" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="Eventreceiver_coffeelevel" version="1.0.0" include="true" <dependency artifact="connected_cup_execution" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
serverRole="DataAnalyticsServer"/>
<dependency artifact="Sparkscripts" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
</artifact> </artifact>
</artifacts> </artifacts>

@ -17,6 +17,7 @@
~ under the License. ~ under the License.
--> -->
<artifact name="EventPublisher_ConnectedCup" version="1.0.0" type="event/publisher" serverRole="DataAnalyticsServer"> <artifact name="connected_cup_execution" version="1.0.0" type="event/execution-plan" serverRole="DataAnalyticsServer">
<file>EventPublisher_ConnectedCup.xml</file> <file>connected_cup_execution.siddhiql</file>
</artifact> </artifact>

@ -1,8 +1,8 @@
/* Enter a unique ExecutionPlan */ /* Enter a unique ExecutionPlan */
@Plan:name('connectedcup_execution') @Plan:name('connected_cup_execution')
/* Enter a unique description for ExecutionPlan */ /* Enter a unique description for ExecutionPlan */
-- @Plan:description('connectedcup_execution') -- @Plan:description('connected_cup_execution')
/* define streams/tables and write queries here ... */ /* define streams/tables and write queries here ... */

@ -17,6 +17,6 @@
~ under the License. ~ under the License.
--> -->
<artifact name="EventReceiver_ConnectedCup" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer"> <artifact name="connected_cup_publisher" version="1.0.0" type="event/publisher" serverRole="DataAnalyticsServer">
<file>EventReceiver_ConnectedCup.xml</file> <file>connected_cup_publisher.xml</file>
</artifact> </artifact>

@ -17,7 +17,7 @@
~ under the License. ~ under the License.
--> -->
<eventPublisher name="EventPublisher_ConnectedCup" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher"> <eventPublisher name="connected_cup_publisher" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
<from streamName="org.wso2.iot.connectedcup" version="1.0.0"/> <from streamName="org.wso2.iot.connectedcup" version="1.0.0"/>
<mapping customMapping="disable" type="wso2event"/> <mapping customMapping="disable" type="wso2event"/>
<to eventAdapterType="iot-ui"/> <to eventAdapterType="iot-ui"/>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<artifact name="connected_cup_receiver" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer">
<file>connected_cup_receiver.xml</file>
</artifact>

@ -17,12 +17,13 @@
~ under the License. ~ under the License.
--> -->
<eventReceiver name="connectedcup_reciever" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver"> <eventReceiver name="EventReceiver_ConnectedCup" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="oauth-mqtt"> <from eventAdapterType="oauth-mqtt">
<property name="topic">carbon.super/connectedcup/#</property> <property name="topic">carbon.super/connectedcup/#</property>
<property name="username">admin</property> <property name="username">admin</property>
<property name="contentValidationParams">device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:3</property> <property name="contentValidatorParams">device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:2</property>
<property name="contentValidation">org.wso2.carbon.device.mgt.iot.input.adapter.mqtt.util.MQTTContentValidator</property> <property name="contentValidator">org.wso2.carbon.device.mgt.iot.input.adapter.mqtt.util.MQTTContentValidator</property>
<property name="contentTransformer">default</property>
<property name="dcrUrl">https://localhost:${carbon.https.port}/dynamic-client-web/register</property> <property name="dcrUrl">https://localhost:${carbon.https.port}/dynamic-client-web/register</property>
<property name="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property> <property name="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property>
<property name="cleanSession">true</property> <property name="cleanSession">true</property>

@ -17,7 +17,7 @@
~ under the License. ~ under the License.
--> -->
<artifact name="EventStream_ConnectedCup" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer"> <artifact name="connected_cup_stream" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.connectedcup_1.0.0.json</file> <file>org.wso2.iot.connectedcup_1.0.0.json</file>
</artifact> </artifact>
Loading…
Cancel
Save