forked from community/device-mgt-plugins
parent
b2d283eb8f
commit
a089caf14e
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<artifacts>
|
||||
<artifact name="temperature" version="1.0.0" type="carbon/application">
|
||||
<dependency artifact="temperature_stream" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
|
||||
<dependency artifact="temperature_store" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
|
||||
<dependency artifact="temperature_receiver" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
|
||||
<dependency artifact="temperature_publisher" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
|
||||
<dependency artifact="temperature_script" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
|
||||
</artifact>
|
||||
</artifacts>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<artifact name="temperature_publisher" version="1.0.0" type="event/publisher" serverRole="DataAnalyticsServer">
|
||||
<file>temperature_publisher.xml</file>
|
||||
</artifact>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<eventPublisher name="temperature_publisher" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
|
||||
<from streamName="org.wso2.iot.devices.temperature" version="1.0.0"/>
|
||||
<mapping customMapping="disable" type="wso2event"/>
|
||||
<to eventAdapterType="secured-websocket"/>
|
||||
</eventPublisher>
|
||||
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<artifact name="temperature_receiver" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer">
|
||||
<file>temperature_receiver.xml</file>
|
||||
</artifact>
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<eventReceiver name="temperature_receiver" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
|
||||
<from eventAdapterType="wso2event">
|
||||
<property name="events.duplicated.in.cluster">false</property>
|
||||
</from>
|
||||
<mapping customMapping="disable" type="wso2event"/>
|
||||
<to streamName="org.wso2.iot.devices.temperature" version="1.0.0"/>
|
||||
</eventReceiver>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<artifact name="temperature_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
|
||||
<file>temperature_script.xml</file>
|
||||
</artifact>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<Analytics>
|
||||
<Name>temperature_script</Name>
|
||||
<Script>
|
||||
CREATE TEMPORARY TABLE DeviceTemperatureData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_DEVICES_TEMPERATURE");
|
||||
|
||||
CREATE TEMPORARY TABLE DeviceTemperatureSummaryData USING CarbonAnalytics OPTIONS (tableName "DEVICE_TEMPERATURE_SUMMARY", schema "temperature FLOAT, deviceType STRING -i, deviceId STRING -i, owner STRING -i, time LONG -i",primaryKeys "deviceType, deviceId, owner, time");
|
||||
|
||||
insert into table DeviceTemperatureSummaryData select temperature, meta_deviceType as deviceType, meta_deviceId as deviceId, meta_owner as owner, cast(meta_time/1000 as BIGINT)as time from DeviceTemperatureData group by temperature, meta_deviceType, meta_deviceId, meta_owner, cast(meta_time/1000 as BIGINT);
|
||||
</Script>
|
||||
<CronExpression>0 0/5 * * * ?</CronExpression>
|
||||
</Analytics>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<artifact name="temperature_store" version="1.0.0" type="analytics/eventstore" serverRole="DataAnalyticsServer">
|
||||
<file>org_wso2_iot_devices_temperature.xml</file>
|
||||
</artifact>
|
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<EventStoreConfiguration>
|
||||
<Source>
|
||||
<StreamId>org.wso2.iot.devices.temperature:1.0.0</StreamId>
|
||||
</Source>
|
||||
<RecordStoreName>EVENT_STORE</RecordStoreName>
|
||||
<TableSchema>
|
||||
<ColumnDefinition>
|
||||
<Name>meta_owner</Name>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>true</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>STRING</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>meta_deviceType</Name>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>true</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>STRING</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>meta_deviceId</Name>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>true</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>STRING</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>meta_time</Name>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>true</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>LONG</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>temperature</Name>
|
||||
<EnableIndexing>false</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>FLOAT</Type>
|
||||
</ColumnDefinition>
|
||||
</TableSchema>
|
||||
</EventStoreConfiguration>
|
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<artifact name="temperature_stream" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
|
||||
<file>org.wso2.iot.devices.temperature_1.0.0.json</file>
|
||||
</artifact>
|
||||
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "org.wso2.iot.devices.temperature",
|
||||
"version": "1.0.0",
|
||||
"nickName": "Temperature Data",
|
||||
"description": "Temperature data received from the Device",
|
||||
"metaData": [
|
||||
{"name":"owner","type":"STRING"},
|
||||
{"name":"deviceType","type":"STRING"},
|
||||
{"name":"deviceId","type":"STRING"},
|
||||
{"name":"time","type":"LONG"}
|
||||
],
|
||||
"payloadData": [
|
||||
{
|
||||
"name": "temperature","type": "FLOAT"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in new issue