From 889598c3b39c71707f4fc161d7f9bf6029346564 Mon Sep 17 00:00:00 2001 From: harshanl Date: Fri, 18 Dec 2015 22:18:10 +0530 Subject: [PATCH] Removed deleting device data from disenrolment function. --- .../impl/android/AndroidDeviceManager.java | 22 ++----------------- .../impl/windows/WindowsDeviceManager.java | 17 ++------------ 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java index 6c8f220bb..d52115a83 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java @@ -200,26 +200,8 @@ public class AndroidDeviceManager implements DeviceManager { @Override public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException { - boolean status; - try { - if (log.isDebugEnabled()) { - log.debug("Dis-enrolling Android device : " + deviceId); - } - AndroidDAOFactory.beginTransaction(); - status = daoFactory.getMobileDeviceDAO().deleteMobileDevice(deviceId.getId()); - AndroidDAOFactory.commitTransaction(); - } catch (MobileDeviceManagementDAOException e) { - try { - AndroidDAOFactory.rollbackTransaction(); - } catch (MobileDeviceManagementDAOException mobileDAOEx) { - String msg = "Error occurred while roll back the device dis enrol transaction :" + - deviceId.toString(); - log.warn(msg, mobileDAOEx); - } - String msg = "Error while removing the Android device : " + deviceId.getId(); - throw new DeviceManagementException(msg, e); - } - return status; + //Here we don't have anything specific to do. Hence returning. + return true; } @Override diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java index 792c7e745..ab7d451a0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java @@ -164,21 +164,8 @@ public class WindowsDeviceManager implements DeviceManager { @Override public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException { - boolean status; - try { - if (log.isDebugEnabled()) { - log.debug("Dis-enrolling windows device : " + deviceId); - } - WindowsDAOFactory.beginTransaction(); - status = daoFactory.getMobileDeviceDAO().deleteMobileDevice(deviceId.getId()); - WindowsDAOFactory.commitTransaction(); - } catch (MobileDeviceManagementDAOException e) { - WindowsDAOFactory.rollbackTransaction(); - throw new DeviceManagementException("Error while removing the Windows device : " + deviceId.getId(), e); - } finally { - WindowsDAOFactory.closeConnection(); - } - return status; + //Here we don't have anything specific to do. Hence returning. + return true; } @Override