From 9e64c8971d2b135c01fbc1296cc3fb936240b748 Mon Sep 17 00:00:00 2001 From: Arcane94 Date: Fri, 23 Feb 2018 11:17:30 +0530 Subject: [PATCH] Minor changes in execution plans --- .../mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java | 2 +- .../resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql | 2 +- .../Geo-ExecutionPlan-Exit_alert_for_GeoClusters.siddhiql | 2 +- .../resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql | 4 ++-- .../Geo-ExecutionPlan-Speed_alert_for_GeoClusters.siddhiql | 4 ++-- .../alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql | 2 +- ...eo-ExecutionPlan-Stationery_alert_for_GeoClusters.siddhiql | 2 +- .../resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql | 2 +- .../Geo-ExecutionPlan-Within_alert_for_GeoClusters.siddhiql | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java index c5c96263b9..4f34589157 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java @@ -408,7 +408,7 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { } return null; } catch (GeoLocationBasedServiceException e) { - String error = "Error occurred while getting the geo alerts for " + alertType + "alert"; + String error = "Error occurred while getting the geo alerts for " + alertType + " alert"; log.error(error, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(error).build(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql index 0b93582f3a..ac6d350cf6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql @@ -13,7 +13,7 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string, state string, information string); from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==false and id == "$deviceId"]#geodashboard:subscribe() -select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, "This device is outside $areaName area!!!" as information +select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id), " is outside $areaName area!!!") as information insert into dataOut; from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=false and id == "$deviceId"] select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert_for_GeoClusters.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert_for_GeoClusters.siddhiql index 2259abacdc..68fe23e0b8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert_for_GeoClusters.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert_for_GeoClusters.siddhiql @@ -13,7 +13,7 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string, state string, information string); from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==false]#geodashboard:subscribe() -select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, "This device is outside $areaName area!!!" as information +select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id), " is outside $areaName area!!!") as information insert into dataOut; from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=false] select id, latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql index 93c7ca622f..39c4a0b280 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql @@ -13,10 +13,10 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string, state string, information string); from dataIn[speed >= $speedAlertValue and id == "$deviceId"]#geodashboard:subscribe() -select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "ALERTED" as state, "This device movement is not normal!!" as information +select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "ALERTED" as state, str:concat(str:concat(str:concat(str:concat("Movement of ",type), " device "), id), " is not normal!!") as information insert into dataOut; from dataIn[speed < $speedAlertValue and id == "$deviceId"] -select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "NORMAL" as state, "This device movement is normal" as information +select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "NORMAL" as state, str:concat(str:concat(str:concat(str:concat("Movement of ",type), " device "), id), " is normal") as information insert into dataOut; from dataIn[id != "$deviceId"] select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert_for_GeoClusters.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert_for_GeoClusters.siddhiql index 62d76659ce..ba7a6d24d9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert_for_GeoClusters.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert_for_GeoClusters.siddhiql @@ -13,9 +13,9 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string, state string, information string); from dataIn[speed >= $speedAlertValue]#geodashboard:subscribe() -select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "ALERTED" as state, "This device movement is not normal!!" as information +select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "ALERTED" as state, str:concat(str:concat(str:concat(str:concat("Movement of ",type), " device "), id), " is not normal!!") as information insert into dataOut; from dataIn[speed < $speedAlertValue] -select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "NORMAL" as state, "This device movement is normal" as information +select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "NORMAL" as state, str:concat(str:concat(str:concat(str:concat("Movement of ",type), " device "), id), " is normal") as information insert into dataOut; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql index 46bfbfe2e3..6f0e8aac75 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql @@ -81,7 +81,7 @@ select id , latitude, longitude,timeStamp, type, speed, heading ,eventId ,"false insert into dataOutStream; from dataOutStream[isStationary == 'true'] -select id ,latitude, longitude,timeStamp, type, speed, heading ,eventId ,"ALERTED" as state, "This device is in $stationeryName area!!!" as information +select id ,latitude, longitude,timeStamp, type, speed, heading ,eventId ,"ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id),"is in $stationeryName area!!!") as information insert into dataOut; from dataOutStream[isStationary == 'false'] diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert_for_GeoClusters.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert_for_GeoClusters.siddhiql index 46bfbfe2e3..6f0e8aac75 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert_for_GeoClusters.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert_for_GeoClusters.siddhiql @@ -81,7 +81,7 @@ select id , latitude, longitude,timeStamp, type, speed, heading ,eventId ,"false insert into dataOutStream; from dataOutStream[isStationary == 'true'] -select id ,latitude, longitude,timeStamp, type, speed, heading ,eventId ,"ALERTED" as state, "This device is in $stationeryName area!!!" as information +select id ,latitude, longitude,timeStamp, type, speed, heading ,eventId ,"ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id),"is in $stationeryName area!!!") as information insert into dataOut; from dataOutStream[isStationary == 'false'] diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql index 78db10a679..38240e4937 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql @@ -13,7 +13,7 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string, state string, information string); from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==true and id == "$deviceId"]#geodashboard:subscribe() -select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, "This device is in $areaName restricted area!!!" as information +select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, str:concat(str:concat(str:concat(type," device "), id), " is in $areaName restricted area!!!") as information insert into dataOut; from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=true and id == "$deviceId"] select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert_for_GeoClusters.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert_for_GeoClusters.siddhiql index 30aea4d7fa..67fa2df594 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert_for_GeoClusters.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert_for_GeoClusters.siddhiql @@ -13,7 +13,7 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string, state string, information string); from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==true]#geodashboard:subscribe() -select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, "This device is in $areaName restricted area!!!" as information +select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, str:concat(str:concat(str:concat(type," device "), id), " is in $areaName restricted area!!!") as information insert into dataOut; from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=true] select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information