diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 467761acd40..75785e8b756 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: maven:latest variables: - MAVEN_CLI_OPTS: "--batch-mode" + MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" cache: @@ -17,4 +17,11 @@ build: test: stage: test script: - - mvn $MAVEN_CLI_OPTS test \ No newline at end of file + - mvn $MAVEN_CLI_OPTS test + +deploy: + stage: deploy + script: + - mvn $MAVEN_CLI_OPTS deploy -Dmaven.test.skip=true + only: + - master diff --git a/.m2/settings.xml b/.m2/settings.xml new file mode 100644 index 00000000000..6dd4400f43c --- /dev/null +++ b/.m2/settings.xml @@ -0,0 +1,12 @@ + + + + maven-snapshots + ${env.MAVEN_REPO_USER} + ${env.MAVEN_REPO_PASS} + + + diff --git a/README.md b/README.md index 3d821b77614..a9d61eaa2a2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # carbon-device-mgt
- - Java8
+ +[![pipeline status](https://gitlab.com/entgra/carbon-device-mgt/badges/master/pipeline.svg)](https://gitlab.com/entgra/carbon-device-mgt/commits/master) WSO2 CONNECTED DEVICE MANAGEMENT COMPONENTS diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index 0fd0804917c..14bb357c4fd 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.annotations - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index b8a95d4d448..f0d6a333e31 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -21,12 +21,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml 4.0.0 - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT org.wso2.carbon.apimgt.application.extension.api war WSO2 Carbon - API Application Management API diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index c6f6ac6df0d..bf4e8c28141 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -22,12 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml 4.0.0 - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT org.wso2.carbon.apimgt.application.extension bundle WSO2 Carbon - API Application Management diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index ac33013a802..7d2cad0a906 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -21,13 +21,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handlers - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT bundle WSO2 Carbon - API Security Handler Component WSO2 Carbon - API Management Security Handler Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index d3f8d3d2aef..4f10905bc2e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT bundle WSO2 Carbon - API Management Integration Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index eb528f56693..17019a7fdce 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.generated.client - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT bundle WSO2 Carbon - API Management Integration Generated Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index 40a49e9b704..d8fd7321d42 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index f5e1623791c..f43c13a9b84 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../../pom.xml 4.0.0 apimgt-extensions - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT pom WSO2 Carbon - API Management Extensions Component http://wso2.org diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index 721d500b624..c69f1c4d682 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index f65f0428f10..b35a3f21221 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml index ea10e11948d..01baa16e1a2 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml @@ -24,7 +24,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index a9679046edd..f79b64055c5 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt certificate-mgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.core - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml index a4205aafd60..05b21e441f3 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml @@ -24,7 +24,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index 5347bdaf42d..7414ce94c9b 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT pom WSO2 Carbon - Certificate Management Component http://wso2.org diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index 3c8242ddf84..f354fdfe76f 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index 4d7c55ff183..ea82cf71761 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml index 2a2022a5b75..070d0272e29 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml index 987e978b6c5..b872de83bf6 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index 8e137e6769a..0474146584b 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index 8856d0b0743..055a45d1530 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index 3557236080a..9baa22ad802 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index f1887215276..4516c1fe8fb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml index 4ca94f1c85f..c7de451372b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml @@ -20,7 +20,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT 4.0.0 diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index 33e23468525..1cf54fe11f1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java index 59e7e2e11b5..26904a9cdff 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java @@ -296,6 +296,67 @@ public interface DeviceEventManagementService { @PathParam("type") String deviceType, @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false) @QueryParam("limit") int limit); + + @GET + @Path("filter/{type}/{parameter}") + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + httpMethod = "GET", + value = "Getting the filtered devices", + notes = "Get the list of devices based on the filter parameter", + tags = "Device Event Management", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view") + }) + } + ) + @ApiResponses( + value = { + @ApiResponse( + code = 200, + message = "OK. \n Successfully fetched the event.", + response = EventRecords.class, + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body"), + @ResponseHeader( + name = "ETag", + description = "Entity Tag of the response resource.\n" + + "Used by caches, or in conditional requests."), + @ResponseHeader( + name = "Last-Modified", + description = + "Date and time the resource was last modified.\n" + + "Used by caches, or in conditional requests."), + } + ), + @ApiResponse( + code = 400, + message = + "Bad Request. \n"), + @ApiResponse( + code = 406, + message = "Not Acceptable.\n The requested media type is not supported"), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while fetching the " + + "list of supported device types.", + response = ErrorResponse.class) + } + ) + Response getFilteredDevices( + @ApiParam(name = "type", value = "name of the device type", required = true) + @PathParam("type") String deviceType, + @ApiParam(name = "type", value = "name of the parameter", required = true) + @PathParam("type") String parameter, + @ApiParam(name = "limit", value = "minimum value the parameter can have", required = false) + @QueryParam("min") double min, + @ApiParam(name = "max", value = "max value the parameter can have", required = false) + @QueryParam("max") double max + ); + @GET @Path("/{type}") diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java index cba8879dcb2..2bbcee2d43a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java @@ -10,8 +10,9 @@ import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; import org.wso2.carbon.analytics.dataservice.commons.SortByField; import org.wso2.carbon.analytics.dataservice.commons.SortType; -import org.wso2.carbon.analytics.stream.persistence.stub - .EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException; +import org.wso2.carbon.analytics.datasource.commons.Record; +import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; +import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException; import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub; import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTable; import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTableRecord; @@ -21,11 +22,11 @@ import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException; -import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.DeviceTypeEvent; -import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventRecords; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Attribute; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AttributeType; +import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.DeviceTypeEvent; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventAttributeList; +import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventRecords; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.TransportType; import org.wso2.carbon.device.mgt.jaxrs.service.api.DeviceEventManagementService; import org.wso2.carbon.device.mgt.jaxrs.util.Constants; @@ -41,7 +42,6 @@ import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto; import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; import javax.validation.Valid; import javax.ws.rs.DELETE; @@ -53,7 +53,11 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; import java.rmi.RemoteException; import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashSet; import java.util.List; +import java.util.Set; + /** * This is used for device type integration with DAS, to create streams and receiver dynamically and a common endpoint @@ -344,6 +348,10 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe String errorMessage = "Invalid values for from/to"; return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); } + if (limit == 0) { + String errorMessage = "Invalid values for offset/limit"; + return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); + } String fromDate = String.valueOf(from); String toDate = String.valueOf(to); String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId @@ -429,6 +437,78 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe } } + + /** + * Returns the filterd device list. Devices are filterd using the paramter given and the timestamp of the record. + * parameter should given as a range. + */ + @GET + @Path("filter/{type}/{parameter}") + @Override + public Response getFilteredDevices(@PathParam("type") String deviceType, @PathParam("parameter") String parameter, + @QueryParam("min") double min, @QueryParam("max") double max) { + String query; + Calendar c = java.util.Calendar.getInstance(); + long currentTimestamp = c.getTimeInMillis(); + long previousTimestamp = currentTimestamp - 300 * 1000; + String fromDate = String.valueOf(previousTimestamp); + String toDate = String.valueOf(currentTimestamp); + if (min != 0 & max != 0) { + query = parameter + " : [" + min + " TO " + max + "]" + + " AND _timestamp : [" + fromDate + " TO " + toDate + "]"; + } else { + String errorMessage = "The of range values need to be given"; + log.error(errorMessage); + return Response.status(Response.Status.BAD_REQUEST).build(); + } + + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); + String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain)); + try { + if (deviceType == null || + !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { + String errorMessage = "Invalid device type"; + log.error(errorMessage); + return Response.status(Response.Status.BAD_REQUEST).build(); + } + + List sortByFields = new ArrayList<>(); + SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC); + sortByFields.add(sortByField); + EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 100); + List filterdEvents = eventRecords.getRecord(); + List uniqueFilterdEvents = new ArrayList(); + Set devices = new HashSet<>(); + + for (int i = 0; i < filterdEvents.size(); i++) { + String deviceid = (String) filterdEvents.get(i).getValue("meta_deviceId"); + if (!devices.contains(deviceid) && DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( + new DeviceIdentifier(deviceid, deviceType))) { + devices.add(deviceid); + uniqueFilterdEvents.add(filterdEvents.get(i)); + } + } + + EventRecords filterdRecords = new EventRecords(); + filterdRecords.setList(uniqueFilterdEvents); + return Response.status(Response.Status.OK.getStatusCode()).entity(filterdRecords).build(); + + } catch (AnalyticsException e) { + String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; + log.error(errorMsg); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); + } catch (DeviceManagementException e) { + String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; + log.error(errorMsg); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); + } catch (DeviceAccessAuthorizationException e) { + String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; + log.error(errorMsg); + return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); + } + } + + private void publishEventReceivers(String streamNameWithVersion, TransportType transportType , String requestedTenantDomain, String deviceType) throws RemoteException, UserStoreException, JWTClientException { @@ -590,6 +670,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe return deviceType.replace(" ", "_").trim() + "-" + tenantDomain + "-" + transportType.toString() + "-receiver"; } + private void cleanup(Stub stub) { if (stub != null) { try { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index 81442311420..410c859a917 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -21,7 +21,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java index 567cc1a1d68..d85108e9600 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java @@ -22,8 +22,6 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationResult; -import org.wso2.carbon.device.mgt.common.policy.mgt.Policy; - import org.wso2.carbon.device.mgt.common.push.notification.NotificationStrategy; import java.util.List; @@ -46,10 +44,6 @@ public interface OperationManager { Activity addOperation(Operation operation, List devices) throws OperationManagementException, InvalidDeviceException; - - void addOperationsForPolicyRevoke(Policy policy, List devices) throws OperationManagementException, - InvalidDeviceException; - /** * Method to retrieve the list of all operations to a device. * @@ -120,4 +114,4 @@ public interface OperationManager { */ NotificationStrategy getNotificationStrategy(); -} +} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index dcf9411e2b3..5fa19ebc414 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 88d5e291f3d..0e5306f6c24 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -38,8 +38,6 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.ActivityStatus; 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.common.operation.mgt.OperationManager; -import org.wso2.carbon.device.mgt.common.policy.mgt.Policy; -import org.wso2.carbon.device.mgt.common.policy.mgt.ProfileFeature; import org.wso2.carbon.device.mgt.common.push.notification.NotificationContext; import org.wso2.carbon.device.mgt.common.push.notification.NotificationStrategy; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; @@ -59,14 +57,20 @@ import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOF import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationMappingDAO; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.util.OperationDAOUtil; import org.wso2.carbon.device.mgt.core.operation.mgt.util.DeviceIDHolder; -import org.wso2.carbon.device.mgt.core.operation.mgt.util.OperationCreateTimeComparator; +import org.wso2.carbon.device.mgt.core.operation.mgt.util.OperationIdComparator; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.task.DeviceTaskManager; import org.wso2.carbon.device.mgt.core.task.impl.DeviceTaskManagerImpl; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import java.sql.SQLException; -import java.util.*; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * This class implements all the functionality exposed as part of the OperationManager. Any transaction initiated @@ -279,160 +283,6 @@ public class OperationManagerImpl implements OperationManager { } } - private Operation getPolicyRevokeOperation() { - CommandOperation policyRevokeOperation = new CommandOperation(); - policyRevokeOperation.setEnabled(true); - policyRevokeOperation.setCode(OperationMgtConstants.OperationCodes.POLICY_REVOKE); - policyRevokeOperation.setType(Operation.Type.COMMAND); - return policyRevokeOperation; - } - private Operation transformPolicy(Policy policy) { - List effectiveFeatures = policy.getProfile().getProfileFeaturesList(); - List profileOperationList = new ArrayList(); - PolicyOperation policyOperation = new PolicyOperation(); - policyOperation.setEnabled(true); - policyOperation.setType(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.POLICY); - policyOperation.setCode(PolicyOperation.POLICY_OPERATION_CODE); - for (ProfileFeature feature : effectiveFeatures) { - ProfileOperation profileOperation = new ProfileOperation(); - profileOperation.setCode(feature.getFeatureCode()); - profileOperation.setEnabled(true); - profileOperation.setStatus(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Status.PENDING); - profileOperation.setType(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.PROFILE); - profileOperation.setPayLoad(feature.getContent()); - profileOperationList.add(profileOperation); - } - policyOperation.setProfileOperations(profileOperationList); - policyOperation.setPayLoad(policyOperation.getProfileOperations()); - return policyOperation; - } - @Override - public void addOperationsForPolicyRevoke(Policy policy, List deviceIds) - throws OperationManagementException, InvalidDeviceException { - Operation revokeOperation = getPolicyRevokeOperation(); - Operation operation = transformPolicy(policy); - if (log.isDebugEnabled()) { - log.debug("operation:[" + operation.toString() + "]"); - for (DeviceIdentifier deviceIdentifier : deviceIds) { - log.debug("device identifier id:[" + deviceIdentifier.getId() + "] type:[" + - deviceIdentifier.getType() + "]"); - } - } - try { - DeviceIDHolder deviceValidationResult = DeviceManagerUtil.validateDeviceIdentifiers(deviceIds); - List validDeviceIds = deviceValidationResult.getValidDeviceIDList(); - if (validDeviceIds.size() > 0) { - DeviceIDHolder deviceAuthorizationResult = this.authorizeDevices(operation, validDeviceIds); - List authorizedDeviceList = deviceAuthorizationResult.getValidDeviceIDList(); - OperationManagementDAOFactory.beginTransaction(); - org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation policyOperationDto = - OperationDAOUtil.convertOperation(operation); - org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation revokeOperationDto = - OperationDAOUtil.convertOperation(revokeOperation); - boolean isScheduledOperation = this.isTaskScheduledOperation(operation); - boolean isNotRepeated = false; - boolean isScheduled = false; - NotificationStrategy notificationStrategy = getNotificationStrategy(); - // check whether device list is greater than batch size notification strategy has enable to send push - // notification using scheduler task - if (DeviceConfigurationManager.getInstance().getDeviceManagementConfig(). - getPushNotificationConfiguration().getSchedulerBatchSize() <= authorizedDeviceList.size() && - notificationStrategy != null) { - isScheduled = notificationStrategy.getConfig().isScheduled(); - } - List operationList = new LinkedList(); - operationList.add(revokeOperationDto); - operationList.add(policyOperationDto); - List operationIds = this.lookupOperationDAO(operation).addOperations(operationList); - List devices = new ArrayList<>(); - if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Control.NO_REPEAT == policyOperationDto. - getControl()) { - isNotRepeated = true; - } - //Need to happen for both revoke and new policy operation - addOperationMappings(authorizedDeviceList, revokeOperationDto, operationIds.get(0), isScheduledOperation, - isNotRepeated, isScheduled, devices); - sendPushNotifications(revokeOperation, operationIds.get(0), isScheduled, notificationStrategy, devices); - //Need to happen for both revoke and new policy operation - addOperationMappings(authorizedDeviceList, policyOperationDto, operationIds.get(1), isScheduledOperation, - isNotRepeated, isScheduled, devices); - sendPushNotifications(operation, operationIds.get(1), isScheduled, notificationStrategy, devices); - OperationManagementDAOFactory.commitTransaction(); - } else { - throw new InvalidDeviceException("Invalid device Identifiers found."); - } - } catch (OperationManagementDAOException e) { - OperationManagementDAOFactory.rollbackTransaction(); - throw new OperationManagementException("Error occurred while adding operation", e); - } catch (TransactionManagementException e) { - throw new OperationManagementException("Error occurred while initiating the transaction", e); - } finally { - OperationManagementDAOFactory.closeConnection(); - } - } - private String addOperationMappings(List authorizedDeviceList, org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation operationDto, int operationId, boolean isScheduledOperation, boolean isNotRepeated, boolean isScheduled, List devices) throws OperationManagementException, OperationManagementDAOException { - int enrolmentId; - int existingTaskOperationId;//TODO have to create a sql to load device details from deviceDAO using single query. - String operationCode = operationDto.getCode(); - for (DeviceIdentifier deviceId : authorizedDeviceList) { - Device device = getDevice(deviceId); - devices.add(device); - enrolmentId = device.getEnrolmentInfo().getId(); - //Do not repeat the task operations - if (isScheduledOperation) { - existingTaskOperationId = operationDAO.getExistingOperationID(enrolmentId, operationCode); - if (existingTaskOperationId != -1) { - operationMappingDAO.addOperationMapping(operationId, enrolmentId, isScheduled); - } - } else if (isNotRepeated) { - operationDAO.updateEnrollmentOperationsStatus(enrolmentId, operationCode, - org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Status.PENDING, - org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Status.REPEATED); - operationMappingDAO.addOperationMapping(operationId, enrolmentId, isScheduled); - } else { - operationMappingDAO.addOperationMapping(operationId, enrolmentId, isScheduled); - } - } - return operationCode; - } - /* - * If notification strategy has not enable to send push notification using scheduler task we will send - * notification immediately. This is done in separate loop inorder to prevent overlap with DB insert - * operations with the possible db update operations trigger followed by pending operation call. - * Otherwise device may call pending operation while DB is locked for write and deadlock can occur. - */ - private void sendPushNotifications(Operation operation, int operationId, boolean isScheduled, NotificationStrategy notificationStrategy, List devices) { - int enrolmentId; - if (notificationStrategy != null && !isScheduled) { - for (Device device : devices) { - DeviceIdentifier deviceId = new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()); - if (log.isDebugEnabled()) { - log.debug("Sending push notification to " + deviceId + " from add operation method."); - } - operation.setId(operationId); - operation.setActivityId(DeviceManagementConstants.OperationAttributes.ACTIVITY + operationId); - try { - notificationStrategy.execute(new NotificationContext(deviceId, operation)); - } catch (PushNotificationExecutionFailedException e) { - log.error("Error occurred while sending push notifications to " + deviceId.getType() + - " device carrying id '" + deviceId + "'", e); - /* - Reschedule if push notification failed. Doing db transactions in atomic way to prevent - deadlocks. - */ - enrolmentId = device.getEnrolmentInfo().getId(); - try { - operationMappingDAO.updateOperationMapping(operationId, enrolmentId, org.wso2.carbon - .device.mgt.core.dto.operation.mgt.Operation.PushNotificationStatus.SCHEDULED); - } catch (OperationManagementDAOException ex) { - // Not throwing this exception in order to keep sending remaining notifications if any. - log.error("Error occurred while setting push notification status to SCHEDULED.", ex); - } - } - } - } - } - private void sendNotification(Operation operation, Device device) { NotificationStrategy notificationStrategy = getNotificationStrategy(); /* @@ -671,7 +521,7 @@ public class OperationManagerImpl implements OperationManager { operation = OperationDAOUtil.convertOperation(dtoOperation); operations.add(operation); } - Collections.sort(operations, new OperationCreateTimeComparator()); + Collections.sort(operations, new OperationIdComparator()); } catch (OperationManagementDAOException e) { throw new OperationManagementException("Error occurred while retrieving the list of " + "pending operations assigned for '" + deviceId.getType() + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java index a40c0c5e8f4..67dcd517c2e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java @@ -30,8 +30,6 @@ public interface OperationDAO { int addOperation(Operation operation) throws OperationManagementDAOException; - List addOperations(List operations) throws OperationManagementDAOException; - Operation getOperation(int operationId) throws OperationManagementDAOException; Operation getOperationByDeviceAndId(int enrolmentId, int operationId) throws OperationManagementDAOException; @@ -90,4 +88,4 @@ public interface OperationDAO { Map> getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushNotificationStatus pushNotificationStatus, int limit) throws OperationManagementDAOException; -} +} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index 3ea9ba1f5e5..900c41cf964 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -86,37 +86,6 @@ public class GenericOperationDAOImpl implements OperationDAO { } } - //This implementation has been done this way due to H2 not supporting batch inserts properly. - //Even though records are added in batch mode, only the id of the last added record will be returned, which is a problem. - public List addOperations(List operations) throws OperationManagementDAOException { - List ids = new LinkedList(); - for (Operation operation : operations) { - PreparedStatement stmt = null; - ResultSet rs = null; - try { - Connection connection = OperationManagementDAOFactory.getConnection(); - String sql = "INSERT INTO DM_OPERATION(TYPE, CREATED_TIMESTAMP, RECEIVED_TIMESTAMP, OPERATION_CODE) " + - "VALUES (?, ?, ?, ?)"; - stmt = connection.prepareStatement(sql, new String[]{"id"}); - stmt.setString(1, operation.getType().toString()); - stmt.setTimestamp(2, new Timestamp(new Date().getTime())); - stmt.setTimestamp(3, null); - stmt.setString(4, operation.getCode()); - stmt.executeUpdate(); - rs = stmt.getGeneratedKeys(); - int id = -1; - if (rs.next()) { - ids.add(rs.getInt(1)); - } - } catch (SQLException e) { - throw new OperationManagementDAOException("Error occurred while adding operation metadata", e); - } finally { - OperationManagementDAOUtil.cleanupResources(stmt, rs); - } - } - return ids; - } - public boolean updateOperationStatus(int enrolmentId, int operationId, Operation.Status status) throws OperationManagementDAOException { PreparedStatement stmt = null; @@ -1303,7 +1272,8 @@ public class GenericOperationDAOImpl implements OperationDAO { String sql = "SELECT o.ID, TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, " + "OPERATION_CODE, om.STATUS, om.ID AS OM_MAPPING_ID, om.UPDATED_TIMESTAMP FROM DM_OPERATION o " + "INNER JOIN (SELECT * FROM DM_ENROLMENT_OP_MAPPING dm " + - "WHERE dm.ENROLMENT_ID = ?) om ON o.ID = om.OPERATION_ID ORDER BY o.CREATED_TIMESTAMP DESC"; + "WHERE dm.ENROLMENT_ID = ?) om ON o.ID = om.OPERATION_ID " + + "ORDER BY o.CREATED_TIMESTAMP DESC, o.ID DESC"; stmt = conn.prepareStatement(sql); stmt.setInt(1, enrolmentId); rs = stmt.executeQuery(); @@ -1344,7 +1314,8 @@ public class GenericOperationDAOImpl implements OperationDAO { String sql = "SELECT o.ID, TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, " + "OPERATION_CODE, om.STATUS, om.ID AS OM_MAPPING_ID, om.UPDATED_TIMESTAMP FROM DM_OPERATION o " + "INNER JOIN (SELECT * FROM DM_ENROLMENT_OP_MAPPING dm " + - "WHERE dm.ENROLMENT_ID = ?) om ON o.ID = om.OPERATION_ID ORDER BY o.CREATED_TIMESTAMP DESC LIMIT ?,?"; + "WHERE dm.ENROLMENT_ID = ?) om ON o.ID = om.OPERATION_ID " + + "ORDER BY o.CREATED_TIMESTAMP DESC, o.ID DESC LIMIT ?,?"; stmt = conn.prepareStatement(sql); stmt.setInt(1, enrolmentId); stmt.setInt(2, request.getStartIndex()); @@ -1410,7 +1381,7 @@ public class GenericOperationDAOImpl implements OperationDAO { "OPERATION_CODE, om.ID AS OM_MAPPING_ID, om.UPDATED_TIMESTAMP FROM DM_OPERATION o " + "INNER JOIN (SELECT * FROM DM_ENROLMENT_OP_MAPPING dm " + "WHERE dm.ENROLMENT_ID = ? AND dm.STATUS = ?) om ON o.ID = om.OPERATION_ID " + - "ORDER BY om.UPDATED_TIMESTAMP ASC LIMIT 1"); + "ORDER BY om.UPDATED_TIMESTAMP ASC, om.ID ASC LIMIT 1"); stmt.setInt(1, enrolmentId); stmt.setString(2, Operation.Status.PENDING.toString()); rs = stmt.executeQuery(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java index 15bf7cbe65d..7f142b7d04c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java @@ -20,7 +20,6 @@ package org.wso2.carbon.device.mgt.core.operation.mgt.dao.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.core.dto.operation.mgt.CommandOperation; import org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation; import org.wso2.carbon.device.mgt.core.dto.operation.mgt.PolicyOperation; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; @@ -47,6 +46,7 @@ public class PolicyOperationDAOImpl extends GenericOperationDAOImpl { operation.setCreatedTimeStamp(new Timestamp(new java.util.Date().getTime()).toString()); operation.setId(operationId); operation.setEnabled(true); + PolicyOperation policyOperation = (PolicyOperation) operation; Connection conn = OperationManagementDAOFactory.getConnection(); stmt = conn.prepareStatement("INSERT INTO DM_POLICY_OPERATION(OPERATION_ID, OPERATION_DETAILS) " + "VALUES(?, ?)"); @@ -82,79 +82,6 @@ public class PolicyOperationDAOImpl extends GenericOperationDAOImpl { return operationId; } - - private int addCommandOperation(int operationId, Operation operation) throws OperationManagementDAOException { - CommandOperation commandOp = (CommandOperation) operation; - PreparedStatement stmt = null; - try { - Connection conn = OperationManagementDAOFactory.getConnection(); - stmt = conn.prepareStatement("INSERT INTO DM_COMMAND_OPERATION(OPERATION_ID, ENABLED) VALUES(?, ?)"); - stmt.setInt(1, operationId); - stmt.setBoolean(2, commandOp.isEnabled()); - stmt.executeUpdate(); - } catch (SQLException e) { - throw new OperationManagementDAOException("Error occurred while adding command operation", e); - } finally { - OperationManagementDAOUtil.cleanupResources(stmt); - } - return operationId; - } - @Override - public List addOperations(List operations) throws OperationManagementDAOException { - List operationIds; - int counter = 0; - operationIds = super.addOperations(operations); - for(Operation operation : operations) { - if(operation.getType().equals(Operation.Type.COMMAND)){ - addCommandOperation(operationIds.get(counter), operation); - } else if(operation.getType().equals(Operation.Type.POLICY)){ - addPolicyOperation(operationIds.get(counter), operation); - } - counter++; - } - return operationIds; - } - private void addPolicyOperation(int operationId, Operation operation) throws OperationManagementDAOException { - PreparedStatement stmt = null; - ByteArrayOutputStream bao = null; - ObjectOutputStream oos = null; - try { - operation.setCreatedTimeStamp(new Timestamp(new java.util.Date().getTime()).toString()); - operation.setId(operationId); - operation.setEnabled(true); - Connection conn = OperationManagementDAOFactory.getConnection(); - stmt = conn.prepareStatement("INSERT INTO DM_POLICY_OPERATION(OPERATION_ID, OPERATION_DETAILS) " + - "VALUES(?, ?)"); - bao = new ByteArrayOutputStream(); - oos = new ObjectOutputStream(bao); - oos.writeObject(operation); - stmt.setInt(1, operationId); - stmt.setBytes(2, bao.toByteArray()); - stmt.executeUpdate(); - } catch (SQLException e) { - throw new OperationManagementDAOException("Error occurred while adding policy operation", e); - } catch (IOException e) { - throw new OperationManagementDAOException("Error occurred while serializing policy operation object", e); - } finally { - if (bao != null) { - try { - bao.close(); - } catch (IOException e) { - log.warn("Error occurred while closing ByteArrayOutputStream", e); - } - } - if (oos != null) { - try { - oos.close(); - } catch (IOException e) { - log.warn("Error occurred while closing ObjectOutputStream", e); - } - } - OperationManagementDAOUtil.cleanupResources(stmt); - } - } - - @Override public Operation getOperation(int operationId) throws OperationManagementDAOException { PreparedStatement stmt = null; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/util/OperationCreateTimeComparator.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/util/OperationIdComparator.java similarity index 74% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/util/OperationCreateTimeComparator.java rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/util/OperationIdComparator.java index 5f7e1a9eac7..bbb565c3efb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/util/OperationCreateTimeComparator.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/util/OperationIdComparator.java @@ -23,13 +23,11 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import java.io.Serializable; import java.util.Comparator; -public class OperationCreateTimeComparator implements Comparator, Serializable { +public class OperationIdComparator implements Comparator, Serializable { @Override public int compare(Operation o1, Operation o2) { - long createdTime1 = java.sql.Timestamp.valueOf(o1.getCreatedTimeStamp()).getTime(); - long createdTime2 = java.sql.Timestamp.valueOf(o1.getCreatedTimeStamp()).getTime(); - return (int) (createdTime1 - createdTime2); + return o1.getId() - o2.getId(); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java index 4c27f08efd1..c30967c87d3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java @@ -33,7 +33,6 @@ import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; 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.common.policy.mgt.Policy; import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager; import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationExecutionFailedException; import org.wso2.carbon.device.mgt.common.push.notification.NotificationStrategy; @@ -543,10 +542,6 @@ public interface DeviceManagementProviderService { Activity addOperation(String type, Operation operation, List devices) throws OperationManagementException, InvalidDeviceException; - void addPolicyOperations(String type, Policy policy, - List devices) throws OperationManagementException, InvalidDeviceException; - - List getOperations(DeviceIdentifier deviceId) throws OperationManagementException; PaginationResult getOperations(DeviceIdentifier deviceId, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index d5170a620d2..f1a59cf9b05 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -58,7 +58,6 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; 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.common.operation.mgt.OperationManager; -import org.wso2.carbon.device.mgt.common.policy.mgt.Policy; import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager; import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationExecutionFailedException; import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationSubscriber; @@ -1431,12 +1430,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv return pluginRepository.getOperationManager(type, this.getTenantId()).addOperation(operation, devices); } - @Override - public void addPolicyOperations(String type, Policy policy, - List devices) throws OperationManagementException, InvalidDeviceException { - pluginRepository.getOperationManager(type, this.getTenantId()).addOperationsForPolicyRevoke(policy, devices); - } - @Override public List getOperations(DeviceIdentifier deviceId) throws OperationManagementException { return pluginRepository.getOperationManager(deviceId.getType(), this.getTenantId()).getOperations(deviceId); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index 5c4ffa80abd..befaefecd64 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index 8aec5fcc0da..713807945af 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.1.40-SNAPSHOT + 3.2.1-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json index 65d3f51ceb1..6367533b959 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json @@ -1,5 +1,5 @@ { - "appName": "WSO2 IoT Server", + "appName": "Entgra IoT Server", "cachingEnabled": false, "debuggingEnabled": false, "permissionRoot": "/", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index 406dde9f3a0..3b4f031c6d5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -57,11 +57,11 @@ }, "generalConfig": { "host": "https://%iot.manager.host%:%iot.manager.https.port%", - "companyName": "WSO2 Carbon Device Manager", - "browserTitle": "WSO2 Device Manager", + "companyName": "Entgra Carbon Device Manager", + "browserTitle": "Entgra Device Manager", "copyrightPrefix": "\u00A9 %date-year%, ", - "copyrightOwner": "WSO2 Inc.", - "copyrightOwnersSite": "http://www.wso2.org", + "copyrightOwner": "Entgra", + "copyrightOwnersSite": "https://www.entgra.io/", "copyrightSuffix": " All Rights Reserved." }, "scopes": [ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.hbs index abaf293f3ca..67f867622b7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.hbs @@ -25,15 +25,15 @@

COOKIE POLICY

-

About WSO2 IoT Server

-

WSO2 IoT Server 3.3.0 is a complete solution that enables device manufacturers and enterprises to +

About Entgra IoT Server

+

Entgra IoT Server 3.4.0 is a complete solution that enables device manufacturers and enterprises to connect and manage their devices, build apps, manage events, secure devices and data, and visualize sensor data in a scalable manner.

It also offers a complete and secure Enterprise Mobility Management (EMM/MDM) solution that aims to address mobile computing challenges faced by enterprises today. Supporting iOS, Android, and Windows devices, it helps organizations deal with both Corporate Owned, Personally Enabled (COPE) and employee-owned devices with the Bring Your Own Device (BYOD) concept.

-

WSO2 IoT Server 3.3.0 comes with advanced analytics, enabling users to analyze speed, proximity, and +

Entgra IoT Server 3.4.0 comes with advanced analytics, enabling users to analyze speed, proximity, and geo-fencing information of devices including details of those in motion and stationary state.

Cookie Policy

@@ -45,67 +45,67 @@ apps remember things about you. Other technologies, including Web storage and identifiers associated with your device, may be used for similar purposes. In this policy, we use the term “cookies” to discuss all of these technologies.

-

How does WSO2 IoT Server 3.3.0 process cookies?

-

WSO2 IoT Server 3.3.0 uses cookies to store and retrieve information on your browser. This +

How does Entgra IoT Server 3.4.0 process cookies?

+

Entgra IoT Server 3.4.0 uses cookies to store and retrieve information on your browser. This information is used to provide a better user experience. Some cookies serve the purpose of allowing a user to log in to the system, maintain sessions, and keep track of activities within the login session.

-

Some cookies in WSO2 IoT Server 3.3.0 are used to personally identify you. However, the cookie +

Some cookies in Entgra IoT Server 3.4.0 are used to personally identify you. However, the cookie lifetime ends once your session ends, i.e., after you log-out, or after the session expiry time has elapsed.

Some cookies are simply used to give you a more personalised web experience, and these cannot be used to identify you or your activities personally.

This Cookie Policy is part of the IoT Server Privacy Policy.

-

What does WSO2 IoT Server 3.0.0 use cookies for?

-

Cookies are used for two purposes in WSO2 IoT Server 3.3.0.

+

What does Entgra IoT Server 3.0.0 use cookies for?

+

Cookies are used for two purposes in Entgra IoT Server 3.4.0.

  1. To identify you and provide security
  2. To provide a satisfying user experience.

Preferences

-

WSO2 IoT Server 3.3.0 uses cookies to remember your settings and preferences and to auto-fill the +

Entgra IoT Server 3.4.0 uses cookies to remember your settings and preferences and to auto-fill the fields to make your interactions with the site easier.

These cookies can not be used to personally identify you.

Security

    -
  1. WSO2 IoT Server 3.3.0 uses selected cookies to identify and prevent security risks. For example, - WSO2 IoT Server 3.3.0 may use cookies to store your session information to prevent others from +
  2. Entgra IoT Server 3.4.0 uses selected cookies to identify and prevent security risks. For example, + Entgra IoT Server 3.4.0 may use cookies to store your session information to prevent others from changing your password without your username and password.
  3. -
  4. WSO2 IoT Server 3.3.0 uses session cookie to maintain your active session.
  5. -
  6. WSO2 IoT Server 3.3.0 may use a temporary cookie when performing multi-factor authentication and +
  7. Entgra IoT Server 3.4.0 uses session cookie to maintain your active session.
  8. +
  9. Entgra IoT Server 3.4.0 may use a temporary cookie when performing multi-factor authentication and federated authentication.
  10. -
  11. WSO2 IoT Server 3.3.0 may use permanent cookies to detect the devices you have logged in +
  12. Entgra IoT Server 3.4.0 may use permanent cookies to detect the devices you have logged in previously. This is to to calculate the risk level associated with your current login attempt. Using these cookies protects you and your account from possible attacks.

Performance

-

WSO2 IoT Server 3.3.0 may use cookies to allow Remember Me functionalities.

+

Entgra IoT Server 3.4.0 may use cookies to allow Remember Me functionalities.

Analytics

-

WSO2 IoT Server 3.3.0 as a product does not use cookies for analytical purposes.

+

Entgra IoT Server 3.4.0 as a product does not use cookies for analytical purposes.

Third party cookies

-

Using WSO2 IoT Server 3.3.0 may cause third-party cookie to be set in your browser. WSO2 IoT Server - 3.3.0 has no control over how any of them operate. The third-party cookies that maybe set +

Using Entgra IoT Server 3.4.0 may cause third-party cookie to be set in your browser. Entgra IoT Server + 3.4.0 has no control over how any of them operate. The third-party cookies that maybe set include:

    -
  1. Any social login sites. For example, third-party cookies may be set when WSO2 IoT Server 3.3.0 +
  2. Any social login sites. For example, third-party cookies may be set when Entgra IoT Server 3.4.0 is configured to use “social” or “federated” login, and you opt to login with your “Social Account”.
  3. Any third party federated login.
-

WSO2 strongly advises you to refer the respective cookie policies of such sites carefully as WSO2 has +

Entgra strongly advises you to refer the respective cookie policies of such sites carefully as Entgra has no knowledge or use on these cookies.

-

What type of cookies does WSO2 IoT Server 3.3.0 use?

-

WSO2 IoT Server 3.3.0 uses persistent cookies and session cookies. A persistent cookie helps WSO2 IS - 3.3.0 to recognize you as an existing user so that it is easier to return to WSO2 or interact with - WSO2 IS 3.3.0 without signing in again. After you sign in, a persistent cookie stays in your browser - and will be read by WSO2 IoT Server 3.3.0 when you return to WSO2 IoT Server 3.3.0.

+

What type of cookies does Entgra IoT Server 3.4.0 use?

+

Entgra IoT Server 3.4.0 uses persistent cookies and session cookies. A persistent cookie helps Entgra IS + 3.4.0 to recognize you as an existing user so that it is easier to return to Entgra or interact with + Entgra IS 3.4.0 without signing in again. After you sign in, a persistent cookie stays in your browser + and will be read by Entgra IoT Server 3.4.0 when you return to Entgra IoT Server 3.4.0.

A session cookie is a cookie that is erased when the user closes the Web browser. The session cookie is stored in temporarily and is not retained after the browser is closed. Session cookies do not collect information from the user’s computer.

@@ -114,9 +114,9 @@ for websites to set cookies, you may worsen your overall user experience since it will no longer be personalized to you. It may also stop you from saving customized settings like login information. Most likely, disabling cookies will make it unable for you to use authentication and authorization - functionalities offered by WSO2 IoT Server 3.3.0.

+ functionalities offered by Entgra IoT Server 3.4.0.

If you have any questions or concerns regarding the use of cookies, please contact the entity or - individuals (or their data protection officer, if applicable) running this WSO2 IoT Server 3.3.0 + individuals (or their data protection officer, if applicable) running this Entgra IoT Server 3.4.0 instance.

What are the cookies used?

@@ -150,17 +150,17 @@

Disclaimer

-

This cookie policy is only for illustrative purposes of the product WSO2 IoT Server 3.3.0. The +

This cookie policy is only for illustrative purposes of the product Entgra IoT Server 3.4.0. The content in the policy is technically correct at the time of the product shipment. The - entity,organization or individual that runs this WSO2 IoT Server 3.3.0 instance has full authority - and responsibility with regard to the effective Cookie Policy. WSO2, its employees, partners, and + entity,organization or individual that runs this Entgra IoT Server 3.4.0 instance has full authority + and responsibility with regard to the effective Cookie Policy. Entgra, its employees, partners, and affiliates do not have access to and do not require, store, process or control any of the data, - including personal data contained in WSO2 IoT Server 3.3.0. All data, including personal data is - controlled and processed by the entity, organization or individual running WSO2 IoT Server 3.3.0. - WSO2, its employees partners and affiliates are not a data processor or a data controller within the - meaning of any data privacy regulations. WSO2 does not provide any warranties or undertake any + including personal data contained in Entgra IoT Server 3.4.0. All data, including personal data is + controlled and processed by the entity, organization or individual running Entgra IoT Server 3.4.0. + Entgra, its employees partners and affiliates are not a data processor or a data controller within the + meaning of any data privacy regulations. Entgra does not provide any warranties or undertake any responsibility or liability in connection with the lawfulness or the manner and purposes for which - WSO2 IoT Server 3.3.0 is used by such entities, organizations or persons.

+ Entgra IoT Server 3.4.0 is used by such entities, organizations or persons.

diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.privacy-policy/privacy-policy.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.privacy-policy/privacy-policy.hbs index bb65e7be653..b2f67283ee5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.privacy-policy/privacy-policy.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.privacy-policy/privacy-policy.hbs @@ -25,29 +25,29 @@

PRIVACY POLICY

-

About WSO2 IoT Server

-

WSO2 IoT Server is a complete solution that enables device manufacturers and enterprises to connect +

About Entgra IoT Server

+

Entgra IoT Server is a complete solution that enables device manufacturers and enterprises to connect and manage their devices, build apps, manage events, secure devices and data, and visualize sensor data in a scalable manner.

It also offers a complete and secure Enterprise Mobility Management (EMM/MDM) solution that aims to address mobile computing challenges faced by enterprises today. Supporting iOS, Android, and Windows devices, it helps organizations deal with both Corporate Owned, Personally Enabled (COPE) and employee-owned devices with the Bring Your Own Device (BYOD) concept.

-

WSO2 IoT Server comes with advanced analytics, enabling users to analyze speed, proximity, and +

Entgra IoT Server comes with advanced analytics, enabling users to analyze speed, proximity, and geo-fencing information of devices including details of those in motion and stationary state.

Privacy Policy

-

This policy describes how WSO2 IoT Server 3.3.0 captures your personal information, the purposes of +

This policy describes how Entgra IoT Server 3.4.0 captures your personal information, the purposes of collection, and information about the retention of your personal information.

Please note that this policy is for reference only, and is applicable for the software as a product. - WSO2 Inc. and its developers have no access to the information held within WSO2 IoT Server - 3.3.0.Please see the Disclaimer section for more information. Entities, organisations or individuals - controlling the use and administration of WSO2 IoT Server 3.3.0 should create their own privacy + Entgra and its developers have no access to the information held within Entgra IoT Server + 3.4.0.Please see the Disclaimer section for more information. Entities, organisations or individuals + controlling the use and administration of Entgra IoT Server 3.4.0 should create their own privacy policies setting out the manner in which data is controlled or processed by the respective entity, organisation or individual.

What is personal information?

-

WSO2 IoT Server 3.3.0 considers anything related to you and by which you may be identified as your +

Entgra IoT Server 3.4.0 considers anything related to you and by which you may be identified as your personal information.

-

Signing in to WSO2 IoT Server 3.3.0

+

Signing in to Entgra IoT Server 3.4.0

  1. Your user name (except in cases where the user name created by your employer is under contract) @@ -55,7 +55,7 @@
  2. IP address used to log in
  3. Email address
-

Enrolling a device with WSO2 IoT Server 3.3.0

+

Enrolling a device with Entgra IoT Server 3.4.0

  • Your device ID (e.g., phone or tablet), mobile number, IMEI number, and IMSI number
  • Your device’s location
  • @@ -64,7 +64,7 @@ memory usage
-

However, WSO2 IoT Server 3.3.0 also collects the following information that is not considered +

However, Entgra IoT Server 3.4.0 also collects the following information that is not considered personal information, but is used only for statistical purposes. The reason for this is that this information can not be used to track you.

    @@ -74,17 +74,17 @@
  • Operating system and generic browser information

Collection of personal information

-

WSO2 IoT Server 3.3.0 collects your information only to serve your access requirements. For example: +

Entgra IoT Server 3.4.0 collects your information only to serve your access requirements. For example:

    -
  • WSO2 IoT Server 3.3.0 uses your IP address to detect any suspicious login attempts to your +
  • Entgra IoT Server 3.4.0 uses your IP address to detect any suspicious login attempts to your account. -
  • WSO2 IoT Server 3.3.0 uses attributes like your first name, last name, etc., to provide a rich +
  • Entgra IoT Server 3.4.0 uses attributes like your first name, last name, etc., to provide a rich and personalized user experience. -
  • WSO2 IoT Server 3.3.0 uses your security questions and answers only to allow account recovery. +
  • Entgra IoT Server 3.4.0 uses your security questions and answers only to allow account recovery.

Tracking Technologies

-

WSO2 IoT Server 3.3.0 collects your information by:

+

Entgra IoT Server 3.4.0 collects your information by:

  • Collecting information from the user profile page where you enter your personal data.
  • Tracking your IP address with HTTP request, HTTP headers, and TCP/IP.
  • @@ -95,15 +95,15 @@

Use of personal information

-

WSO2 IoT Server 3.3.0 will only use your personal information for the purposes for which it was +

Entgra IoT Server 3.4.0 will only use your personal information for the purposes for which it was collected (or for a use identified as consistent with that purpose).

-

WSO2 IoT Server 3.3.0 uses your personal information only for the following purposes.

+

Entgra IoT Server 3.4.0 uses your personal information only for the following purposes.

    -
  • To provide you with a personalized user experience. WSO2 IoT Server 3.3.0 uses your name and +
  • To provide you with a personalized user experience. Entgra IoT Server 3.4.0 uses your name and uploaded profile pictures for this purpose.
  • -
  • To protect your account from unauthorized access or potential hacking attempts. WSO2 IoT Server - 3.3.0 uses HTTP or TCP/IP Headers for this purpose. +
  • To protect your account from unauthorized access or potential hacking attempts. Entgra IoT Server + 3.4.0 uses HTTP or TCP/IP Headers for this purpose.
  • This includes:

    @@ -113,11 +113,11 @@
  • Cookies
  • -
  • Derive statistical data for analytical purposes on system performance improvements. WSO2 IoT - Server 3.3.0 will not keep any personal information after statistical calculations. Therefore, +
  • Derive statistical data for analytical purposes on system performance improvements. Entgra IoT + Server 3.4.0 will not keep any personal information after statistical calculations. Therefore, the statistical report has no means of identifying an individual person.
  • -
  • WSO2 IoT Server 3.3.0 may use:
  • +
  • Entgra IoT Server 3.4.0 may use:
    1. IP Address to derive geographic information
    2. @@ -126,28 +126,28 @@

Disclosure of personal information

-

WSO2 IoT Server 3.3.0 only discloses personal information to the relevant applications (also known as - “Service Providers”) that are registered with WSO2 IoT Server 3.3.0. These applications are +

Entgra IoT Server 3.4.0 only discloses personal information to the relevant applications (also known as + “Service Providers”) that are registered with Entgra IoT Server 3.4.0. These applications are registered by the identity administrator of your entity or organization. Personal information is disclosed only for the purposes for which it was collected (or for a use identified as consistent with that purpose) as controlled by such Service Providers, unless you have consented otherwise or where it is required by law.

Legal process

-

Please note that the organisation, entity or individual running WSO2 IoT Server 3.3.0 may be +

Please note that the organisation, entity or individual running Entgra IoT Server 3.4.0 may be compelled to disclose your personal information with or without your consent when it is required by law following due and lawful process.

Storage of personal information

Where your personal information is stored

-

WSO2 IoT Server 3.3.0 stores your personal information in secured databases. WSO2 IoT Server 3.3.0 +

Entgra IoT Server 3.4.0 stores your personal information in secured databases. Entgra IoT Server 3.4.0 exercises proper industry accepted security measures to protect the database where your personal - information is held.WSO2 IoT Server 3.3.0 as a product does not transfer or share your data with any + information is held.Entgra IoT Server 3.4.0 as a product does not transfer or share your data with any third parties or locations.

-

WSO2 IoT Server 3.3.0 may use encryption to keep your personal data with an added level of +

Entgra IoT Server 3.4.0 may use encryption to keep your personal data with an added level of security.

How long your personal information is retained

-

WSO2 IoT Server 3.3.0 retains your personal data as long as you are an active user of our system. You +

Entgra IoT Server 3.4.0 retains your personal data as long as you are an active user of our system. You can update your personal data at any time using the given self-care user portals.

-

WSO2 IoT Server 3.3.0 may keep hashed secrets to provide you with an added level of security. This +

Entgra IoT Server 3.4.0 may keep hashed secrets to provide you with an added level of security. This includes:

  • Current password
  • @@ -157,36 +157,36 @@

    You can request the administrator to delete your account. The administrator is the administrator of the tenant you are registered under, or the super-administrator if you do not use the tenant feature.

    -

    Additionally, you can request to anonymize all traces of your activities that WSO2 IoT Server 3.3.0 +

    Additionally, you can request to anonymize all traces of your activities that Entgra IoT Server 3.4.0 may have retained in logs, databases or analytical storage.

    More information

    Changes to this policy

    -

    Upgraded versions of WSO2 IoT Server 3.3.0 may contain changes to this policy. Revisions to this +

    Upgraded versions of Entgra IoT Server 3.4.0 may contain changes to this policy. Revisions to this policy will be packaged within such upgrades and would only apply to users who choose to use upgraded versions.

    Your choices

    -

    If you are already have an user account within WSO2 IoT Server 3.3.0 ; you have the right to +

    If you are already have an user account within Entgra IoT Server 3.4.0 ; you have the right to deactivate your account if you find that this privacy policy is unacceptable to you.

    If you do not have an account and you do not agree with our privacy policy, you can chose not to create one.

    Contact us

    -

    Please contact WSO2 if you have any question or concerns regarding this privacy policy.

    -

    https://wso2.com/contact/

    +

    Please contact Entgra if you have any question or concerns regarding this privacy policy.

    +

    https://entgra.io.com/contact/

    Disclaimer

    -

    WSO2, its employees, partners, and affiliates do not have access to and do not require, store, - process or control any of the data, including personal data contained in WSO2 IoT Server 3.3.0. All - data, including personal data is controlled and processed by the entity or individual running WSO2 - IoT Server 3.3.0. WSO2, its employees partners and affiliates are not a data processor or a data - controller within the meaning of any data privacy regulations. WSO2 does not provide any warranties +

    Entgra, its employees, partners, and affiliates do not have access to and do not require, store, + process or control any of the data, including personal data contained in Entgra IoT Server 3.4.0. All + data, including personal data is controlled and processed by the entity or individual running Entgra + IoT Server 3.4.0. Entgra, its employees partners and affiliates are not a data processor or a data + controller within the meaning of any data privacy regulations. Entgra does not provide any warranties or undertake any responsibility or liability in connection with the lawfulness or the manner and - purposes for which WSO2 IoT Server 3.3.0 is used by such entities or persons.

    -

    This privacy policy is for the informational purposes of the entity or persons running WSO2 IoT - Server 3.3.0 and sets out the processes and functionality contained within WSO2 IoT Server 3.3.0 - regarding personal data protection. It is the responsibility of entities and persons running WSO2 IoT - Server 3.3.0 to create and administer its own rules and processes governing users’ personal data, + purposes for which Entgra IoT Server 3.4.0 is used by such entities or persons.

    +

    This privacy policy is for the informational purposes of the entity or persons running Entgra IoT + Server 3.4.0 and sets out the processes and functionality contained within Entgra IoT Server 3.4.0 + regarding personal data protection. It is the responsibility of entities and persons running Entgra IoT + Server 3.4.0 to create and administer its own rules and processes governing users’ personal data, Please note that the creation of such rules and processes may change the use, storage and disclosure - policies contained herein. Therefore users should consult the entity or persons running WSO2 IoT - Server 3.3.0 for its own privacy policy for details governing users’ personal data.

    + policies contained herein. Therefore users should consult the entity or persons running Entgra IoT + Server 3.4.0 for its own privacy policy for details governing users’ personal data.

diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs index bcfa99eb090..98ee528e409 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs @@ -7,7 +7,7 @@

Register

-

Create a new account in WSO2 IoT Server(All fields are required.)

+

Create a new account in Entgra IoT Server(All fields are required.)