Fixing the monitoring task for INACTIVE, BLOCKED, REMOVED, UNCLAIMED, DISENROLLMENT_REQUESTED, SUSPENDED devices

4.x.x
geethkokila 9 years ago
parent ee0e9af4cb
commit 7dd48bf00e

@ -77,14 +77,13 @@ public class MonitoringTask implements Task {
try { try {
DeviceManagementProviderService deviceManagementProviderService = DeviceManagementProviderService deviceManagementProviderService =
PolicyManagementDataHolder.getInstance().getDeviceManagementService(); PolicyManagementDataHolder.getInstance().getDeviceManagementService();
for (DeviceType deviceType : deviceTypes) { for (DeviceType deviceType : deviceTypes) {
if(log.isDebugEnabled()){ if (log.isDebugEnabled()) {
log.debug("Running task for device type : " + deviceType.getName() ); log.debug("Running task for device type : " + deviceType.getName());
} }
PolicyMonitoringService monitoringService = PolicyMonitoringService monitoringService =
@ -100,15 +99,21 @@ public class MonitoringTask implements Task {
deviceType.getName()); deviceType.getName());
} }
for (Device device : devices) { for (Device device : devices) {
if (device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.INACTIVE) || EnrolmentInfo.Status status = device.getEnrolmentInfo().getStatus();
device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.BLOCKED)) { if (status.equals(EnrolmentInfo.Status.INACTIVE) ||
status.equals(EnrolmentInfo.Status.BLOCKED) ||
status.equals(EnrolmentInfo.Status.REMOVED) ||
status.equals(EnrolmentInfo.Status.UNCLAIMED) ||
status.equals(EnrolmentInfo.Status.DISENROLLMENT_REQUESTED) ||
status.equals(EnrolmentInfo.Status.SUSPENDED)) {
continue; continue;
} else { } else {
notifiableDevices.add(device); notifiableDevices.add(device);
} }
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Following devices selected to send the notification for " + deviceType.getName()); log.debug("Following devices selected to send the notification for " +
deviceType.getName());
for (Device device : notifiableDevices) { for (Device device : notifiableDevices) {
log.debug(device.getDeviceIdentifier()); log.debug(device.getDeviceIdentifier());
} }

Loading…
Cancel
Save