mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request 'Add device enrolment log for modifyenrolment' (#148) from prathabanKavin/device-mgt-core:enrolmentlogfix into master
Reviewed-on: https://repository.entgra.net/community/device-mgt-core/pulls/148
This commit is contained in:
commit
da694c3dbe
@ -467,6 +467,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Modifying enrollment for device: " + device.getId() + " of type '" + device.getType() + "'");
|
log.debug("Modifying enrollment for device: " + device.getId() + " of type '" + device.getType() + "'");
|
||||||
}
|
}
|
||||||
|
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
|
||||||
|
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
||||||
DeviceManager deviceManager = this.getDeviceManager(device.getType());
|
DeviceManager deviceManager = this.getDeviceManager(device.getType());
|
||||||
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(device.getDeviceIdentifier(), device.getType());
|
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(device.getDeviceIdentifier(), device.getType());
|
||||||
if (deviceManager == null) {
|
if (deviceManager == null) {
|
||||||
@ -495,6 +497,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
enrollmentDAO.updateEnrollment(device.getEnrolmentInfo(), tenantId);
|
enrollmentDAO.updateEnrollment(device.getEnrolmentInfo(), tenantId);
|
||||||
|
|
||||||
DeviceManagementDAOFactory.commitTransaction();
|
DeviceManagementDAOFactory.commitTransaction();
|
||||||
|
log.info("Device enrolled successfully", deviceEnrolmentLogContextBuilder.setDeviceId(String.valueOf(currentDevice.getId())).setDeviceType(String.valueOf(currentDevice.getType())).setOwner(currentDevice.getEnrolmentInfo().getOwner()).setOwnership(String.valueOf(currentDevice.getEnrolmentInfo().getOwnership())).setTenantID(String.valueOf(tenantId)).setTenantDomain(tenantDomain).setUserName(userName).build());
|
||||||
this.removeDeviceFromCache(deviceIdentifier);
|
this.removeDeviceFromCache(deviceIdentifier);
|
||||||
} catch (DeviceManagementDAOException e) {
|
} catch (DeviceManagementDAOException e) {
|
||||||
DeviceManagementDAOFactory.rollbackTransaction();
|
DeviceManagementDAOFactory.rollbackTransaction();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user