From a83b9a70ed012ca49cc6e5e1145bef34d194eb48 Mon Sep 17 00:00:00 2001 From: savidude Date: Tue, 20 Jun 2017 19:31:05 +0530 Subject: [PATCH] Removing default policy in Virtual Firealarm advanced agent --- .../agent/advanced/core/AgentConstants.java | 11 ----------- .../agent/advanced/sidhdhi/SidhdhiQuery.java | 2 +- .../src/main/resources/advanced_agent/cep_query.txt | 11 ----------- 3 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/cep_query.txt diff --git a/components/device-types/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/device-types/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 0f83aa4d1f..1e732c752e 100644 --- a/components/device-types/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/device-types/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 @@ -120,17 +120,6 @@ public class AgentConstants { public static final String XMPP_PROTOCOL = "XMPP"; public static final String CEP_FILE_NAME = "cep_query.txt"; - public static final String CEP_QUERY = "define stream fireAlarmEventStream (deviceID string, temp int);\n" + - "from fireAlarmEventStream#window.time(30 sec)\n" + - "select deviceID, max(temp) as maxValue\n" + - "group by deviceID\n" + - "insert into analyzeStream for expired-events;\n" + - "from analyzeStream[maxValue > 50]\n" + - "select maxValue\n" + - "insert into bulbOnStream;\n" + - "from fireAlarmEventStream[temp < 50]\n" + - "select deviceID, temp\n" + - "insert into bulbOffStream;"; public static final String XMPP_SERVER_NAME_PROPERTY = "xmpp-server-name"; diff --git a/components/device-types/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/sidhdhi/SidhdhiQuery.java b/components/device-types/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/sidhdhi/SidhdhiQuery.java index 94e6bd525f..66829bbdfd 100644 --- a/components/device-types/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/sidhdhi/SidhdhiQuery.java +++ b/components/device-types/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/sidhdhi/SidhdhiQuery.java @@ -70,7 +70,7 @@ public class SidhdhiQuery implements Runnable { File f = new File(sidhdhiQueryPath); if (!f.exists()) { - AgentUtilOperations.writeToFile(AgentConstants.CEP_QUERY, sidhdhiQueryPath); + AgentUtilOperations.writeToFile("", sidhdhiQueryPath); } StartExecutionPlan startExecutionPlan = new StartExecutionPlan().invoke(); diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/cep_query.txt b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/cep_query.txt deleted file mode 100644 index 6e66340818..0000000000 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/cep_query.txt +++ /dev/null @@ -1,11 +0,0 @@ -define stream fireAlarmEventStream (deviceID string, temp int); -from fireAlarmEventStream#window.time(10 sec) -select deviceID, max(temp) as maxValue -group by deviceID -insert into analyzeStream for expired-events; -from analyzeStream[maxValue < 60] -select maxValue -insert into bulbOnStream; -from fireAlarmEventStream[temp > 60] -select deviceID, temp -insert into bulbOffStream; \ No newline at end of file