diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml index 15bc6c150..f6ac6d261 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml index 4e7eb262e..9db038c0b 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-DeviceOperation-Publisher_1.0.0/WSO2IoT-DeviceOperation-Publisher_1.0.0.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-DeviceOperation-Publisher_1.0.0/WSO2IoT-DeviceOperation-Publisher_1.0.0.xml deleted file mode 100644 index 7d52806b5..000000000 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-DeviceOperation-Publisher_1.0.0/WSO2IoT-DeviceOperation-Publisher_1.0.0.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - { - "deviceIdentifiers": {{meta_deviceIdentifiers}}, - "deviceType": "{{meta_deviceType}}", - "operation": { - "code": "{{code}}", - "type": "{{type}}", - "status": "PENDING", - "isEnabled": "{{isEnabled}}", - "payLoad": "{{payLoad}}" - } - } - - - - HttpPost - https://localhost:9443/api/device-mgt/v1.0/devices/{deviceType}/operations - true - - diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-Operation-ExecutionPlan_1.0.0/WSO2IoT-Operation-ExecutionPlan.siddhiql b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-Operation-ExecutionPlan_1.0.0/WSO2IoT-Operation-ExecutionPlan.siddhiql new file mode 100644 index 000000000..a6030d9b9 --- /dev/null +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-Operation-ExecutionPlan_1.0.0/WSO2IoT-Operation-ExecutionPlan.siddhiql @@ -0,0 +1,16 @@ +/* Enter a unique ExecutionPlan */ +@Plan:name('WSO2IoT-Operation-ExecutionPlan') + +/* Enter a unique description for ExecutionPlan */ +@Plan:description('Publish operations to devices coming from org.wso2.iot.operation stream') + +/* define streams/tables and write queries here ... */ + +@Plan:trace('false') + +@Import('org.wso2.iot.operation:1.0.0') +define stream dataIn (meta_deviceIdentifiers string, meta_deviceType string, code string, type string, isEnabled bool, payLoad string); + +from dataIn#device:addOperation(meta_deviceIdentifiers, meta_deviceType, code, type, isEnabled, payLoad) +select * +insert into drop; \ No newline at end of file diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-DeviceOperation-Publisher_1.0.0/artifact.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-Operation-ExecutionPlan_1.0.0/artifact.xml similarity index 55% rename from components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-DeviceOperation-Publisher_1.0.0/artifact.xml rename to components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-Operation-ExecutionPlan_1.0.0/artifact.xml index 674c730be..ae461dddf 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-DeviceOperation-Publisher_1.0.0/artifact.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/WSO2IoT-Operation-ExecutionPlan_1.0.0/artifact.xml @@ -1,22 +1,23 @@ - - - WSO2IoT-DeviceOperation-Publisher_1.0.0.xml + + WSO2IoT-Operation-ExecutionPlan.siddhiql + diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/artifacts.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/artifacts.xml index 0fcdbe5b1..baddee4b4 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/artifacts.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/src/main/resources/carbonapps/device_analytics/artifacts.xml @@ -30,7 +30,7 @@ serverRole="DataAnalyticsServer"/> - diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml index fdbb2954e..69aef8378 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml index e2cc6fd86..1c28d05b8 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/Geo-ExecutionPlan-EventsFusionGenerateNotifications-1.0.0.siddhiql b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/Geo-ExecutionPlan-EventsFusionGenerateNotifications-1.0.0.siddhiql deleted file mode 100644 index ec8ffd087..000000000 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/Geo-ExecutionPlan-EventsFusionGenerateNotifications-1.0.0.siddhiql +++ /dev/null @@ -1,29 +0,0 @@ -/* Enter a unique ExecutionPlan */ -@Plan:name('Geo-ExecutionPlan-EventsFusionGenerateNotifications') - -/* Enter a unique description for ExecutionPlan */ --- @Plan:description('ExecutionPlan') - -/* define streams/tables and write queries here ... */ - -@Plan:trace('false') - -@Import('org.wso2.geo.ProcessedSpatialEvents:1.0.0') -define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string, state string, information string ); - -@Export('iot.per.device.stream.geo.AlertNotifications:1.0.0') -define stream alertsOut ( id string, state string, information string, timeStamp long, latitude double, longitude double, type string); - -@Export('iot.per.device.stream.geo.FusedSpatialEvent:1.0.0') -define stream dataOut ( id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, state string, information string, notify bool ); - -from dataIn#window.geodashboard:eventsFusion(eventId, state, information) -insert into innerStream; - -from innerStream -select id, latitude, longitude, timeStamp, type, speed, heading, state , information, geodashboard:needToNotify(id,information) as notify -insert into dataOut; - -from dataOut[notify == true] -select id, state, information,timeStamp, latitude, longitude, type -insert into alertsOut; \ No newline at end of file diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/artifact.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/artifact.xml deleted file mode 100755 index e7cb8f858..000000000 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/artifact.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Geo-ExecutionPlan-EventsFusionGenerateNotifications-1.0.0.siddhiql - diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-Pass_through_1.0.0/Geo-ExecutionPlan-Pass_through-1.0.0.siddhiql b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-Pass_through_1.0.0/Geo-ExecutionPlan-Pass_through-1.0.0.siddhiql index 9a2d344b9..11e3894bc 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-Pass_through_1.0.0/Geo-ExecutionPlan-Pass_through-1.0.0.siddhiql +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-Pass_through_1.0.0/Geo-ExecutionPlan-Pass_through-1.0.0.siddhiql @@ -7,11 +7,11 @@ /* define streams/tables and write queries here ... */ @Import('org.wso2.geo.StandardSpatialEvents:1.0.0') -define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string); +define stream dataIn (id string, owner string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string); -@Export('org.wso2.geo.ProcessedSpatialEvents:1.0.0') -define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string, state string, information string); +@Export('iot.per.device.stream.geo.FusedSpatialEvent:1.0.0') +define stream dataOut (id string, owner string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, state string, information string, notify bool); -from dataIn#geodashboard:subscribe() -select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "NORMAL" as state, "Normal driving pattern" as information +from dataIn +select id, owner, latitude, longitude,timeStamp, type ,speed, heading, "NORMAL" as state, "Normal driving pattern" as information, false as notify insert into dataOut; \ No newline at end of file diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-EventSink-FusedStream_1.0.0/iot_per_device_stream_geo_FusedSpatialEvent.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-EventSink-FusedStream_1.0.0/iot_per_device_stream_geo_FusedSpatialEvent.xml index 23c3589b8..f14873f99 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-EventSink-FusedStream_1.0.0/iot_per_device_stream_geo_FusedSpatialEvent.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-EventSink-FusedStream_1.0.0/iot_per_device_stream_geo_FusedSpatialEvent.xml @@ -9,6 +9,14 @@ false STRING + + owner + false + true + false + false + STRING + latitude false diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-Geo-AlertNotifications_1.0.0/iot_per_device_stream_geo_AlertNotifications.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-Geo-AlertNotifications_1.0.0/iot_per_device_stream_geo_AlertNotifications.xml index ca3f795e1..04b2703a3 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-Geo-AlertNotifications_1.0.0/iot_per_device_stream_geo_AlertNotifications.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-Geo-AlertNotifications_1.0.0/iot_per_device_stream_geo_AlertNotifications.xml @@ -9,6 +9,14 @@ false STRING + + owner + false + true + false + false + STRING + state false diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-Geo-ExecutionPlan_1.0.0/WSO2IoT-Geo-ExecutionPlan.siddhiql b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-Geo-ExecutionPlan_1.0.0/WSO2IoT-Geo-ExecutionPlan.siddhiql index 50718fc82..e8418fe49 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-Geo-ExecutionPlan_1.0.0/WSO2IoT-Geo-ExecutionPlan.siddhiql +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-Geo-ExecutionPlan_1.0.0/WSO2IoT-Geo-ExecutionPlan.siddhiql @@ -9,11 +9,14 @@ @Plan:trace('false') @Import('org.wso2.iot.LocationStream:1.0.0') -define stream dataIn (meta_deviceId string, meta_deviceType string, timeStamp long, latitude double, longitude double); +define stream dataIn (meta_deviceId string, meta_owner string, meta_deviceType string, timeStamp long, latitude double, longitude double); @Export('org.wso2.geo.StandardSpatialEvents:1.0.0') -define stream dataOut ( id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string ); +define stream dataOut (id string, owner string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string); -from dataIn -select meta_deviceId as id, latitude, longitude, timeStamp, -meta_deviceType as type, 0.0f as speed, 0.0f as heading, UUID() as eventId insert into dataOut \ No newline at end of file +from every fs1=dataIn -> fs2=dataIn[fs2.timeStamp > fs1.timeStamp and fs1.meta_deviceId == fs2.meta_deviceId] +select fs1.meta_deviceId as id, fs1.meta_owner as owner, fs2.latitude, fs2.longitude, fs2.timeStamp, fs1.meta_deviceType as type, +convert(geo:distance(fs2.latitude, fs2.longitude, fs1.latitude, fs1.longitude) * 3600/(fs2.timeStamp - fs1.timeStamp), 'float') as speed, +0.0f as heading, UUID() as eventId +group by fs1.meta_deviceId +insert into dataOut \ No newline at end of file diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-GeoAlerts-ExecutionPlan_1.0.0/WSO2IoT-GeoAlerts-ExecutionPlan.siddhiql b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-GeoAlerts-ExecutionPlan_1.0.0/WSO2IoT-GeoAlerts-ExecutionPlan.siddhiql new file mode 100644 index 000000000..7274dc4c5 --- /dev/null +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-GeoAlerts-ExecutionPlan_1.0.0/WSO2IoT-GeoAlerts-ExecutionPlan.siddhiql @@ -0,0 +1,16 @@ +/* Enter a unique ExecutionPlan */ +@Plan:name('WSO2IoT-GeoAlerts-ExecutionPlan') + +/* Enter a unique description for ExecutionPlan */ +@Plan:description('To convert the WSO2 IoT event incoming stream to relavant streams') + +/* define streams/tables and write queries here ... */ + +@Plan:trace('false') + +@Import('iot.per.device.stream.geo.AlertNotifications:1.0.0') +define stream dataIn (id string, owner string, state string, information string, timeStamp long, latitude double, longitude double, type string); + +from dataIn#device:addNotification(id, type, information) +select * +insert into ignore; \ No newline at end of file diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.ProcessedSpatialEvents_1.0.0/artifact.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-GeoAlerts-ExecutionPlan_1.0.0/artifact.xml old mode 100755 new mode 100644 similarity index 63% rename from components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.ProcessedSpatialEvents_1.0.0/artifact.xml rename to components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-GeoAlerts-ExecutionPlan_1.0.0/artifact.xml index a87870c31..e725857dc --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.ProcessedSpatialEvents_1.0.0/artifact.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/WSO2IoT-GeoAlerts-ExecutionPlan_1.0.0/artifact.xml @@ -1,4 +1,5 @@ - - - org.wso2.geo.ProcessedSpatialEvents-1.0.0.json + + WSO2IoT-GeoAlerts-ExecutionPlan.siddhiql + diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/artifacts.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/artifacts.xml index f0fdfa066..1e0e888f8 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/artifacts.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/artifacts.xml @@ -22,16 +22,15 @@ - + - diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/iot.per.device.stream.geo.AlertNotifications_1.0.0/iot.per.device.stream.geo.AlertNotifications-1.0.0.json b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/iot.per.device.stream.geo.AlertNotifications_1.0.0/iot.per.device.stream.geo.AlertNotifications-1.0.0.json index b19d158ab..a10ec10ef 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/iot.per.device.stream.geo.AlertNotifications_1.0.0/iot.per.device.stream.geo.AlertNotifications-1.0.0.json +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/iot.per.device.stream.geo.AlertNotifications_1.0.0/iot.per.device.stream.geo.AlertNotifications-1.0.0.json @@ -8,6 +8,10 @@ "name": "id", "type": "STRING" }, + { + "name": "owner", + "type": "STRING" + }, { "name": "state", "type": "STRING" diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/iot.per.device.stream.geo.FusedSpatialEvent_1.0.0/iot.per.device.stream.geo.FusedSpatialEvent-1.0.0.json b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/iot.per.device.stream.geo.FusedSpatialEvent_1.0.0/iot.per.device.stream.geo.FusedSpatialEvent-1.0.0.json index e8b866a34..e9f4601d6 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/iot.per.device.stream.geo.FusedSpatialEvent_1.0.0/iot.per.device.stream.geo.FusedSpatialEvent-1.0.0.json +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/iot.per.device.stream.geo.FusedSpatialEvent_1.0.0/iot.per.device.stream.geo.FusedSpatialEvent-1.0.0.json @@ -8,6 +8,10 @@ "name": "id", "type": "STRING" }, + { + "name": "owner", + "type": "STRING" + }, { "name": "latitude", "type": "DOUBLE" diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.ProcessedSpatialEvents_1.0.0/org.wso2.geo.ProcessedSpatialEvents-1.0.0.json b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.ProcessedSpatialEvents_1.0.0/org.wso2.geo.ProcessedSpatialEvents-1.0.0.json deleted file mode 100644 index 08adb6858..000000000 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.ProcessedSpatialEvents_1.0.0/org.wso2.geo.ProcessedSpatialEvents-1.0.0.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "org.wso2.geo.ProcessedSpatialEvents", - "version": "1.0.0", - "nickName": "", - "description": "", - "payloadData": [ - { - "name": "id", - "type": "STRING" - }, - { - "name": "latitude", - "type": "DOUBLE" - }, - { - "name": "longitude", - "type": "DOUBLE" - }, - { - "name": "timeStamp", - "type": "LONG" - }, - { - "name": "type", - "type": "STRING" - }, - { - "name": "speed", - "type": "FLOAT" - }, - { - "name": "heading", - "type": "FLOAT" - }, - { - "name": "eventId", - "type": "STRING" - }, - { - "name": "state", - "type": "STRING" - }, - { - "name": "information", - "type": "STRING" - } - ] -} \ No newline at end of file diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.StandardSpatialEvents_1.0.0/org.wso2.geo.StandardSpatialEvents-1.0.0.json b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.StandardSpatialEvents_1.0.0/org.wso2.geo.StandardSpatialEvents-1.0.0.json index 74a5670b9..3ffbef8e7 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.StandardSpatialEvents_1.0.0/org.wso2.geo.StandardSpatialEvents-1.0.0.json +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.StandardSpatialEvents_1.0.0/org.wso2.geo.StandardSpatialEvents-1.0.0.json @@ -8,6 +8,10 @@ "name": "id", "type": "STRING" }, + { + "name": "owner", + "type": "STRING" + }, { "name": "latitude", "type": "DOUBLE" diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.iot.LocationStream_1.0.0/org.wso2.iot.LocationStream-1.0.0.json b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.iot.LocationStream_1.0.0/org.wso2.iot.LocationStream-1.0.0.json index d27509990..4211e7902 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.iot.LocationStream_1.0.0/org.wso2.iot.LocationStream-1.0.0.json +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.iot.LocationStream_1.0.0/org.wso2.iot.LocationStream-1.0.0.json @@ -8,6 +8,10 @@ "name": "deviceId", "type": "STRING" }, + { + "name": "owner", + "type": "STRING" + }, { "name": "deviceType", "type": "STRING" diff --git a/components/analytics/iot-analytics/pom.xml b/components/analytics/iot-analytics/pom.xml index 0dfafd44b..33a0bfa94 100644 --- a/components/analytics/iot-analytics/pom.xml +++ b/components/analytics/iot-analytics/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins analytics - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/analytics/pom.xml b/components/analytics/pom.xml index 4c0ed28d8..6f158129a 100644 --- a/components/analytics/pom.xml +++ b/components/analytics/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml index 14db3baf9..6da9f91c0 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml @@ -21,7 +21,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml index 869a0f85d..475daad27 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml @@ -3,7 +3,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml index 54cf93a89..50a644f00 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml @@ -22,7 +22,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/androidsense-plugin/pom.xml b/components/device-types/androidsense-plugin/pom.xml index 091ac199f..1d151f681 100644 --- a/components/device-types/androidsense-plugin/pom.xml +++ b/components/device-types/androidsense-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml index 95c9e4371..bb7a5f7ef 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml @@ -21,7 +21,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml index 8b3d43b1b..323391e89 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml @@ -21,7 +21,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml index 739d2b38b..deba3393d 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml @@ -23,7 +23,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/pom.xml b/components/device-types/arduino-plugin/pom.xml index bfac52cd5..2d7dd4f88 100644 --- a/components/device-types/arduino-plugin/pom.xml +++ b/components/device-types/arduino-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/pom.xml b/components/device-types/pom.xml index 95d7a94ba..8fbb63cba 100644 --- a/components/device-types/pom.xml +++ b/components/device-types/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml index 0914fd22f..c189870f0 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml @@ -21,7 +21,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml index 6bfb72036..a7eaf8044 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml @@ -21,7 +21,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml index cbb7c4f94..0be31bcb6 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml @@ -23,7 +23,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/pom.xml b/components/device-types/raspberrypi-plugin/pom.xml index 9ffff665e..16fe2e76e 100644 --- a/components/device-types/raspberrypi-plugin/pom.xml +++ b/components/device-types/raspberrypi-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml index bc7cf900e..8cab5fab8 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml @@ -23,7 +23,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml index f3864611b..ff22e6d64 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml @@ -21,7 +21,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml index 0dbb747ee..bb003f222 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml @@ -21,7 +21,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml index c502e2efe..abcc8783f 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml @@ -23,7 +23,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/pom.xml b/components/device-types/virtual-fire-alarm-plugin/pom.xml index 18c248f14..20b5ee5f3 100644 --- a/components/device-types/virtual-fire-alarm-plugin/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml index 249a66f2a..81367c1b0 100644 --- a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml +++ b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.devicemgt-plugins appm-connector - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml index d1cb12b1e..0f429f7b8 100644 --- a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml +++ b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.devicemgt-plugins appm-connector - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/appm-connector/pom.xml b/components/extensions/appm-connector/pom.xml index d357aaeb0..16dca425c 100644 --- a/components/extensions/appm-connector/pom.xml +++ b/components/extensions/appm-connector/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml index d07286510..56abb9fe5 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml index 1ef8e179f..3558102da 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml index f07ebd75f..223e8856e 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.thrift/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.thrift/pom.xml index b4484c91e..8af5f61ab 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.thrift/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.thrift/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml index ba650a47d..01f6ab0fd 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/pom.xml index 3f263b035..502d762b9 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml index 332fbec3f..670c93c70 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml index c3e43456a..dad76cfe0 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml index 161f7a815..868590bbb 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml index df465a2b5..df7f9f3b8 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/pom.xml b/components/extensions/cdmf-transport-adapters/pom.xml index 39afdee2e..e6c952021 100644 --- a/components/extensions/cdmf-transport-adapters/pom.xml +++ b/components/extensions/cdmf-transport-adapters/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.api/pom.xml b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.api/pom.xml index 2a496c02c..d557e2e47 100644 --- a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.api/pom.xml +++ b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mb-extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml index 1d0f332c6..a0572bf91 100644 --- a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml +++ b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mb-extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/mb-extensions/pom.xml b/components/extensions/mb-extensions/pom.xml index a6c8b48de..f2693732b 100644 --- a/components/extensions/mb-extensions/pom.xml +++ b/components/extensions/mb-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/pom.xml b/components/extensions/pom.xml index df5fb6c17..b216f777e 100644 --- a/components/extensions/pom.xml +++ b/components/extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/extensions/pull-notification-listeners/org.wso2.carbon.device.mgt.mqtt.notification.listener/pom.xml b/components/extensions/pull-notification-listeners/org.wso2.carbon.device.mgt.mqtt.notification.listener/pom.xml index f14001099..13487de01 100644 --- a/components/extensions/pull-notification-listeners/org.wso2.carbon.device.mgt.mqtt.notification.listener/pom.xml +++ b/components/extensions/pull-notification-listeners/org.wso2.carbon.device.mgt.mqtt.notification.listener/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins pull-notification-listeners - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/pull-notification-listeners/pom.xml b/components/extensions/pull-notification-listeners/pom.xml index 952b37068..17098de6f 100644 --- a/components/extensions/pull-notification-listeners/pom.xml +++ b/components/extensions/pull-notification-listeners/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/pom.xml b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/pom.xml index 09806d301..c297722ac 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/pom.xml +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins remote-session-extension - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/pom.xml b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/pom.xml index a4c8114f8..78a2a3a86 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/pom.xml +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins remote-session-extension - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/RemoteSessionManagementServiceImpl.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/RemoteSessionManagementServiceImpl.java index 1274d7921..23320c483 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/RemoteSessionManagementServiceImpl.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/RemoteSessionManagementServiceImpl.java @@ -45,6 +45,7 @@ import java.util.Date; import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.UUID; import java.util.Map; /** @@ -72,66 +73,82 @@ public class RemoteSessionManagementServiceImpl implements RemoteSessionManageme sessionQueryParamList.add(session.getQueryString()); sessionQueryParam.put(RemoteSessionConstants.QUERY_STRING, sessionQueryParamList); - // Validate the token - OAuthAuthenticator oAuthAuthenticator = RemoteSessionManagementDataHolder.getInstance().getOauthAuthenticator(); - AuthenticationInfo authenticationInfo = oAuthAuthenticator.isAuthenticated(sessionQueryParam); + // if session initiated using operation id means request came from device. + if (operationId == null) { + // Validate the token + OAuthAuthenticator oAuthAuthenticator = RemoteSessionManagementDataHolder.getInstance().getOauthAuthenticator(); + AuthenticationInfo authenticationInfo = oAuthAuthenticator.isAuthenticated(sessionQueryParam); - if (authenticationInfo != null && authenticationInfo.isAuthenticated()) { - try { - PrivilegedCarbonContext.startTenantFlow(); - PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(authenticationInfo - .getTenantDomain() - , true); - PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(authenticationInfo.getUsername()); - if (deviceId != null && !deviceId.isEmpty() && deviceType != null && !deviceType.isEmpty()) { - DeviceIdentifier deviceIdentifier = new DeviceIdentifier(); - deviceIdentifier.setId(deviceId); - deviceIdentifier.setType(deviceType); + if (authenticationInfo != null && authenticationInfo.isAuthenticated()) { + try { + PrivilegedCarbonContext.startTenantFlow(); + PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(authenticationInfo + .getTenantDomain() + , true); + PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(authenticationInfo.getUsername()); + if (deviceId != null && !deviceId.isEmpty() && deviceType != null && !deviceType.isEmpty()) { + DeviceIdentifier deviceIdentifier = new DeviceIdentifier(); + deviceIdentifier.setId(deviceId); + deviceIdentifier.setType(deviceType); + + // Check authorization of user for given device + boolean userAuthorized = RemoteSessionManagementDataHolder.getInstance() + .getDeviceAccessAuthorizationService() + .isUserAuthorized(deviceIdentifier, authenticationInfo.getUsername()); + if (userAuthorized) { + // set common settings for session + session.setMaxBinaryMessageBufferSize(RemoteSessionManagementDataHolder.getInstance() + .getMaxMessageBufferSize()); + session.setMaxTextMessageBufferSize(RemoteSessionManagementDataHolder.getInstance() + .getMaxMessageBufferSize()); + session.setMaxIdleTimeout(RemoteSessionManagementDataHolder.getInstance().getMaxIdleTimeout()); - // Check authorization of user for given device - boolean userAuthorized = RemoteSessionManagementDataHolder.getInstance() - .getDeviceAccessAuthorizationService() - .isUserAuthorized(deviceIdentifier, authenticationInfo.getUsername()); - if (userAuthorized) { - // set common settings for session - session.setMaxBinaryMessageBufferSize(RemoteSessionManagementDataHolder.getInstance() - .getMaxMessageBufferSize()); - session.setMaxTextMessageBufferSize(RemoteSessionManagementDataHolder.getInstance() - .getMaxMessageBufferSize()); - session.setMaxIdleTimeout(RemoteSessionManagementDataHolder.getInstance().getMaxIdleTimeout()); + initializeClientSession(session, authenticationInfo.getTenantDomain(), deviceType, deviceId); + + log.info("Current remote sessions count: " + RemoteSessionManagementDataHolder.getInstance() + .getSessionMap().size()); - // if session initiated using operation id means request came from device - if (operationId != null) { - // create new device session - initializeDeviceSession(session, authenticationInfo.getTenantDomain(), deviceType, deviceId, - operationId); } else { - // create new client session - initializeClientSession(session, authenticationInfo.getTenantDomain(), deviceType, - deviceId); + throw new RemoteSessionManagementException("Missing device Id or type "); } - log.info("Current remote sessions count: " + RemoteSessionManagementDataHolder.getInstance() - .getSessionMap().size()); - } else { - throw new RemoteSessionManagementException("Missing device Id or type "); + throw new RemoteSessionManagementException("Unauthorized Access for the device Type : " + deviceType + + " , deviceId : " + deviceId); } - } else { - throw new RemoteSessionManagementException("Unauthorized Access for the device Type : " + deviceType - + " , deviceId : " + deviceId); + } catch (OperationManagementException | InvalidDeviceException e) { + throw new RemoteSessionManagementException("Error occurred while adding initial operation for the " + + "device Type : " + deviceType + " , deviceId : " + deviceId); + } catch (DeviceAccessAuthorizationException e) { + throw new RemoteSessionManagementException("Error occurred while device access authorization for the " + + "device Type : " + deviceType + " , " + "deviceId : " + deviceId); + } finally { + PrivilegedCarbonContext.endTenantFlow(); } - } catch (OperationManagementException | InvalidDeviceException e) { - throw new RemoteSessionManagementException("Error occurred while adding initial operation for the " + - "device Type : " + deviceType + " , deviceId : " + deviceId); - } catch (DeviceAccessAuthorizationException e) { - throw new RemoteSessionManagementException("Error occurred while device access authorization for the " + - "device Type : " + deviceType + " , " + "deviceId : " + deviceId); - } finally { - PrivilegedCarbonContext.endTenantFlow(); + + } else { + throw new RemoteSessionManagementException("Invalid token"); } } else { - throw new RemoteSessionManagementException("Invalid token"); + // set common settings for session + session.setMaxBinaryMessageBufferSize(RemoteSessionManagementDataHolder.getInstance() + .getMaxMessageBufferSize()); + session.setMaxTextMessageBufferSize(RemoteSessionManagementDataHolder.getInstance() + .getMaxMessageBufferSize()); + session.setMaxIdleTimeout(RemoteSessionManagementDataHolder.getInstance().getMaxIdleTimeout()); + String uuid = session.getQueryString(); + + if (uuid != null && uuid.isEmpty()) { + log.error("Could not find a UUID related to the remote session"); + } else { + String tenantDomain = RemoteSessionManagementDataHolder.getInstance().getUuidToTenantMap().remove(uuid); + if (tenantDomain == null || tenantDomain.isEmpty()) { + log.error("Invalid UUID, could not create the remote session"); + } else { + // create new device session + initializeDeviceSession(session, tenantDomain, deviceType, deviceId, operationId, uuid); + } + } } } @@ -194,6 +211,7 @@ public class RemoteSessionManagementServiceImpl implements RemoteSessionManageme .getId()); if (remoteSession != null) { //String operationId = remoteSession.getOperationId(); + RemoteSessionManagementDataHolder.getInstance().getUuidToTenantMap().remove(remoteSession.getUuidToValidateDevice()); String deviceKey = remoteSession.getTenantDomain() + "/" + remoteSession.getDeviceType() + "/" + remoteSession.getDeviceId(); RemoteSession lastSession = RemoteSessionManagementDataHolder.getInstance() @@ -239,8 +257,9 @@ public class RemoteSessionManagementServiceImpl implements RemoteSessionManageme private void initializeClientSession(Session session, String tenantDomain, String deviceType, String deviceId) throws RemoteSessionManagementException, OperationManagementException, InvalidDeviceException { + String uuidToValidateDevice = UUID.randomUUID().toString(); RemoteSession clientRemote = new RemoteSession(session, tenantDomain, deviceType, deviceId, RemoteSessionConstants - .CONNECTION_TYPE.CLIENT); + .CONNECTION_TYPE.CLIENT, uuidToValidateDevice); String deviceKey = tenantDomain + "/" + deviceType + "/" + deviceId; // Create new remote control operation to start the session RemoteSession activeSession = RemoteSessionManagementDataHolder.getInstance().getActiveDeviceClientSessionMap @@ -277,6 +296,13 @@ public class RemoteSessionManagementServiceImpl implements RemoteSessionManageme operation.setControl(Operation.Control.NO_REPEAT); JSONObject payload = new JSONObject(); payload.put("serverUrl", RemoteSessionManagementDataHolder.getInstance().getServerUrl()); + payload.put("uuidToValidateDevice", uuidToValidateDevice); + RemoteSessionManagementDataHolder.getInstance().getUuidToTenantMap + ().put(uuidToValidateDevice, tenantDomain); + if (log.isDebugEnabled()) { + log.debug("UUID " + uuidToValidateDevice + " is generated against the tenant : " + + RemoteSessionManagementDataHolder.getInstance().getUuidToTenantMap().get(uuidToValidateDevice)); + } operation.setPayLoad(payload.toString()); String date = new SimpleDateFormat(RemoteSessionConstants.DATE_FORMAT_NOW).format(new Date()); operation.setCreatedTimeStamp(date); @@ -287,6 +313,7 @@ public class RemoteSessionManagementServiceImpl implements RemoteSessionManageme clientRemote.setOperationId(activity.getActivityId().replace(DeviceManagementConstants .OperationAttributes.ACTIVITY, "")); RemoteSessionManagementDataHolder.getInstance().getSessionMap().put(session.getId(), clientRemote); + log.info("Client remote session opened for session id: " + session.getId() + " device Type : " + deviceType + " , " + "deviceId : " + deviceId); } else { @@ -307,7 +334,7 @@ public class RemoteSessionManagementServiceImpl implements RemoteSessionManageme * @throws RemoteSessionManagementException throws when session has errors with accessing device resources */ private void initializeDeviceSession(Session session, String tenantDomain, String deviceType, String deviceId, - String operationId) throws RemoteSessionManagementException { + String operationId, String uuidToValidateDevice) throws RemoteSessionManagementException { String deviceKey = tenantDomain + "/" + deviceType + "/" + deviceId; RemoteSession activeSession = RemoteSessionManagementDataHolder.getInstance() .getActiveDeviceClientSessionMap().get(deviceKey); @@ -317,7 +344,7 @@ public class RemoteSessionManagementServiceImpl implements RemoteSessionManageme if (clientRemote != null) { if (clientRemote.getOperationId().equals(operationId)) { RemoteSession deviceRemote = new RemoteSession(session, tenantDomain, deviceType, deviceId, - RemoteSessionConstants.CONNECTION_TYPE.DEVICE); + RemoteSessionConstants.CONNECTION_TYPE.DEVICE, uuidToValidateDevice); deviceRemote.setOperationId(operationId); deviceRemote.setPeerSession(clientRemote); clientRemote.setPeerSession(deviceRemote); diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/dto/RemoteSession.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/dto/RemoteSession.java index 5b2337c33..79bb31b2f 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/dto/RemoteSession.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/dto/RemoteSession.java @@ -34,7 +34,11 @@ import java.nio.ByteBuffer; public class RemoteSession { private static final Log log = LogFactory.getLog(RemoteSession.class); - private String tenantDomain, operationId, deviceType, deviceId; + private String tenantDomain; + private String operationId; + private String deviceType; + private String deviceId; + private String uuidToValidateDevice; private long lastMessageTimeStamp = System.currentTimeMillis(); private RemoteSession peerSession; private Session mySession; @@ -45,12 +49,13 @@ public class RemoteSession { private RemoteSessionConstants.CONNECTION_TYPE connectionType; public RemoteSession(Session session, String tenantDomain, String deviceType, String deviceId, - RemoteSessionConstants.CONNECTION_TYPE connectionType) { + RemoteSessionConstants.CONNECTION_TYPE connectionType, String uuidToValidateDevice) { this.mySession = session; this.deviceType = deviceType; this.deviceId = deviceId; this.tenantDomain = tenantDomain; this.connectionType = connectionType; + this.uuidToValidateDevice = uuidToValidateDevice; maxMessagesPerSecond = RemoteSessionManagementDataHolder.getInstance().getMaxMessagesPerSecond(); messageAllowance = maxMessagesPerSecond; messageRatePerSecond = (double) maxMessagesPerSecond / 1000; @@ -109,6 +114,10 @@ public class RemoteSession { } } + public String getUuidToValidateDevice() { + return uuidToValidateDevice; + } + public Session getMySession() { return mySession; } diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/internal/RemoteSessionManagementDataHolder.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/internal/RemoteSessionManagementDataHolder.java index ef92860f6..d1c2f058c 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/internal/RemoteSessionManagementDataHolder.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/internal/RemoteSessionManagementDataHolder.java @@ -43,6 +43,11 @@ public class RemoteSessionManagementDataHolder { private OAuthAuthenticator oAuthAuthenticator; private Map activeDeviceClientSessionMap = new ConcurrentHashMap(); private Map sessionMap = new ConcurrentHashMap(); + private Map uuidToTenantMap = new ConcurrentHashMap<>(); + + public Map getUuidToTenantMap() { + return uuidToTenantMap; + } public static RemoteSessionManagementDataHolder getInstance() { return thisInstance; diff --git a/components/extensions/remote-session-extension/pom.xml b/components/extensions/remote-session-extension/pom.xml index ae6c96235..6dbe1d893 100644 --- a/components/extensions/remote-session-extension/pom.xml +++ b/components/extensions/remote-session-extension/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/pom.xml b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/pom.xml index 2246024c9..8049d02d9 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins siddhi-extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml @@ -55,6 +55,42 @@ org.json.wso2 json + + org.wso2.carbon.devicemgt + org.wso2.carbon.identity.jwt.client.extension + + + io.github.openfeign + feign-core + + + io.github.openfeign + feign-jaxrs + + + io.github.openfeign + feign-gson + + + io.github.openfeign + feign-slf4j + + + com.squareup.okhttp3 + okhttp + + + com.squareup.okio + okio + + + io.github.openfeign + feign-okhttp + + + javax.ws.rs + jsr311-api + com.h2database.wso2 h2-database-engine @@ -125,14 +161,43 @@ org.wso2.extension.siddhi.device.* + feign, + feign.codec, + feign.auth, + feign.gson, + feign.slf4j, + javax.net.ssl, + javax.xml, + javax.xml.bind, + javax.xml.bind.annotation, + javax.xml.parsers;resolution:=optional, + org.apache.commons.lang, + org.w3c.dom, + org.wso2.carbon.base, + org.wso2.carbon.utils, + org.wso2.carbon.user.api, org.json;version="${orbit.version.json.range}", org.wso2.siddhi.core.*, org.wso2.siddhi.query.api.*, org.wso2.carbon.device.mgt.core.*, org.wso2.carbon.device.mgt.common.*, + org.wso2.carbon.identity.jwt.client.*, org.apache.commons.logging, - org.wso2.carbon.context + org.wso2.carbon.context, + android.util;resolution:=optional, + javax.annotation;resolution:=optional, + javax.net;resolution:=optional, + javax.security.auth.x500;resolution:=optional, + javax.crypto;resolution:=optional, + javax.crypto.spec;resolution:=optional + + jsr311-api, + feign-jaxrs, + feign-okhttp, + okhttp, + okio + diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/AddNotificationFunctionProcessor.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/AddNotificationFunctionProcessor.java new file mode 100644 index 000000000..ec9cfd347 --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/AddNotificationFunctionProcessor.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.notification.mgt.Notification; +import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException; +import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService; +import org.wso2.extension.siddhi.device.utils.DeviceUtils; +import org.wso2.siddhi.core.config.ExecutionPlanContext; +import org.wso2.siddhi.core.exception.ExecutionPlanRuntimeException; +import org.wso2.siddhi.core.executor.ExpressionExecutor; +import org.wso2.siddhi.core.query.processor.stream.function.StreamFunctionProcessor; +import org.wso2.siddhi.query.api.definition.AbstractDefinition; +import org.wso2.siddhi.query.api.definition.Attribute; +import org.wso2.siddhi.query.api.exception.ExecutionPlanValidationException; + +import java.util.ArrayList; +import java.util.List; + +public class AddNotificationFunctionProcessor extends StreamFunctionProcessor { + + private static final Log log = LogFactory.getLog(AddNotificationFunctionProcessor.class); + + /** + * The init method of the StreamProcessor, this method will be called before other methods + * + * @param abstractDefinition the incoming stream definition + * @param attributeExpressionExecutors the executors of each function parameters + * @param executionPlanContext the context of the execution plan + * @return the additional output attributes introduced by the function + */ + @Override + protected List init(AbstractDefinition abstractDefinition, + ExpressionExecutor[] attributeExpressionExecutors, + ExecutionPlanContext executionPlanContext) { + if (attributeExpressionExecutors.length != 3) { + throw new ExecutionPlanValidationException( + "Invalid no of arguments passed to device:addNotification() function, required 3 but found " + + attributeExpressionExecutors.length); + } + if (attributeExpressionExecutors[0].getReturnType() != Attribute.Type.STRING) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the first argument (deviceIdentifier) of device:addNotification() " + + "function, required " + Attribute.Type.STRING + " as deviceIdentifier, but found " + + attributeExpressionExecutors[0].getReturnType().toString()); + } + if (attributeExpressionExecutors[1].getReturnType() != Attribute.Type.STRING) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the second argument (deviceType) of device:addNotification() " + + "function, required " + Attribute.Type.STRING + " as deviceType, but found " + + attributeExpressionExecutors[1].getReturnType().toString()); + } + if (attributeExpressionExecutors[2].getReturnType() != Attribute.Type.STRING) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the third argument (description) of device:addNotification() " + + "function, required " + Attribute.Type.STRING + " as description, but found " + + attributeExpressionExecutors[2].getReturnType().toString()); + } + ArrayList attributes = new ArrayList<>(); + attributes.add(new Attribute("notified", Attribute.Type.BOOL)); + return attributes; + } + + /** + * The process method of the StreamFunction, used when more than one function parameters are provided + * + * @param data the data values for the function parameters + * @return the data for additional output attributes introduced by the function + */ + @Override + protected Object[] process(Object[] data) { + if (data[0] == null || data[1] == null || data[2] == null) { + throw new ExecutionPlanRuntimeException("Invalid input given to device:addNotification() function. " + + "Neither of any three arguments cannot be null"); + } + boolean isNotified = false; + String deviceId = (String) data[0]; + String deviceType = (String) data[1]; + String description = (String) data[2]; + Notification notification = new Notification(); + notification.setStatus(Notification.Status.NEW.name()); + notification.setDeviceIdentifier(deviceId); + notification.setDeviceType(deviceType); + notification.setDescription(description); + + NotificationManagementService notificationManagementService = DeviceUtils.getNotificationManagementService(); + try { + isNotified = notificationManagementService.addNotification(new DeviceIdentifier(deviceId, deviceType), notification); + } catch (NotificationManagementException e) { + // We are not throwing this exception to siddhi runtime as it will break the complete siddhi execution + // flow for the event stream coming in. + log.error("Error occurred while adding notification '" + notification.toString() + "' for " + + deviceType + " device with id " + deviceId, e); + } + + return new Object[]{isNotified}; + } + + /** + * The process method of the StreamFunction, used when zero or one function parameter is provided + * + * @param data null if the function parameter count is zero or runtime data value of the function parameter + * @return the data for additional output attribute introduced by the function + */ + @Override + protected Object[] process(Object data) { + return new Object[0]; + } + + /** + * This will be called only once and this can be used to acquire + * required resources for the processing element. + * This will be called after initializing the system and before + * starting to process the events. + */ + @Override + public void start() { + + } + + /** + * This will be called only once and this can be used to release + * the acquired resources for processing. + * This will be called before shutting down the system. + */ + @Override + public void stop() { + + } + + /** + * Used to collect the serializable state of the processing element, that need to be + * persisted for the reconstructing the element to the same state on a different point of time + * + * @return stateful objects of the processing element as an array + */ + @Override + public Object[] currentState() { + return new Object[0]; + } + + /** + * Used to restore serialized state of the processing element, for reconstructing + * the element to the same state as if was on a previous point of time. + * + * @param objects the stateful objects of the element as an array on + * the same order provided by currentState(). + */ + @Override + public void restoreState(Object[] objects) { + //Since there's no need to maintain a state, nothing needs to be done here. + } +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/AddOperationFunctionProcessor.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/AddOperationFunctionProcessor.java new file mode 100644 index 000000000..f3abc1a99 --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/AddOperationFunctionProcessor.java @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device; + +import feign.Feign; +import feign.Logger; +import feign.gson.GsonDecoder; +import feign.gson.GsonEncoder; +import feign.jaxrs.JAXRSContract; +import feign.okhttp.OkHttpClient; +import feign.slf4j.Slf4jLogger; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.JSONArray; +import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; +import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; +import org.wso2.extension.siddhi.device.client.OAuthRequestInterceptor; +import org.wso2.extension.siddhi.device.client.configs.SiddhiExtensionConfigReader; +import org.wso2.extension.siddhi.device.client.dto.OperationRequest; +import org.wso2.extension.siddhi.device.client.services.OperationService; +import org.wso2.extension.siddhi.device.utils.ClientUtils; +import org.wso2.siddhi.core.config.ExecutionPlanContext; +import org.wso2.siddhi.core.exception.ExecutionPlanRuntimeException; +import org.wso2.siddhi.core.executor.ExpressionExecutor; +import org.wso2.siddhi.core.query.processor.stream.function.StreamFunctionProcessor; +import org.wso2.siddhi.query.api.definition.AbstractDefinition; +import org.wso2.siddhi.query.api.definition.Attribute; +import org.wso2.siddhi.query.api.exception.ExecutionPlanValidationException; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class AddOperationFunctionProcessor extends StreamFunctionProcessor { + + private static final Log log = LogFactory.getLog(AddOperationFunctionProcessor.class); + private static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; + private static final String DEVICE_MGT_BASE_CONTEXT = "/api/device-mgt/v1.0"; + private OperationService operationService; + + public AddOperationFunctionProcessor() { + operationService = Feign.builder().client(new OkHttpClient(ClientUtils.getSSLClient())) + .logger(new Slf4jLogger()) + .logLevel(Logger.Level.FULL).requestInterceptor(new OAuthRequestInterceptor()) + .contract(new JAXRSContract()).encoder(new GsonEncoder()).decoder(new GsonDecoder()) + .target(OperationService.class, ClientUtils.replaceProperties( + SiddhiExtensionConfigReader.getInstance().getConfig().getGatewayEndpoint() + + DEVICE_MGT_BASE_CONTEXT)); + } + + /** + * The init method of the StreamProcessor, this method will be called before other methods + * + * @param abstractDefinition the incoming stream definition + * @param attributeExpressionExecutors the executors of each function parameters + * @param executionPlanContext the context of the execution plan + * @return the additional output attributes introduced by the function + */ + @Override + protected List init(AbstractDefinition abstractDefinition, + ExpressionExecutor[] attributeExpressionExecutors, + ExecutionPlanContext executionPlanContext) { + if (attributeExpressionExecutors.length != 6) { + throw new ExecutionPlanValidationException( + "Invalid no of arguments passed to device:addOperation() function, required 3 but found " + + attributeExpressionExecutors.length); + } + if (attributeExpressionExecutors[0].getReturnType() != Attribute.Type.STRING) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the first argument (deviceIdentifiers) of device:addOperation() " + + "function, required " + Attribute.Type.STRING + " as deviceIdentifiers, but found " + + attributeExpressionExecutors[0].getReturnType().toString()); + } + if (attributeExpressionExecutors[1].getReturnType() != Attribute.Type.STRING) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the second argument (deviceType) of device:addOperation() " + + "function, required " + Attribute.Type.STRING + " as deviceType, but found " + + attributeExpressionExecutors[1].getReturnType().toString()); + } + if (attributeExpressionExecutors[2].getReturnType() != Attribute.Type.STRING) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the third argument (code) of device:addOperation() " + + "function, required " + Attribute.Type.STRING + " as code, but found " + + attributeExpressionExecutors[2].getReturnType().toString()); + } + if (attributeExpressionExecutors[3].getReturnType() != Attribute.Type.STRING) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the fourth argument (type) of device:addOperation() " + + "function, required " + Attribute.Type.STRING + " as type, but found " + + attributeExpressionExecutors[3].getReturnType().toString()); + } + if (attributeExpressionExecutors[4].getReturnType() != Attribute.Type.BOOL) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the fifth argument (isEnabled) of device:addOperation() " + + "function, required " + Attribute.Type.BOOL + " as isEnabled, but found " + + attributeExpressionExecutors[4].getReturnType().toString()); + } + if (attributeExpressionExecutors[5].getReturnType() != Attribute.Type.STRING) { + throw new ExecutionPlanValidationException( + "Invalid parameter type found for the fifth argument (payLoad) of device:addOperation() " + + "function, required " + Attribute.Type.STRING + " as payLoad, but found " + + attributeExpressionExecutors[5].getReturnType().toString()); + } + ArrayList attributes = new ArrayList<>(); + attributes.add(new Attribute("activity_id", Attribute.Type.STRING)); + return attributes; + } + + /** + * The process method of the StreamFunction, used when more than one function parameters are provided + * + * @param data the data values for the function parameters + * @return the data for additional output attributes introduced by the function + */ + @Override + protected Object[] process(Object[] data) { + if (data[0] == null || data[1] == null || data[2] == null || data[3] == null || data[4] == null || data[5] == null) { + throw new ExecutionPlanRuntimeException("Invalid input given to device:addOperation() function. " + + "Neither of any three arguments cannot be null"); + } + + JSONArray deviceIds = new JSONArray((String) data[0]); + String deviceType = (String) data[1]; + List deviceIdentifiers = new ArrayList<>(); + for (int i = 0; i < deviceIds.length(); i++) { + deviceIdentifiers.add(deviceIds.getString(i)); + } + + Operation operation = new Operation(); + operation.setType(Operation.Type.valueOf((String) data[3])); + operation.setStatus(Operation.Status.PENDING); + operation.setCode((String) data[2]); + operation.setEnabled((Boolean) data[4]); + String payloadString = (String) data[5]; + operation.setPayLoad(payloadString.replaceAll("'", "\"")); + + String date = new SimpleDateFormat(DATE_FORMAT_NOW).format(new Date()); + operation.setCreatedTimeStamp(date); + + OperationRequest operationRequest = new OperationRequest(); + operationRequest.setDeviceIdentifiers(deviceIdentifiers); + operationRequest.setOperation(operation); + try { + Activity activity = operationService.addOperation(deviceType, operationRequest); + return new Object[]{activity.getActivityId()}; + } catch (Exception e) { + log.error("Error occurred while adding the operation " + operation.toString(), e); + return new Object[]{null}; + } + } + + /** + * The process method of the StreamFunction, used when zero or one function parameter is provided + * + * @param data null if the function parameter count is zero or runtime data value of the function parameter + * @return the data for additional output attribute introduced by the function + */ + @Override + protected Object[] process(Object data) { + return new Object[0]; + } + + /** + * This will be called only once and this can be used to acquire + * required resources for the processing element. + * This will be called after initializing the system and before + * starting to process the events. + */ + @Override + public void start() { + + } + + /** + * This will be called only once and this can be used to release + * the acquired resources for processing. + * This will be called before shutting down the system. + */ + @Override + public void stop() { + + } + + /** + * Used to collect the serializable state of the processing element, that need to be + * persisted for the reconstructing the element to the same state on a different point of time + * + * @return stateful objects of the processing element as an array + */ + @Override + public Object[] currentState() { + return new Object[0]; + } + + /** + * Used to restore serialized state of the processing element, for reconstructing + * the element to the same state as if was on a previous point of time. + * + * @param objects the stateful objects of the element as an array on + * the same order provided by currentState(). + */ + @Override + public void restoreState(Object[] objects) { + //Since there's no need to maintain a state, nothing needs to be done here. + } +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/OAuthRequestInterceptor.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/OAuthRequestInterceptor.java new file mode 100755 index 000000000..7ef87863d --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/OAuthRequestInterceptor.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client; + +import feign.Feign; +import feign.Logger; +import feign.RequestInterceptor; +import feign.RequestTemplate; +import feign.auth.BasicAuthRequestInterceptor; +import feign.gson.GsonDecoder; +import feign.gson.GsonEncoder; +import feign.jaxrs.JAXRSContract; +import feign.okhttp.OkHttpClient; +import feign.slf4j.Slf4jLogger; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.identity.jwt.client.extension.JWTClient; +import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; +import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; +import org.wso2.carbon.user.api.UserStoreException; +import org.wso2.extension.siddhi.device.client.configs.SiddhiExtensionConfigReader; +import org.wso2.extension.siddhi.device.client.dto.OAuthApplication; +import org.wso2.extension.siddhi.device.client.dto.RegistrationProfile; +import org.wso2.extension.siddhi.device.client.exception.APIMClientOAuthException; +import org.wso2.extension.siddhi.device.client.services.DCRService; +import org.wso2.extension.siddhi.device.utils.ClientUtils; +import org.wso2.extension.siddhi.device.utils.DeviceUtils; + +/** + * This is a request interceptor to add oauth token header. + */ +public class OAuthRequestInterceptor implements RequestInterceptor { + + private static final String APPLICATION_NAME = "siddhi_extension_client"; + private static final String REQUIRED_SCOPES = "perm:devices:operations"; + private static final String[] API_TAGS = {"device_management"}; + private DCRService dcrService; + private static OAuthApplication oAuthApplication; + private static final Log log = LogFactory.getLog(OAuthRequestInterceptor.class); + + /** + * Creates an interceptor that authenticates all requests. + */ + public OAuthRequestInterceptor() { + String username = SiddhiExtensionConfigReader.getInstance().getConfig().getUsername(); + String password = SiddhiExtensionConfigReader.getInstance().getConfig().getPassword(); + dcrService = Feign.builder().client(new OkHttpClient(ClientUtils.getSSLClient())).logger(new Slf4jLogger()) + .logLevel(Logger.Level.FULL) + .requestInterceptor(new BasicAuthRequestInterceptor(username, password)) + .contract(new JAXRSContract()).encoder(new GsonEncoder()).decoder(new GsonDecoder()) + .target(DCRService.class, ClientUtils.replaceProperties( + SiddhiExtensionConfigReader.getInstance().getConfig().getDcrEndpoint())); + } + + @Override + public void apply(RequestTemplate template) { + if (oAuthApplication == null) { + RegistrationProfile registrationProfile = new RegistrationProfile(); + registrationProfile.setApiApplicationName(APPLICATION_NAME); + registrationProfile.setIsAllowedToAllDomains(true); + registrationProfile.setTags(API_TAGS); + oAuthApplication = dcrService.register(registrationProfile); + } + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); + try { + String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration().getAdminUserName(); + if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { + username = username + "@" + tenantDomain; + } + JWTClient jwtClient = DeviceUtils.getJWTClientManagerService().getJWTClient(); + AccessTokenInfo tenantBasedAccessTokenInfo = jwtClient.getAccessToken(oAuthApplication.getClientId(), + oAuthApplication.getClientSecret(), username, REQUIRED_SCOPES); + if (tenantBasedAccessTokenInfo.getAccessToken() != null) { + String headerValue = "Bearer " + tenantBasedAccessTokenInfo.getAccessToken(); + template.header("Authorization", headerValue); + } + } catch (JWTClientException e) { + String msg = "Failed to retrieve oauth token using jwt"; + log.error(msg, e); + throw new APIMClientOAuthException(msg, e); + } catch (UserStoreException e) { + String msg = "Unable to retrieve realm config for tenant " + tenantDomain; + log.error(msg, e); + throw new APIMClientOAuthException(msg, e); + } + } + +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/configs/SiddhiExtensionConfig.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/configs/SiddhiExtensionConfig.java new file mode 100644 index 000000000..0021ca690 --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/configs/SiddhiExtensionConfig.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.configs; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * This holds the configuration api manager integration. + */ +@XmlRootElement(name = "SiddhiExtensionConfiguration") +public class SiddhiExtensionConfig { + + String dcrEndpoint; + String gatewayEndpoint; + String username; + String password; + + @XmlElement(name = "DCREndpoint", required = true) + public String getDcrEndpoint() { + return dcrEndpoint; + } + + public void setDcrEndpoint(String dcrEndpoint) { + this.dcrEndpoint = dcrEndpoint; + } + + @XmlElement(name = "GatewayEndpoint", required = true) + public String getGatewayEndpoint() { + return gatewayEndpoint; + } + + public void setGatewayEndpoint(String gatewayEndpoint) { + this.gatewayEndpoint = gatewayEndpoint; + } + + @XmlElement(name = "Username", required = true) + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + @XmlElement(name = "Password", required = true) + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/configs/SiddhiExtensionConfigReader.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/configs/SiddhiExtensionConfigReader.java new file mode 100644 index 000000000..5a2211463 --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/configs/SiddhiExtensionConfigReader.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.configs; + +import org.w3c.dom.Document; +import org.wso2.carbon.utils.CarbonUtils; +import org.wso2.extension.siddhi.device.client.exception.APIMClientException; +import org.wso2.extension.siddhi.device.client.exception.InvalidConfigurationStateException; + +import javax.xml.XMLConstants; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import java.io.File; + +/** + * This holds the configuration parser for api integration.xml + */ +public class SiddhiExtensionConfigReader { + + private static SiddhiExtensionConfig config; + private static SiddhiExtensionConfigReader configReader = new SiddhiExtensionConfigReader(); + private static boolean isInitialized = false; + private static final String SIDDHI_INTEGRATION_CONFIG_PATH = + CarbonUtils.getCarbonConfigDirPath() + File.separator + "siddhi-integration.xml"; + + private SiddhiExtensionConfigReader() { + + } + + private static String apimIntegrationXmlFilePath = ""; + + //TOD file may be a part of another file + public static SiddhiExtensionConfigReader getInstance() { + if (!isInitialized) { + try { + init(); + } catch (APIMClientException e) { + throw new InvalidConfigurationStateException("Webapp Authenticator Configuration is not " + + "initialized properly"); + } + } + return configReader; + } + + public static void init() throws APIMClientException { + try { + File siddhiConfigFile = new File(SIDDHI_INTEGRATION_CONFIG_PATH); + Document doc = convertToDocument(siddhiConfigFile); + + JAXBContext ctx = JAXBContext.newInstance(SiddhiExtensionConfig.class); + Unmarshaller unmarshaller = ctx.createUnmarshaller(); + config = (SiddhiExtensionConfig) unmarshaller.unmarshal(doc); + isInitialized = true; + } catch (JAXBException e) { + throw new APIMClientException("Error occurred while un-marshalling SiddhiExtensionConfig", e); + } + } + + private static Document convertToDocument(File file) throws APIMClientException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + try { + factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + return docBuilder.parse(file); + } catch (Exception e) { + throw new APIMClientException("Error occurred while parsing file 'apim-integration.xml' to a org.w3c.dom.Document", e); + } + } + + public SiddhiExtensionConfig getConfig() { + return config; + } + +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/OAuthApplication.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/OAuthApplication.java new file mode 100644 index 000000000..46c72e9e3 --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/OAuthApplication.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.dto; + +public class OAuthApplication { + + private String client_id; + private String client_secret; + + public String getClientId() { + return client_id; + } + + public void setClientId(String clientId) { + this.client_id = clientId; + } + + public String getClientSecret() { + return client_secret; + } + + public void setClientSecret(String clientSecret) { + this.client_secret = clientSecret; + } + + @Override + public String toString() { + return "OAuthApplication {\n" + + " clientId: " + client_id + "\n" + + " clientSecret: " + client_secret + "\n" + + "}\n"; + } + +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/OperationRequest.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/OperationRequest.java new file mode 100644 index 000000000..bd3d919e3 --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/OperationRequest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.dto; + +import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; + +import java.util.List; + +public class OperationRequest { + + private List deviceIdentifiers; + private Operation operation; + + public List getDeviceIdentifiers() { + return deviceIdentifiers; + } + + public void setDeviceIdentifiers(List deviceIdentifiers) { + this.deviceIdentifiers = deviceIdentifiers; + } + + public Operation getOperation() { + return operation; + } + + public void setOperation(Operation operation) { + this.operation = operation; + } +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/RegistrationProfile.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/RegistrationProfile.java new file mode 100644 index 000000000..ecb0086de --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/dto/RegistrationProfile.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.dto; + +/** + * DTO class to be used when registering an ApiM application. + */ + +public class RegistrationProfile { + + private String applicationName; + private String tags[]; + private boolean isAllowedToAllDomains; + private String validityPeriod; + + public String getApplicationName() { + return applicationName; + } + + public void setApiApplicationName(String apiApplicationName) { + this.applicationName = apiApplicationName; + } + + public String[] getTags() { + return tags; + } + + public void setTags(String[] tags) { + this.tags = tags; + } + + public boolean isAllowedToAllDomains() { + return isAllowedToAllDomains; + } + + public void setIsAllowedToAllDomains(boolean isAllowedToAllDomains) { + this.isAllowedToAllDomains = isAllowedToAllDomains; + } + + public String getValidityPeriod() { + return validityPeriod; + } + + public void setValidityPeriod(String validityPeriod) { + this.validityPeriod = validityPeriod; + } +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/APIMClientException.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/APIMClientException.java new file mode 100644 index 000000000..98f3c460b --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/APIMClientException.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.exception; + +/** + * This holds api client exception. + */ +public class APIMClientException extends Exception { + + private static final long serialVersionUID = -3976392476319079281L; + private String responseReason; + private int responseStatus; + private String methodKey; + + APIMClientException(String methodKey, String reason, int status) { + super("Exception occurred while invoking " + methodKey + " status = " + status + " reason = " + reason); + this.methodKey = methodKey; + this.responseReason = reason; + this.responseStatus = status; + } + + APIMClientException(String message) { + super(message); + } + + public APIMClientException(String message, Exception e) { + super(message, e); + } + + public String getResponseReason() { + return responseReason; + } + + public int getResponseStatus() { + return responseStatus; + } + + public String getMethodKey() { + return methodKey; + } + +} \ No newline at end of file diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/APIMClientOAuthException.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/APIMClientOAuthException.java new file mode 100644 index 000000000..731fa3c25 --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/APIMClientOAuthException.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.exception; + +/** + * This holds api client exception. + */ +public class APIMClientOAuthException extends RuntimeException { + + private static final long serialVersionUID = -3976392476319079281L; + private String responseReason; + private int responseStatus; + private String methodKey; + + APIMClientOAuthException(String methodKey, String reason, int status) { + super("Exception occurred while invoking " + methodKey + " status = " + status + " reason = " + reason); + this.methodKey = methodKey; + this.responseReason = reason; + this.responseStatus = status; + } + + public APIMClientOAuthException(String message) { + super(message); + } + + public APIMClientOAuthException(String message, Exception e) { + super(message, e); + } + + public String getResponseReason() { + return responseReason; + } + + public int getResponseStatus() { + return responseStatus; + } + + public String getMethodKey() { + return methodKey; + } + +} \ No newline at end of file diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/InvalidConfigurationStateException.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/InvalidConfigurationStateException.java new file mode 100644 index 000000000..2656fd74b --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/exception/InvalidConfigurationStateException.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.exception; + +/** + * This error is thrown when there is an issue with the client. + */ +public class InvalidConfigurationStateException extends RuntimeException { + + private static final long serialVersionUID = -3151279311329070397L; + + private String errorMessage; + private int errorCode; + + public InvalidConfigurationStateException(int errorCode, String message) { + super(message); + this.errorCode = errorCode; + } + + public InvalidConfigurationStateException(int errorCode, String message, Throwable cause) { + super(message, cause); + this.errorCode = errorCode; + } + + public int getErrorCode() { + return errorCode; + } + + + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public InvalidConfigurationStateException(String msg, Exception nestedEx) { + super(msg, nestedEx); + setErrorMessage(msg); + } + + public InvalidConfigurationStateException(String message, Throwable cause) { + super(message, cause); + setErrorMessage(message); + } + + public InvalidConfigurationStateException(String msg) { + super(msg); + setErrorMessage(msg); + } + + public InvalidConfigurationStateException() { + super(); + } + + public InvalidConfigurationStateException(Throwable cause) { + super(cause); + } + +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/services/DCRService.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/services/DCRService.java new file mode 100644 index 000000000..c170f9c5b --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/services/DCRService.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.services; + +import org.wso2.extension.siddhi.device.client.dto.OAuthApplication; +import org.wso2.extension.siddhi.device.client.dto.RegistrationProfile; + +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +/** + * DCR Rest resource. + */ +@Path("/") +public interface DCRService { + + // DCR APIs + @POST + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) + OAuthApplication register(RegistrationProfile registrationProfile); + +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/services/OperationService.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/services/OperationService.java new file mode 100644 index 000000000..9df62e75a --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/client/services/OperationService.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018, 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.wso2.extension.siddhi.device.client.services; + +import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; +import org.wso2.extension.siddhi.device.client.dto.OperationRequest; + +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +/** + * Add Operation REST resource. + */ +@Path("/devices") +public interface OperationService { + + @POST + @Path("/{type}/operations") + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) + Activity addOperation(@PathParam("type") String type, OperationRequest operationRequest); + +} diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/utils/ClientUtils.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/utils/ClientUtils.java new file mode 100644 index 000000000..f51d9619a --- /dev/null +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/utils/ClientUtils.java @@ -0,0 +1,223 @@ +/* +* Copyright (c) 2018, 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.wso2.extension.siddhi.device.utils; + +import okhttp3.OkHttpClient; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.ServerConfiguration; + +import javax.net.ssl.*; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.*; +import java.security.*; +import java.security.cert.CertificateException; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ClientUtils { + + private static final Log log = LogFactory.getLog(ClientUtils.class); + + private static final String KEY_STORE_TYPE = "JKS"; + /** + * Default truststore type of the client + */ + private static final String TRUST_STORE_TYPE = "JKS"; + /** + * Default keymanager type of the client + */ + private static final String KEY_MANAGER_TYPE = "SunX509"; //Default Key Manager Type + /** + * Default trustmanager type of the client + */ + private static final String TRUST_MANAGER_TYPE = "SunX509"; //Default Trust Manager Type + + private static final String SSLV3 = "SSLv3"; + + private static final String DEFAULT_HOST = "localhost"; + + private static final String DEFAULT_HOST_IP = "127.0.0.1"; + + + //This method is only used if the mb features are within DAS. + public static String replaceProperties(String text) { + String regex = "\\$\\{(.*?)\\}"; + Pattern pattern = Pattern.compile(regex); + Matcher matchPattern = pattern.matcher(text); + while (matchPattern.find()) { + String sysPropertyName = matchPattern.group(1); + String sysPropertyValue = System.getProperty(sysPropertyName); + if (sysPropertyValue != null && !sysPropertyName.isEmpty()) { + text = text.replaceAll("\\$\\{(" + sysPropertyName + ")\\}", sysPropertyValue); + } + } + return text; + } + + public static OkHttpClient getSSLClient() { + + boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2" + + ".ignoreHostnameVerification")); + OkHttpClient okHttpClient; + final String proxyHost = System.getProperty("http.proxyHost"); + final String proxyPort = System.getProperty("http.proxyPort"); + final String nonProxyHostsValue = System.getProperty("http.nonProxyHosts"); + + final ProxySelector proxySelector = new ProxySelector() { + @Override + public List select(URI uri) { + List proxyList = new ArrayList<>(); + String host = uri.getHost(); + + if (!StringUtils.isEmpty(host)) { + if (host.startsWith(DEFAULT_HOST_IP) || host.startsWith(DEFAULT_HOST) || StringUtils + .isEmpty(nonProxyHostsValue) || StringUtils.contains(nonProxyHostsValue, host) || + StringUtils.isEmpty(proxyHost) || StringUtils.isEmpty(proxyPort)) { + proxyList.add(Proxy.NO_PROXY); + } else { + proxyList.add(new Proxy(Proxy.Type.HTTP, + new InetSocketAddress(proxyHost, Integer.parseInt(proxyPort)))); + } + } else { + log.error("Host is null. Host could not be empty or null"); + } + return proxyList; + } + + @Override + public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { + throw new UnsupportedOperationException("Not supported yet."); + } + }; + + X509TrustManager trustAllCerts = new X509TrustManager() { + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[0]; + } + public void checkClientTrusted( + java.security.cert.X509Certificate[] certs, String authType) { + } + public void checkServerTrusted( + java.security.cert.X509Certificate[] certs, String authType) { + } + }; + if(isIgnoreHostnameVerification) { + okHttpClient = new OkHttpClient.Builder() + .sslSocketFactory(getSimpleTrustedSSLSocketFactory(), trustAllCerts) + .hostnameVerifier(new HostnameVerifier() { + @Override + public boolean verify(String s, SSLSession sslSession) { + return true; + } + }).proxySelector(proxySelector).build(); + return okHttpClient; + }else { + SSLSocketFactory trustedSSLSocketFactory = getTrustedSSLSocketFactory(); + okHttpClient = new OkHttpClient.Builder().sslSocketFactory(trustedSSLSocketFactory) + .proxySelector(proxySelector).build(); + return okHttpClient; + } + } + + private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() { + try { + TrustManager[] trustAllCerts = new TrustManager[]{ + new X509TrustManager() { + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return null; + } + public void checkClientTrusted( + java.security.cert.X509Certificate[] certs, String authType) { + } + public void checkServerTrusted( + java.security.cert.X509Certificate[] certs, String authType) { + } + } + }; + SSLContext sc = SSLContext.getInstance("SSL"); + sc.init(null, trustAllCerts, new java.security.SecureRandom()); + return sc.getSocketFactory(); + } catch (KeyManagementException | NoSuchAlgorithmException e) { + return null; + } + + } + + private static SSLSocketFactory getTrustedSSLSocketFactory() { + try { + String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password"); + String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location"); + String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty( + "Security.TrustStore.Password"); + String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty( + "Security.TrustStore.Location"); + KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,KEY_STORE_TYPE); + KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword); + + return initSSLConnection(keyStore,keyStorePassword,trustStore); + } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException + |CertificateException | IOException | UnrecoverableKeyException e) { + log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e); + return null; + } + + } + + private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException, + KeyStoreException, KeyManagementException { + KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KEY_MANAGER_TYPE); + keyManagerFactory.init(keyStore, keyStorePassword.toCharArray()); + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE); + trustManagerFactory.init(trustStore); + + // Create and initialize SSLContext for HTTPS communication + SSLContext sslContext = SSLContext.getInstance(SSLV3); + sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null); + SSLContext.setDefault(sslContext); + return sslContext.getSocketFactory(); + } + + + private static KeyStore loadKeyStore(String keyStorePath, String ksPassword,String type) + throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { + InputStream fileInputStream = null; + try { + char[] keypassChar = ksPassword.toCharArray(); + KeyStore keyStore = KeyStore.getInstance(type); + fileInputStream = new FileInputStream(keyStorePath); + keyStore.load(fileInputStream, keypassChar); + return keyStore; + } finally { + if (fileInputStream != null) { + fileInputStream.close(); + } + } + } + + private static KeyStore loadTrustStore(String trustStorePath, String tsPassword) + throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { + return loadKeyStore(trustStorePath,tsPassword,TRUST_STORE_TYPE); + } +} \ No newline at end of file diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/utils/DeviceUtils.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/utils/DeviceUtils.java index 897e026c6..b7109c8b1 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/utils/DeviceUtils.java +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/java/org/wso2/extension/siddhi/device/utils/DeviceUtils.java @@ -20,8 +20,10 @@ package org.wso2.extension.siddhi.device.utils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService; +import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService; /** * This class holds utility methods to retrieve data. @@ -31,6 +33,8 @@ public class DeviceUtils { private static Log log = LogFactory.getLog(DeviceUtils.class); private static DeviceManagementProviderService deviceManagementProviderService; private static GroupManagementProviderService groupManagementProviderService; + private static NotificationManagementService notificationManagementService; + private static JWTClientManagerService jwtClientManagerService; private DeviceUtils(){ } @@ -64,4 +68,34 @@ public class DeviceUtils { } return groupManagementProviderService; } + + public static NotificationManagementService getNotificationManagementService() { + if (notificationManagementService != null) { + return notificationManagementService; + } + PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + notificationManagementService = + (NotificationManagementService) ctx.getOSGiService(NotificationManagementService.class, null); + if (notificationManagementService == null) { + String msg = "Notification Management service has not initialized."; + log.error(msg); + throw new IllegalStateException(msg); + } + return notificationManagementService; + } + + public static JWTClientManagerService getJWTClientManagerService() { + if (jwtClientManagerService != null) { + return jwtClientManagerService; + } + PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + jwtClientManagerService = + (JWTClientManagerService) ctx.getOSGiService(JWTClientManagerService.class, null); + if (jwtClientManagerService == null) { + String msg = "JWTClient Manager service has not initialized."; + log.error(msg); + throw new IllegalStateException(msg); + } + return jwtClientManagerService; + } } diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/resources/device.siddhiext b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/resources/device.siddhiext index 84dd50b95..8b9d47d9f 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/resources/device.siddhiext +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/main/resources/device.siddhiext @@ -22,3 +22,5 @@ hasDevicesOfUser=org.wso2.extension.siddhi.device.HasDevicesOfUserFunctionExecut getDevicesOfStatus=org.wso2.extension.siddhi.device.GetDevicesOfStatusFunctionExecutor hasDevicesOfStatus=org.wso2.extension.siddhi.device.HasDevicesOfStatusFunctionExecutor isEnrolled=org.wso2.extension.siddhi.device.IsEnrolledFunctionExecutor +addNotification=org.wso2.extension.siddhi.device.AddNotificationFunctionProcessor +addOperation=org.wso2.extension.siddhi.device.AddOperationFunctionProcessor \ No newline at end of file diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml index ccce924e4..f5fbdc815 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins siddhi-extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/pom.xml b/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/pom.xml index f34585904..13ceb7bea 100644 --- a/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins siddhi-extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/extensions/siddhi-extensions/pom.xml b/components/extensions/siddhi-extensions/pom.xml index afe3bd7f8..5164b1557 100644 --- a/components/extensions/siddhi-extensions/pom.xml +++ b/components/extensions/siddhi-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml index 77060fe02..b2f3d1c62 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml @@ -21,7 +21,7 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java new file mode 100644 index 000000000..e7061ae91 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018, 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.wso2.carbon.mdm.services.android.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; + +@ApiModel(value = "NotifierFrequency", + description = "This class represents notification frequency configuration.") +public class NotifierFrequency extends AndroidOperation implements Serializable { + + @ApiModelProperty(name = "value", value = "Notification polling frequency", required = true) + private int value; + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java index dad6cb454..326fe82e5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java @@ -20,13 +20,20 @@ package org.wso2.carbon.mdm.services.android.services.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; +import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; import org.wso2.carbon.mdm.services.android.bean.AndroidPlatformConfiguration; import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; +import org.wso2.carbon.mdm.services.android.bean.NotifierFrequency; import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; import org.wso2.carbon.mdm.services.android.services.DeviceTypeConfigurationService; import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; @@ -114,6 +121,29 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati AndroidAPIUtils.getDeviceManagementService().addLicense(DeviceManagementConstants. MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, license); licenseEntry = entry; + } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_FREQUENCY.equals(entry.getName())) { + List deviceList = AndroidAPIUtils. + getDeviceManagementService(). + getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + List deviceIdList = new ArrayList<>(); + for (Device device : deviceList) { + deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(),device.getType())); + } + if (entry.getValue() != null) { + NotifierFrequency notifierFrequency = new NotifierFrequency(); + notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString())); + ProfileOperation operation = new ProfileOperation(); + operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY); + operation.setPayLoad(notifierFrequency.toJSON()); + operation.setType(Operation.Type.CONFIG); + operation.setEnabled(true); + AndroidAPIUtils.getDeviceManagementService().addOperation( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + operation, deviceIdList); + } else { + return Response.status(Response.Status.BAD_REQUEST) + .entity("No value specified for notifierFrequency.").build(); + } } } @@ -122,14 +152,29 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati } configuration.setConfiguration(configs); AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration); - //AndroidAPIUtils.getGCMService().resetTenantConfigCache(); } catch (DeviceManagementException e) { msg = "Error occurred while modifying configuration settings of Android platform"; log.error(msg, e); throw new UnexpectedServerErrorException( new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); + } catch (NumberFormatException e) { + msg = "Error occurred while reading notification frequency."; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); + } catch (OperationManagementException e) { + msg = "Error occurred while modifying configuration settings of Android platform."; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); + } catch (InvalidDeviceException e) { + msg = "Error occurred with the device."; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); } - return Response.status(Response.Status.OK).entity("Android platform configuration has been updated successfully.").build(); + return Response.status(Response.Status.OK) + .entity("Android platform configuration has been updated successfully.").build(); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java index c5e0c36ab..f42a9a8d2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java @@ -69,13 +69,14 @@ public class EventReceiverServiceImpl implements EventReceiverService { if (log.isDebugEnabled()) { log.debug("Invoking Android device event logging."); } + Device device; try { if (!DeviceManagerUtil.isPublishLocationResponseEnabled()) { return Response.status(Response.Status.ACCEPTED).entity("Event is publishing has not enabled.").build(); } DeviceIdentifier deviceIdentifier = new DeviceIdentifier(eventBeanWrapper.getDeviceIdentifier(), AndroidConstants.DEVICE_TYPE_ANDROID); - Device device = AndroidAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier); + device = AndroidAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier); if (device != null && EnrolmentInfo.Status.ACTIVE != device.getEnrolmentInfo().getStatus()){ return Response.status(Response.Status.ACCEPTED).entity("Device is not in Active state.").build(); } else if (device == null){ @@ -92,7 +93,8 @@ public class EventReceiverServiceImpl implements EventReceiverService { return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); } Message message = new Message(); - Object[] metaData = {eventBeanWrapper.getDeviceIdentifier(), AndroidConstants.DEVICE_TYPE_ANDROID}; + Object[] metaData = {eventBeanWrapper.getDeviceIdentifier(), device.getEnrolmentInfo().getOwner(), + AndroidConstants.DEVICE_TYPE_ANDROID}; String eventPayload = eventBeanWrapper.getPayload(); JsonObject jsonObject = gson.fromJson(eventPayload, JsonObject.class); Object[] payload = { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java index 3a93305bd..d7491c916 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java @@ -104,6 +104,7 @@ public final class AndroidConstants { public static final String LOGCAT = "LOGCAT"; public static final String APP_RESTRICTION = "APP-RESTRICTION"; public static final String WORK_PROFILE = "WORK_PROFILE"; + public static final String NOTIFIER_FREQUENCY = "NOTIFIER_FREQUENCY"; } public final class StatusCodes { @@ -122,6 +123,7 @@ public final class AndroidConstants { public static final String LICENSE_KEY = "androidEula"; public static final String LANGUAGE_US = "en_US"; public static final String CONTENT_TYPE_TEXT = "text"; + public static final String NOTIFIER_FREQUENCY = "notifierFrequency"; } public final class ApplicationProperties { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/pom.xml index 996e0cd96..686e10411 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/pom.xml @@ -21,7 +21,7 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml index 9e3ce0b57..821677677 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml @@ -23,13 +23,13 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.android.ui - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - Mobile Android UI pom diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/pom.xml index 748873e9e..9f95af094 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/pom.xml @@ -23,7 +23,7 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java new file mode 100644 index 000000000..f97f410f7 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018, 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.wso2.carbon.mdm.services.android.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; + +@ApiModel(value = "NotifierFrequency", + description = "This class represents notification frequency configuration.") +public class NotifierFrequency extends AndroidOperation implements Serializable { + + @ApiModelProperty(name = "value", value = "Notification polling frequency", required = true) + private int value; + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + +} \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java index fed82e992..4189e0b6d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java @@ -21,13 +21,20 @@ package org.wso2.carbon.mdm.services.android.services.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; +import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; import org.wso2.carbon.mdm.services.android.bean.AndroidPlatformConfiguration; import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; +import org.wso2.carbon.mdm.services.android.bean.NotifierFrequency; import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; import org.wso2.carbon.mdm.services.android.services.DeviceTypeConfigurationService; import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; @@ -115,6 +122,29 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati AndroidAPIUtils.getDeviceManagementService().addLicense(DeviceManagementConstants. MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, license); licenseEntry = entry; + } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_FREQUENCY.equals(entry.getName())) { + List deviceList = AndroidAPIUtils. + getDeviceManagementService(). + getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + List deviceIdList = new ArrayList<>(); + for (Device device : deviceList) { + deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType())); + } + if (entry.getValue() != null) { + NotifierFrequency notifierFrequency = new NotifierFrequency(); + notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString())); + ProfileOperation operation = new ProfileOperation(); + operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY); + operation.setPayLoad(notifierFrequency.toJSON()); + operation.setType(Operation.Type.CONFIG); + operation.setEnabled(true); + AndroidAPIUtils.getDeviceManagementService().addOperation( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + operation, deviceIdList); + } else { + return Response.status(Response.Status.BAD_REQUEST) + .entity("No value specified for notifierFrequency.").build(); + } } } @@ -129,8 +159,24 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati log.error(msg, e); throw new UnexpectedServerErrorException( new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); + } catch (NumberFormatException e) { + msg = "Error occurred while reading notification frequency."; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); + } catch (OperationManagementException e) { + msg = "Error occurred while modifying configuration settings of Android platform."; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); + } catch (InvalidDeviceException e) { + msg = "Error occurred with the device."; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); } - return Response.status(Response.Status.OK).entity("Android platform configuration has been updated successfully.").build(); + return Response.status(Response.Status.OK) + .entity("Android platform configuration has been updated successfully.").build(); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java index 62c8a5625..308b78417 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java @@ -70,13 +70,14 @@ public class EventReceiverServiceImpl implements EventReceiverService { if (log.isDebugEnabled()) { log.debug("Invoking Android device event logging."); } + Device device; try { if (!DeviceManagerUtil.isPublishLocationResponseEnabled()) { return Response.status(Response.Status.ACCEPTED).entity("Event is publishing has not enabled.").build(); } DeviceIdentifier deviceIdentifier = new DeviceIdentifier(eventBeanWrapper.getDeviceIdentifier(), AndroidConstants.DEVICE_TYPE_ANDROID); - Device device = AndroidAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier); + device = AndroidAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier); if (device != null && EnrolmentInfo.Status.ACTIVE != device.getEnrolmentInfo().getStatus()){ return Response.status(Response.Status.ACCEPTED).entity("Device is not in Active state.").build(); } else if (device == null){ @@ -93,7 +94,8 @@ public class EventReceiverServiceImpl implements EventReceiverService { return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); } Message message = new Message(); - Object[] metaData = {eventBeanWrapper.getDeviceIdentifier(), AndroidConstants.DEVICE_TYPE_ANDROID}; + Object[] metaData = {eventBeanWrapper.getDeviceIdentifier(), device.getEnrolmentInfo().getOwner(), + AndroidConstants.DEVICE_TYPE_ANDROID}; String eventPayload = eventBeanWrapper.getPayload(); JsonObject jsonObject = gson.fromJson(eventPayload, JsonObject.class); Object[] payload = { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java index d4b4db0ca..b5a28c1ee 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java @@ -104,6 +104,7 @@ public final class AndroidConstants { public static final String LOGCAT = "LOGCAT"; public static final String APP_RESTRICTION = "APP-RESTRICTION"; public static final String WORK_PROFILE = "WORK_PROFILE"; + public static final String NOTIFIER_FREQUENCY = "NOTIFIER_FREQUENCY"; } public final class StatusCodes { @@ -122,6 +123,7 @@ public final class AndroidConstants { public static final String LICENSE_KEY = "androidEula"; public static final String LANGUAGE_US = "en_US"; public static final String CONTENT_TYPE_TEXT = "text"; + public static final String NOTIFIER_FREQUENCY = "notifierFrequency"; } public final class ApplicationProperties { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml index fbfe5e5cc..5b0e2bd8d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml @@ -22,7 +22,7 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/pom.xml b/components/mobile-plugins/android-plugin/pom.xml index 13606a21d..2e6b3478e 100644 --- a/components/mobile-plugins/android-plugin/pom.xml +++ b/components/mobile-plugins/android-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/pom.xml b/components/mobile-plugins/pom.xml index 0688892a6..3cba539b1 100644 --- a/components/mobile-plugins/pom.xml +++ b/components/mobile-plugins/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml index 042575b69..016235319 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml @@ -21,7 +21,7 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml index a2a827204..8d180991a 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml @@ -23,13 +23,13 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.windows.ui - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - Mobile Windows UI pom diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml index b916b691f..28ccf2d8a 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml @@ -22,7 +22,7 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/windows-plugin/pom.xml b/components/mobile-plugins/windows-plugin/pom.xml index 8c3960b8a..7ca8e2bba 100644 --- a/components/mobile-plugins/windows-plugin/pom.xml +++ b/components/mobile-plugins/windows-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/components/test-coverage/pom.xml b/components/test-coverage/pom.xml index bc4b4edcf..21572f53b 100644 --- a/components/test-coverage/pom.xml +++ b/components/test-coverage/pom.xml @@ -22,7 +22,7 @@ carbon-device-mgt-plugins-parent org.wso2.carbon.devicemgt-plugins - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml index a9c33e4ed..ac1fbb037 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml index 795ab6048..f76aed5bd 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.analytics.feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - IoT Server Analytics Feature http://wso2.org diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf index ffbc1a492..1a7837bcf 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf @@ -1,9 +1,8 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\ - +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/analytics/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/analytics/,overwrite:true);\ +instructions.uninstall = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../resources/devicetypes/analytics/org.wso2.carbon.iot.device.analytics_1.0.0.car,overwrite:true);\ diff --git a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml index c46dfde1f..2225abd29 100644 --- a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.iot.device.statistics.dashboard.feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - IoT Server Analytics Feature http://wso2.org diff --git a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml index c9ebbb4f2..7ea63342e 100644 --- a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml @@ -65,7 +65,7 @@ zip true - ${project.build.directory}/maven-shared-archive-resources + ${project.build.directory}/maven-shared-archive-resources/carbonapps **/* diff --git a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/src/main/resources/org_wso2_carbon_iot_geo_dashboard-1.0.0.car b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/src/main/resources/org_wso2_carbon_iot_geo_dashboard-1.0.0.car deleted file mode 100644 index e4f04be18..000000000 Binary files a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/src/main/resources/org_wso2_carbon_iot_geo_dashboard-1.0.0.car and /dev/null differ diff --git a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/src/main/resources/p2.inf b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/src/main/resources/p2.inf index de1c31555..eb4814ef1 100644 --- a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/src/main/resources/p2.inf +++ b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/src/main/resources/p2.inf @@ -1,8 +1,8 @@ instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.iot.geo.dashboard_${feature.version}/org_wso2_carbon_iot_geo_dashboard-1.0.0.car,target:${installFolder}/../../deployment/server/carbonapps/org_wso2_carbon_iot_geo_dashboard-1.0.0.car,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/analytics/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.iot.geo.dashboard_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/analytics/,overwrite:true);\ instructions.uninstall = \ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/carbonapps/org_wso2_carbon_iot_geo_dashboard-1.0.0.car,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../resources/devicetypes/analytics/org_wso2_carbon_iot_geo_dashboard-1.0.0.car,overwrite:true);\ diff --git a/features/analytics-feature/pom.xml b/features/analytics-feature/pom.xml index 3c5e7b1b1..9302b6b92 100644 --- a/features/analytics-feature/pom.xml +++ b/features/analytics-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml index 175833f19..95b515762 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins androidsense-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - IoT Server Android Sense Analytics Feature http://wso2.org diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml index 674c4720e..2a4eae0ff 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins androidsense-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.androidsense.backend.feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - IoT Server Android Sense Backend Feature http://wso2.org diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml index 8e1ec87e5..88d192cf7 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins androidsense-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.androidsense.ui.feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - IoT Server Android Sense UI Feature http://wso2.org diff --git a/features/device-types-feature/androidsense-plugin-feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/pom.xml index 082817ad4..34f03e517 100644 --- a/features/device-types-feature/androidsense-plugin-feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml index 0f9af885b..3a8c60657 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins arduino-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml index 7682f2030..e6ea9bcc5 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins arduino-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml index 3c5b42bc0..cdc49da2b 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins arduino-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/arduino-plugin-feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/pom.xml index d89dbed52..d60402c6b 100644 --- a/features/device-types-feature/arduino-plugin-feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/pom.xml b/features/device-types-feature/pom.xml index 027e53bea..59aed92d4 100644 --- a/features/device-types-feature/pom.xml +++ b/features/device-types-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 device-types-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - Device Management IoT Plugins Feature http://wso2.org diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml index 9ec04bd6f..637de7add 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins raspberrypi-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml index fdb5c676b..17d5e1d72 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins raspberrypi-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml index 938457a1a..7c6899180 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins raspberrypi-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml index dc2ca0670..730a84132 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml index 53fcce9a1..7d6a486ae 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins virtual-fire-alarm-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml index 5441652a4..c32ac3a1a 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins virtual-fire-alarm-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml index 980607576..4c28fd56a 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins virtual-fire-alarm-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml index 4d73e5b8c..84770055c 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.api.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.api.feature/pom.xml index 442f3fbad..559217cd6 100644 --- a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.api.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.api.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml index f1ca215d1..8459d8956 100644 --- a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml index 914846c9c..9638aba69 100644 --- a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml org.wso2.carbon.appmgt.mdm.osgiconnector.feature pom - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - App management MDM OSGI Connector http://wso2.org This feature contains the core bundles required for APP management OSGI MDM connection @@ -36,7 +36,7 @@ org.wso2.carbon.devicemgt-plugins org.wso2.carbon.appmgt.mdm.osgiconnector - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT org.apache.ws.commons.axiom diff --git a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml index e97e886b3..f0c69c9d6 100644 --- a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml org.wso2.carbon.appmgt.mdm.restconnector.feature pom - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - App management MDM REST Connector http://wso2.org This feature contains the core bundles required for APP management MDM REST connection @@ -36,7 +36,7 @@ org.wso2.carbon.devicemgt-plugins org.wso2.carbon.appmgt.mdm.restconnector - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT org.apache.ws.commons.axiom diff --git a/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml index a683e3df9..9220cbd30 100644 --- a/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.adapter.feature pom - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - Device Management Adapters Feature http://wso2.org This feature contains the adapter bundles required for IoT Server diff --git a/features/extensions-feature/org.wso2.carbon.device.mgt.notification.listener.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.device.mgt.notification.listener.feature/pom.xml index 926118ffc..099135fca 100644 --- a/features/extensions-feature/org.wso2.carbon.device.mgt.notification.listener.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.device.mgt.notification.listener.feature/pom.xml @@ -3,14 +3,14 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.notification.listener.feature pom - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - Notification Listener http://wso2.org This feature contains the core bundles required iot core listeners diff --git a/features/extensions-feature/org.wso2.carbon.device.mgt.remote.session.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.device.mgt.remote.session.feature/pom.xml index 1548896f3..dc3940652 100644 --- a/features/extensions-feature/org.wso2.carbon.device.mgt.remote.session.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.device.mgt.remote.session.feature/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 diff --git a/features/extensions-feature/org.wso2.extension.siddhi.device.feature/pom.xml b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/pom.xml index 6c8c07ef9..7c5bd5db1 100644 --- a/features/extensions-feature/org.wso2.extension.siddhi.device.feature/pom.xml +++ b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/build.properties b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/build.properties new file mode 100644 index 000000000..9c86577d7 --- /dev/null +++ b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true diff --git a/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/conf/siddhi-integration.xml b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/conf/siddhi-integration.xml new file mode 100644 index 000000000..8b762e3e4 --- /dev/null +++ b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/conf/siddhi-integration.xml @@ -0,0 +1,26 @@ + + + + https://${iot.gateway.host}:${iot.gateway.https.port}/api-application-registration/register + https://${iot.gateway.host}:${iot.gateway.https.port} + admin + admin + \ No newline at end of file diff --git a/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/p2.inf b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/p2.inf new file mode 100644 index 000000000..d55300665 --- /dev/null +++ b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/src/main/resources/p2.inf @@ -0,0 +1,2 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.extension.siddhi.device_${feature.version}/conf/siddhi-integration.xml,target:${installFolder}/../../conf/siddhi-integration.xml,overwrite:true);\ diff --git a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml index d0c161ec2..47953bcb7 100644 --- a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml +++ b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml org.wso2.extension.siddhi.execution.json.feature pom - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Siddhi Execution Extension - Json Feature http://wso2.org This feature contains Siddhi extension feature for changing a json string to individual properties. diff --git a/features/extensions-feature/org.wso2.gpl.siddhi.extension.geo.script.feature/pom.xml b/features/extensions-feature/org.wso2.gpl.siddhi.extension.geo.script.feature/pom.xml index c6c7fa41d..d03deff2c 100644 --- a/features/extensions-feature/org.wso2.gpl.siddhi.extension.geo.script.feature/pom.xml +++ b/features/extensions-feature/org.wso2.gpl.siddhi.extension.geo.script.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/pom.xml b/features/extensions-feature/pom.xml index 9a487f0bb..c3c436d74 100644 --- a/features/extensions-feature/pom.xml +++ b/features/extensions-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 extensions-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - Device Management Extensions http://wso2.org diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml index 969e5e43d..be9307320 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins android-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.android.feature pom - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - Android Device Management Feature http://wso2.org This feature contains the core bundles required for Android Device Management diff --git a/features/mobile-plugins-feature/android-plugin-feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/pom.xml index 4796e173b..b90e22438 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/pom.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 android-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - Device Management Android Plugin Feature http://wso2.org diff --git a/features/mobile-plugins-feature/pom.xml b/features/mobile-plugins-feature/pom.xml index 9d53a6fdb..b841398ff 100644 --- a/features/mobile-plugins-feature/pom.xml +++ b/features/mobile-plugins-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../../pom.xml 4.0.0 mobile-plugins-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - Device Management EMM Plugins Feature http://wso2.org diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml index f23523592..576ea19c7 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins windows-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.windows.feature pom - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - Windows Device Management Feature http://wso2.org This feature contains the core bundles required for Windows Device Management diff --git a/features/mobile-plugins-feature/windows-plugin-feature/pom.xml b/features/mobile-plugins-feature/windows-plugin-feature/pom.xml index eee6ec62d..8a11beaf8 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/pom.xml +++ b/features/mobile-plugins-feature/windows-plugin-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT ../pom.xml 4.0.0 windows-plugin-feature - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT pom WSO2 Carbon - Device Management Windows Plugin Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 955853a46..1785d0cae 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent pom - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT WSO2 Carbon - Device Management Plugins Parent http://wso2.org WSO2 Carbon - Device Management Plugins Parent @@ -1171,6 +1171,21 @@ ${javassist.version} test + + com.squareup.okhttp3 + okhttp + ${squareup.okhttp3.version} + + + com.squareup.okio + okio + ${okio.version} + + + io.github.openfeign + feign-okhttp + ${github.openfeign.version} + @@ -1205,7 +1220,7 @@ 1.2.140.wso2v3 - 7.0.59.wso2v1 + 7.0.85.wso2v1 7.0.34.wso2v2 @@ -1215,14 +1230,14 @@ 1.1.1 - 3.1.31-SNAPSHOT + 3.1.40-SNAPSHOT [3.1.0, 4.0.0) 1.2.53 - 4.1.7-SNAPSHOT + 4.1.12-SNAPSHOT 4.6.21 @@ -1307,7 +1322,7 @@ 3.2.2 1.8 - 7.0.59.wso2v1 + 7.0.85.wso2v1 4.3.1.wso2v2 [4.3.1, 5.0.0) @@ -1320,7 +1335,7 @@ 1.5.6.wso2v1 - 7.0.54 + 7.0.85 1.0 2.0 @@ -1353,6 +1368,10 @@ 1.4.0.wso2v1 3.12.1.GA 1.7.0 + + 3.8.1 + 1.13.0 + 9.3.1