Removed deleting device data from disenrolment function.

revert-dabc3590
harshanl 9 years ago
parent 4624794979
commit 889598c3b3

@ -200,26 +200,8 @@ public class AndroidDeviceManager implements DeviceManager {
@Override @Override
public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException { public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
boolean status; //Here we don't have anything specific to do. Hence returning.
try { return true;
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;
} }
@Override @Override

@ -164,21 +164,8 @@ public class WindowsDeviceManager implements DeviceManager {
@Override @Override
public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException { public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
boolean status; //Here we don't have anything specific to do. Hence returning.
try { return true;
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;
} }
@Override @Override

Loading…
Cancel
Save