From 58a31d0031bcb8ceb82ddb995b89b326210b29f1 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Tue, 25 Jun 2019 19:15:24 +0000 Subject: [PATCH 01/18] Plugin level support for deleting device permanently --- .../device/mgt/common/DeviceManager.java | 26 ++++ .../core/dao/impl/AbstractDeviceDAOImpl.java | 136 ++++++++---------- .../DeviceManagementProviderServiceImpl.java | 36 +++-- .../device/mgt/core/TestDeviceManager.java | 5 + .../type/template/DeviceTypeManager.java | 47 ++++++ .../template/dao/DeviceTypePluginDAOImpl.java | 48 +++++++ .../device/type/template/dao/PluginDAO.java | 19 +++ .../dao/PropertyBasedPluginDAOImpl.java | 38 +++++ .../mgt/core/mock/TypeXDeviceManager.java | 22 +++ 9 files changed, 290 insertions(+), 87 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManager.java index ebb225ae4f..5a2259fe40 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManager.java @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.common; @@ -79,6 +96,15 @@ public interface DeviceManager { */ boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException; + /** + * Method to delete a particular device from CDM. + * + * @param deviceId Fully qualified device identifier + * @return A boolean indicating the status of the operation. + * @throws DeviceManagementException If some unusual behaviour is observed while deleting a device + */ + boolean deleteDevice(DeviceIdentifier deviceId, Device device) throws DeviceManagementException; + /** * Method to retrieve the status of the registration process of a particular device. * diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java index aa07aba8b4..866b230ed2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java @@ -1409,91 +1409,97 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } public void deleteDevice(DeviceIdentifier deviceIdentifier, int tenantId) throws DeviceManagementDAOException { + String deviceIdentifierId = deviceIdentifier.getId(); + String deviceType = deviceIdentifier.getType(); Connection conn; try { conn = this.getConnection(); int deviceId = getDeviceId(conn, deviceIdentifier, tenantId); if (deviceId == -1) { - String msg = "Device " + deviceIdentifier.getId() + " of type " + deviceIdentifier.getType() + - " is not found"; + String msg = "Device " + deviceIdentifierId + " of type " + deviceType + " is not found"; log.error(msg); throw new DeviceManagementDAOException(msg); } else { - int enrollmentId = getEnrollmentId(conn, deviceId, tenantId); - if (enrollmentId == -1) { - String msg = "Enrollment not found for the device " + deviceIdentifier.getId() + " of type " + - deviceIdentifier.getType(); + List enrollmentIds = getEnrollmentIds(conn, deviceId, tenantId); + if (enrollmentIds == null || enrollmentIds.isEmpty()) { + String msg = "Enrollments not found for the device " + deviceIdentifierId + " of type " + + deviceType; log.error(msg); throw new DeviceManagementDAOException(msg); } else { removeDeviceDetail(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device detail data"); + log.debug("Successfully removed device detail data of device " + deviceIdentifierId + + " of type " + deviceType); } removeDeviceLocation(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device location data"); + log.debug("Successfully removed device location data of device " + deviceIdentifierId + + " of type " + deviceType); } removeDeviceInfo(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device info data"); + log.debug("Successfully removed device info data of device " + deviceIdentifierId + + " of type " + deviceType); } removeDeviceNotification(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device notification data"); + log.debug("Successfully removed device notification data of device " + deviceIdentifierId + + " of type " + deviceType); } removeDeviceApplicationMapping(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device application mapping data"); + log.debug("Successfully removed device application mapping data of device " + + deviceIdentifierId + " of type " + deviceType); } removeDevicePolicyApplied(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device applied policy data"); + log.debug("Successfully removed device applied policy data of device " + deviceIdentifierId + + " of type " + deviceType); } removeDevicePolicy(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device policy data"); + log.debug("Successfully removed device policy data of device " + deviceIdentifierId + + " of type " + deviceType); } - removeEnrollmentDeviceDetail(conn, enrollmentId); if (log.isDebugEnabled()) { - log.debug("Successfully removed enrollment device detail data"); + log.debug("Starting to remove " + enrollmentIds.size() + " enrollment data of device " + + deviceIdentifierId + " of type " + deviceType); } - removeEnrollmentDeviceLocation(conn, enrollmentId); - if (log.isDebugEnabled()) { - log.debug("Successfully removed enrollment device location data"); - } - removeEnrollmentDeviceInfo(conn, enrollmentId); - if (log.isDebugEnabled()) { - log.debug("Successfully removed enrollment device info data"); - } - removeEnrollmentDeviceApplicationMapping(conn, enrollmentId); - if (log.isDebugEnabled()) { - log.debug("Successfully removed enrollment device application mapping data"); - } - removeDeviceOperationResponse(conn, enrollmentId); - if (log.isDebugEnabled()) { - log.debug("Successfully removed device operation response data"); + for (Integer enrollmentId : enrollmentIds) { + removeEnrollmentDeviceDetail(conn, enrollmentId); + removeEnrollmentDeviceLocation(conn, enrollmentId); + removeEnrollmentDeviceInfo(conn, enrollmentId); + removeEnrollmentDeviceApplicationMapping(conn, enrollmentId); + removeDeviceOperationResponse(conn, enrollmentId); + removeEnrollmentOperationMapping(conn, enrollmentId); } - removeEnrollmentOperationMapping(conn, enrollmentId); if (log.isDebugEnabled()) { - log.debug("Successfully removed enrollment operation mapping data"); + log.debug("Successfully removed enrollment device details, enrollment device location, " + + "enrollment device info, enrollment device application mapping, " + + "enrollment device operation response, enrollment operation mapping data of device " + + deviceIdentifierId + " of type " + deviceType); } removeDeviceEnrollment(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device enrollment data"); + log.debug("Successfully removed device enrollment data of device " + deviceIdentifierId + + " of type " + deviceType); } removeDeviceGroupMapping(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully removed device group mapping data"); + log.debug("Successfully removed device group mapping data of device " + deviceIdentifierId + + " of type " + deviceType); } removeDevice(conn, deviceId); if (log.isDebugEnabled()) { - log.debug("Successfully permanently deleted the device"); + log.debug("Successfully permanently deleted the device of device " + deviceIdentifierId + + " of type " + deviceType); } } } } catch (SQLException e) { - throw new DeviceManagementDAOException("Error occurred while deleting the device", e); + throw new DeviceManagementDAOException("Error occurred while deleting the device " + deviceIdentifierId + + " of type " + deviceType, e); } } @@ -1519,30 +1525,29 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { return deviceId; } - private int getEnrollmentId(Connection conn, int deviceId, int tenantId) throws DeviceManagementDAOException { + private List getEnrollmentIds(Connection conn, int deviceId, int tenantId) throws DeviceManagementDAOException { PreparedStatement stmt = null; ResultSet rs = null; - int enrollmentId = -1; + List enrollmentIds = new ArrayList<>(); try { String sql = "SELECT ID FROM DM_ENROLMENT WHERE DEVICE_ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(sql); stmt.setInt(1, deviceId); stmt.setInt(2, tenantId); rs = stmt.executeQuery(); - if (rs.next()) { - enrollmentId = rs.getInt("ID"); + while (rs.next()) { + enrollmentIds.add(rs.getInt("ID")); } } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while retrieving enrollment id of the device", e); } finally { DeviceManagementDAOUtil.cleanupResources(stmt, rs); } - return enrollmentId; + return enrollmentIds; } private void removeDeviceDetail(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_DETAIL WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1551,13 +1556,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device detail", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDeviceLocation(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_LOCATION WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1566,13 +1570,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device location", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDeviceInfo(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_INFO WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1581,13 +1584,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device info", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDeviceNotification(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_NOTIFICATION WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1596,13 +1598,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device notification", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDeviceApplicationMapping(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1611,13 +1612,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device application mapping", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDevicePolicyApplied(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_POLICY_APPLIED WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1626,13 +1626,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device policy applied", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDevicePolicy(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_POLICY WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1641,13 +1640,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device policy", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeEnrollmentDeviceDetail(Connection conn, int enrollmentId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_DETAIL WHERE ENROLMENT_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1656,13 +1654,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing enrollment device detail", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeEnrollmentDeviceLocation(Connection conn, int enrollmentId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_LOCATION WHERE ENROLMENT_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1671,13 +1668,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing enrollment device location", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeEnrollmentDeviceInfo(Connection conn, int enrollmentId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_INFO WHERE ENROLMENT_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1686,14 +1682,13 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing enrollment device info", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeEnrollmentDeviceApplicationMapping(Connection conn, int enrollmentId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_APPLICATION_MAPPING WHERE ENROLMENT_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1703,13 +1698,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { throw new DeviceManagementDAOException("Error occurred while removing enrollment device application " + "mapping", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDeviceOperationResponse(Connection conn, int enrollmentId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_OPERATION_RESPONSE WHERE ENROLMENT_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1718,14 +1712,13 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device operation response", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeEnrollmentOperationMapping(Connection conn, int enrollmentId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_ENROLMENT_OP_MAPPING WHERE ENROLMENT_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1734,13 +1727,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing enrollment operation mapping", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDeviceEnrollment(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_ENROLMENT WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1749,13 +1741,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device enrollment", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDeviceGroupMapping(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE_GROUP_MAP WHERE DEVICE_ID = ?"; stmt = conn.prepareStatement(sql); @@ -1764,13 +1755,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device group mapping", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } private void removeDevice(Connection conn, int deviceId) throws DeviceManagementDAOException { PreparedStatement stmt = null; - ResultSet rs = null; try { String sql = "DELETE FROM DM_DEVICE WHERE ID = ?"; stmt = conn.prepareStatement(sql); @@ -1779,7 +1769,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while removing device", e); } finally { - DeviceManagementDAOUtil.cleanupResources(stmt, rs); + DeviceManagementDAOUtil.cleanupResources(stmt, null); } } } 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 621cc966e3..76e86420d3 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 @@ -14,23 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - */ -/* - * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved. * - * Entgra (pvt) Ltd. 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 + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. 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. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.core.service; @@ -550,6 +550,14 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv try { DeviceManagementDAOFactory.beginTransaction(); deviceDAO.deleteDevice(deviceId, tenantId); + try { + deviceManager.deleteDevice(deviceId, device); + } catch (DeviceManagementException e) { + String msg = "Error occurred while permanently deleting '" + deviceId.getType() + + "' device with the identifier '" + deviceId.getId() + "' in plugin."; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); + } DeviceManagementDAOFactory.commitTransaction(); this.removeDeviceFromCache(deviceId); } catch (DeviceManagementDAOException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManager.java index 47a01c9e59..8675858f8b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManager.java @@ -59,6 +59,11 @@ public class TestDeviceManager implements DeviceManager { return true; } + @Override + public boolean deleteDevice(DeviceIdentifier deviceId, Device device) throws DeviceManagementException { + return true; + } + @Override public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException { return true; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java index b84d165814..948e5a5ff6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java @@ -15,6 +15,22 @@ * specific language governing permissions and limitations * under the License. * + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.extensions.device.type.template; @@ -568,4 +584,35 @@ public class DeviceTypeManager implements DeviceManager { return null; } + @Override + public boolean deleteDevice(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException { + if (propertiesExist) { + boolean status; + Device existingDevice = this.getDevice(deviceIdentifier); + if (existingDevice == null) { + return false; + } + try { + if (log.isDebugEnabled()) { + log.debug("Deleting the details of " + deviceType + " device : " + device.getDeviceIdentifier()); + } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().beginTransaction(); + status = deviceTypePluginDAOManager.getDeviceDAO().deleteDevice(existingDevice); + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction(); + } catch (DeviceTypeMgtPluginException e) { + try { + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); + } catch (DeviceTypeMgtPluginException e1) { + log.warn("Error occurred while roll back the delete device info transaction : '" + + device.toString() + "'", e1); + } + throw new DeviceManagementException( + "Error occurred while deleting the " + deviceType + " device: '" + + device.getDeviceIdentifier() + "'", e); + } + return status; + } + return true; + } + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypePluginDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypePluginDAOImpl.java index 755cb0397b..00c9e4ff40 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypePluginDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypePluginDAOImpl.java @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.extensions.device.type.template.dao; @@ -45,6 +62,7 @@ public class DeviceTypePluginDAOImpl implements PluginDAO { private String createDBqueryForAddDevice; private String updateDBQueryForUpdateDevice; private String selectDBQueryToGetAllDevice; + private String deleteDBQueryForDeleteDevice; public DeviceTypePluginDAOImpl(DeviceDAODefinition deviceDAODefinition, DeviceTypeDAOHandler deviceTypeDAOHandler) { @@ -196,6 +214,33 @@ public class DeviceTypePluginDAOImpl implements PluginDAO { } } + @Override + public boolean deleteDevice(Device device) throws DeviceTypeMgtPluginException { + boolean status = false; + Connection conn; + PreparedStatement stmt = null; + try { + conn = deviceTypeDAOHandler.getConnection(); + stmt = conn.prepareStatement(deleteDBQueryForDeleteDevice); + stmt.setString(1, device.getDeviceIdentifier()); + int rows = stmt.executeUpdate(); + if (rows > 0) { + status = true; + if (log.isDebugEnabled()) { + log.debug("Device " + device.getDeviceIdentifier() + " data has been deleted."); + } + } + } catch (SQLException e) { + String msg = "Error occurred while deleting the device '" + device.getDeviceIdentifier() + "' data in " + + deviceDAODefinition.getDeviceTableName(); + log.error(msg, e); + throw new DeviceTypeMgtPluginException(msg, e); + } finally { + DeviceTypeUtils.cleanupResources(stmt, null); + } + return status; + } + private String getDeviceTableColumnNames() { return StringUtils.join(deviceDAODefinition.getColumnNames(), ", "); } @@ -239,5 +284,8 @@ public class DeviceTypePluginDAOImpl implements PluginDAO { selectDBQueryToGetAllDevice = "SELECT " + getDeviceTableColumnNames() + "," + deviceDAODefinition.getPrimaryKey() + " FROM " + deviceDAODefinition.getDeviceTableName(); + + deleteDBQueryForDeleteDevice = "DELETE FROM " + deviceDAODefinition.getDeviceTableName() + " WHERE " + + deviceDAODefinition.getPrimaryKey() + " = ?"; } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/PluginDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/PluginDAO.java index 47606fe6a6..bd1747d454 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/PluginDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/PluginDAO.java @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.extensions.device.type.template.dao; @@ -31,4 +48,6 @@ public interface PluginDAO { boolean updateDevice(Device device) throws DeviceTypeMgtPluginException; List getAllDevices() throws DeviceTypeMgtPluginException; + + boolean deleteDevice(Device device) throws DeviceTypeMgtPluginException; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/PropertyBasedPluginDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/PropertyBasedPluginDAOImpl.java index ac90fb1052..1c38884ca7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/PropertyBasedPluginDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/PropertyBasedPluginDAOImpl.java @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.extensions.device.type.template.dao; @@ -201,6 +218,27 @@ public class PropertyBasedPluginDAOImpl implements PluginDAO { } } + @Override + public boolean deleteDevice(Device device) throws DeviceTypeMgtPluginException { + Connection conn; + PreparedStatement stmt = null; + try { + conn = deviceTypeDAOHandler.getConnection(); + stmt = conn.prepareStatement("DELETE FROM DM_DEVICE_PROPERTIES WHERE DEVICE_IDENTIFICATION = ?"); + stmt.setString(1, device.getDeviceIdentifier()); + stmt.executeUpdate(); + return true; + } catch (SQLException e) { + String msg = "Error occurred while deleting the device '" + device.getDeviceIdentifier() + "' data on" + + deviceType; + log.error(msg, e); + throw new DeviceTypeMgtPluginException(msg, e); + } finally { + DeviceTypeUtils.cleanupResources(stmt, null); + } + } + + private String getPropertyValue(List properties, String propertyName) { for (Device.Property property : properties) { if (property.getName() != null && property.getName().equals(propertyName)) { diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/mock/TypeXDeviceManager.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/mock/TypeXDeviceManager.java index d9477b5119..f303b15c7f 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/mock/TypeXDeviceManager.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/mock/TypeXDeviceManager.java @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.policy.mgt.core.mock; @@ -61,6 +78,11 @@ public class TypeXDeviceManager implements DeviceManager { return false; } + @Override + public boolean deleteDevice(DeviceIdentifier deviceId, Device device) throws DeviceManagementException { + return false; + } + @Override public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException { return false; From 33ffa23efc155329d1ca7252ff684194b7b54f1a Mon Sep 17 00:00:00 2001 From: Ace Date: Wed, 26 Jun 2019 13:24:00 +0530 Subject: [PATCH 02/18] updating references to 3.5.0 release to 3.6.0 --- .../cdmf.page.cookie-policy/cookie-policy.hbs | 52 ++++++++--------- .../privacy-policy.hbs | 58 +++++++++---------- .../app/units/uuf.unit.footer/footer.hbs | 4 +- 3 files changed, 57 insertions(+), 57 deletions(-) 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 9a2df65f5e..cc48c8bad1 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 @@ -26,14 +26,14 @@

About Entgra IoT Server

-

Entgra IoT Server 3.5.0 is a complete solution that enables device manufacturers and enterprises to +

Entgra IoT Server 3.6.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.

-

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

Entgra IoT Server 3.6.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,12 +45,12 @@ 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 Entgra IoT Server 3.5.0 process cookies?

-

Entgra IoT Server 3.5.0 uses cookies to store and retrieve information on your browser. This +

How does Entgra IoT Server 3.6.0 process cookies?

+

Entgra IoT Server 3.6.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 Entgra IoT Server 3.5.0 are used to personally identify you. However, the cookie +

Some cookies in Entgra IoT Server 3.6.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 @@ -58,42 +58,42 @@

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

What does Entgra IoT Server 3.0.0 use cookies for?

-

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

+

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

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

Preferences

-

Entgra IoT Server 3.5.0 uses cookies to remember your settings and preferences and to auto-fill the +

Entgra IoT Server 3.6.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. Entgra IoT Server 3.5.0 uses selected cookies to identify and prevent security risks. For example, - Entgra IoT Server 3.5.0 may use cookies to store your session information to prevent others from +
  2. Entgra IoT Server 3.6.0 uses selected cookies to identify and prevent security risks. For example, + Entgra IoT Server 3.6.0 may use cookies to store your session information to prevent others from changing your password without your username and password.
  3. -
  4. Entgra IoT Server 3.5.0 uses session cookie to maintain your active session.
  5. -
  6. Entgra IoT Server 3.5.0 may use a temporary cookie when performing multi-factor authentication and +
  7. Entgra IoT Server 3.6.0 uses session cookie to maintain your active session.
  8. +
  9. Entgra IoT Server 3.6.0 may use a temporary cookie when performing multi-factor authentication and federated authentication.
  10. -
  11. Entgra IoT Server 3.5.0 may use permanent cookies to detect the devices you have logged in +
  12. Entgra IoT Server 3.6.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

-

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

+

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

Analytics

-

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

+

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

Third party cookies

-

Using Entgra IoT Server 3.5.0 may cause third-party cookie to be set in your browser. Entgra IoT Server +

Using Entgra IoT Server 3.6.0 may cause third-party cookie to be set in your browser. Entgra IoT Server 3.5.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 Entgra IoT Server 3.5.0 +
  2. Any social login sites. For example, third-party cookies may be set when Entgra IoT Server 3.6.0 is configured to use “social” or “federated” login, and you opt to login with your “Social Account”.
  3. @@ -101,11 +101,11 @@

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 Entgra IoT Server 3.5.0 use?

-

Entgra IoT Server 3.5.0 uses persistent cookies and session cookies. A persistent cookie helps Entgra IS +

What type of cookies does Entgra IoT Server 3.6.0 use?

+

Entgra IoT Server 3.6.0 uses persistent cookies and session cookies. A persistent cookie helps Entgra IS 3.5.0 to recognize you as an existing user so that it is easier to return to Entgra or interact with Entgra IS 3.5.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.5.0 when you return to Entgra IoT Server 3.5.0.

+ and will be read by Entgra IoT Server 3.6.0 when you return to Entgra IoT Server 3.6.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 Entgra IoT Server 3.5.0.

+ functionalities offered by Entgra IoT Server 3.6.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 Entgra IoT Server 3.5.0 + individuals (or their data protection officer, if applicable) running this Entgra IoT Server 3.6.0 instance.

What are the cookies used?

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

Disclaimer

-

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

This cookie policy is only for illustrative purposes of the product Entgra IoT Server 3.6.0. The content in the policy is technically correct at the time of the product shipment. The - entity,organization or individual that runs this Entgra IoT Server 3.5.0 instance has full authority + entity,organization or individual that runs this Entgra IoT Server 3.6.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 Entgra IoT Server 3.5.0. All data, including personal data is - controlled and processed by the entity, organization or individual running Entgra IoT Server 3.5.0. + including personal data contained in Entgra IoT Server 3.6.0. All data, including personal data is + controlled and processed by the entity, organization or individual running Entgra IoT Server 3.6.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 - Entgra IoT Server 3.5.0 is used by such entities, organizations or persons.

+ Entgra IoT Server 3.6.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 dbcb7d89ab..f69a06cd4a 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 @@ -36,18 +36,18 @@

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 Entgra IoT Server 3.5.0 captures your personal information, the purposes of +

This policy describes how Entgra IoT Server 3.6.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. Entgra and its developers have no access to the information held within Entgra IoT Server 3.5.0.Please see the Disclaimer section for more information. Entities, organisations or individuals - controlling the use and administration of Entgra IoT Server 3.5.0 should create their own privacy + controlling the use and administration of Entgra IoT Server 3.6.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?

-

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

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

-

Signing in to Entgra IoT Server 3.5.0

+

Signing in to Entgra IoT Server 3.6.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 Entgra IoT Server 3.5.0

+

Enrolling a device with Entgra IoT Server 3.6.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, Entgra IoT Server 3.5.0 also collects the following information that is not considered +

However, Entgra IoT Server 3.6.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

-

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

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

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

Tracking Technologies

-

Entgra IoT Server 3.5.0 collects your information by:

+

Entgra IoT Server 3.6.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,11 +95,11 @@

Use of personal information

-

Entgra IoT Server 3.5.0 will only use your personal information for the purposes for which it was +

Entgra IoT Server 3.6.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).

-

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

+

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

    -
  • To provide you with a personalized user experience. Entgra IoT Server 3.5.0 uses your name and +
  • To provide you with a personalized user experience. Entgra IoT Server 3.6.0 uses your name and uploaded profile pictures for this purpose.
  • To protect your account from unauthorized access or potential hacking attempts. Entgra IoT Server @@ -117,7 +117,7 @@ Server 3.5.0 will not keep any personal information after statistical calculations. Therefore, the statistical report has no means of identifying an individual person.
  • -
  • Entgra IoT Server 3.5.0 may use:
  • +
  • Entgra IoT Server 3.6.0 may use:
    1. IP Address to derive geographic information
    2. @@ -126,28 +126,28 @@

Disclosure of personal information

-

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

Entgra IoT Server 3.6.0 only discloses personal information to the relevant applications (also known as + “Service Providers”) that are registered with Entgra IoT Server 3.6.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 Entgra IoT Server 3.5.0 may be +

Please note that the organisation, entity or individual running Entgra IoT Server 3.6.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

-

Entgra IoT Server 3.5.0 stores your personal information in secured databases. Entgra IoT Server 3.5.0 +

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

-

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

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

How long your personal information is retained

-

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

Entgra IoT Server 3.6.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.

-

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

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