Merge pull request #134 from ayyoob/das-ext

added missing license headers and refactored analytics scripts
application-manager-new
Milan Perera 9 years ago
commit 0c4409fba4

@ -1,3 +1,21 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.coffeeking.agent.datasense;
import org.apache.commons.logging.Log;

@ -1,3 +1,21 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.coffeeking.agent.datasense;
import org.apache.commons.logging.Log;

@ -1,3 +1,21 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.coffeeking.agent.transport.mqtt;
import org.apache.commons.logging.Log;

@ -23,8 +23,8 @@
<property name="target-dir" value="target/carbonapps"/>
<property name="src-dir" value="src/main/resources/carbonapps"/>
<property name="ConnectedCup_dir" value="ConnectedCup"/>
<property name="CoffeeLevel_Sensor_dir" value="CoffeeLevel_Sensor"/>
<property name="ConnectedCup_dir" value="connected_cup"/>
<property name="CoffeeLevel_Sensor_dir" value="coffee_level"/>
<target name="clean">
<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>
<artifact name="ConnectedCup_CAPP" version="1.0.0" type="carbon/application">
<dependency artifact="EventStream_ConnectedCup" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="EventReceiver_ConnectedCup" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="EventPublisher_ConnectedCup" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="EventExecution_ConnectedCup" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<artifact name="coffee_level" version="1.0.0" type="carbon/application">
<dependency artifact="coffee_level_stream" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="coffee_level_store" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="coffee_level_receiver" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="coffee_level_script" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
</artifact>
</artifacts>

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

@ -17,7 +17,7 @@
~ 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">
<from eventAdapterType="wso2event">
<property name="events.duplicated.in.cluster">false</property>

@ -18,5 +18,5 @@
-->
<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>

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

@ -17,6 +17,6 @@
~ 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>
</artifact>

@ -17,7 +17,7 @@
~ 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>
</artifact>

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

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

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

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

@ -17,7 +17,7 @@
~ 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"/>
<mapping customMapping="disable" type="wso2event"/>
<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>

@ -19,15 +19,15 @@
<eventReceiver name="EventReceiver_ConnectedCup" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="oauth-mqtt">
<property name="topic">wso2/carbon.super/connectedcup/#</property>
<property name="topic">carbon.super/connectedcup/#</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="contentValidation">default</property>
<property name="dcrUrl">https://localhost:9443/dynamic-client-web/register</property>
<property name="url">tcp://localhost:1883</property>
<property name="contentValidatorParams">device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:2</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="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property>
<property name="cleanSession">true</property>
</from>
<mapping customMapping="disable" type="json"/>
<to streamName="org.wso2.iot.connectedcup" version="1.0.0"/>
</eventReceiver>

@ -17,7 +17,7 @@
~ 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>
</artifact>

@ -39,8 +39,7 @@ public interface ConnectedCupControllerService {
@Path("device/ordercoffee")
@POST
@Feature(code = "ordercoffee", name = "Order Coffee", type = "control",
description = "Order coffee cup")
@Feature(code = "ordercoffee", name = "Order Coffee", description = "Order coffee cup")
Response orderCoffee(@QueryParam("deviceId") String deviceId);
/**

@ -1,3 +1,21 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.coffeeking.api.util;
import org.apache.commons.logging.Log;

@ -1,8 +1,22 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.coffeeking.connectedcup.plugin.constants;
/**
* Created by menaka on 1/11/16.
*/
public class ConnectedCupConstants {
public final static String DEVICE_TYPE = "connectedcup";
public final static String DEVICE_PLUGIN_DEVICE_NAME = "DEVICE_NAME";

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* 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

Loading…
Cancel
Save