mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
fixing the agent unable to enroll issue
This commit is contained in:
parent
0551598988
commit
58b2bf8b3c
@ -335,23 +335,25 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tenantId = this.getTenantId();
|
||||||
|
|
||||||
|
Device device = this.getDevice(deviceId, false);
|
||||||
|
if (device == null) {
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Device not found for id '" + deviceId.getId() + "'");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.REMOVED)) {
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Device has already disenrolled : " + deviceId.getId() + "'");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int tenantId = this.getTenantId();
|
|
||||||
|
|
||||||
Device device = this.getDevice(deviceId, false);
|
|
||||||
if (device == null) {
|
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.debug("Device not found for id '" + deviceId.getId() + "'");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.REMOVED)) {
|
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.debug("Device has already disenrolled : " + deviceId.getId() + "'");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
device.getEnrolmentInfo().setDateOfLastUpdate(new Date().getTime());
|
device.getEnrolmentInfo().setDateOfLastUpdate(new Date().getTime());
|
||||||
device.getEnrolmentInfo().setStatus(EnrolmentInfo.Status.REMOVED);
|
device.getEnrolmentInfo().setStatus(EnrolmentInfo.Status.REMOVED);
|
||||||
DeviceManagementDAOFactory.beginTransaction();
|
DeviceManagementDAOFactory.beginTransaction();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user