wso2 / carbon-device-mgt

Apache License 2.0
53 stars 113 forks source link

Isolating Geo Location Enabling Configuration #1163

Closed rasika closed 6 years ago

rasika commented 6 years ago

Purpose

In IoT Server v3.1.0 geo location services is enabled with the following configuration; GeoLocationConfiguration -> isEnabled -> true and GeoLocationConfiguration -> PublishLocationOperationResponse -> true. ​With the new feature developments; In latest IoT Server(master branch); now we also allow publishing device-info responses through the same configuration. OperationAnalyticsConfiguration -> isEnabled -> true and OperationAnalyticsConfiguration -> PublishOperationResponse -> true. However; there might be use cases for enabling geo location services without publishing all the device-info into IoT-Analytics server. Also; it should allow publishing any device response to the IoT Analytics server. This PR resolves https://github.com/wso2/product-iots/issues/1611.

Goals

This PR will introduce configuration changes for enabling geo location services. Introduced a separate configuration for publishing the location response and device-info responses into IoT Analytics Server.

Approach

Following configuration is introduced;

    <GeoLocationConfiguration>
        <isEnabled>false</isEnabled>
    </GeoLocationConfiguration>
    <OperationAnalyticsConfiguration>
        <PublishLocationResponse>false</PublishLocationResponse>
        <PublishDeviceInfoResponse>false</PublishDeviceInfoResponse>
        <PublishOperationResponse>
            <isEnabled>false</isEnabled>
            <operations>
                <!-- Publish specific operation responses -->
                <!--
                    <operation>BATTERY_LEVEL</operation>
                    <operation>CHECK_LOCK_STATUS</operation>
                -->
                <!-- use wildcard '*' to publish all responses -->
                <operation>*</operation>
            </operations>
        </PublishOperationResponse>
    </OperationAnalyticsConfiguration>

User stories

N/A

Release note

Isolating Geo Location Enabling Configuration

Documentation

https://docs.wso2.com/display/IOTS320/Monitoring+Devices+Using+Location+Based+Services

Training

N/A

Certification

N/A

Marketing

N/A

Automation tests

Security checks

Samples

N/A

Related PRs

https://github.com/wso2/carbon-device-mgt-plugins/pull/871

Migrations (if applicable)

N/A

Test environment

Maven home: /usr/local/Cellar/maven/3.5.2/libexec Java version: 1.8.0_141, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"

Learning

N/A