mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt
This commit is contained in:
commit
2fa99ac475
@ -229,7 +229,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
//int tenantId = PolicyManagerUtil.getTenantId();
|
//int tenantId = PolicyManagerUtil.getTenantId();
|
||||||
Map<Integer, Device> deviceIds = new HashMap<>();
|
Map<Integer, Device> deviceIds = new HashMap<>();
|
||||||
List<ComplianceData> complianceDatas = new ArrayList<>();
|
List<ComplianceData> complianceDatas = new ArrayList<>();
|
||||||
HashMap<Integer, Integer> devicePolicyIdMap = null;
|
HashMap<Integer, Integer> devicePolicyIdMap = new HashMap<>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
PolicyManagementDAOFactory.openConnection();
|
PolicyManagementDAOFactory.openConnection();
|
||||||
@ -249,7 +249,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
|
|
||||||
HashMap<Integer, Integer> temp = policyDAO.getAppliedPolicyIds();
|
HashMap<Integer, Integer> temp = policyDAO.getAppliedPolicyIds();
|
||||||
for (Integer id : deviceIDs) {
|
for (Integer id : deviceIDs) {
|
||||||
if (temp != null && temp.containsKey(id)) {
|
if (temp != null && !temp.isEmpty() && temp.containsKey(id)) {
|
||||||
devicePolicyIdMap.put(id, temp.get(id));
|
devicePolicyIdMap.put(id, temp.get(id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceTypeDAO;
|
import org.wso2.carbon.device.mgt.core.dao.DeviceTypeDAO;
|
||||||
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
||||||
@ -90,7 +89,7 @@ public class MonitoringTask implements Task {
|
|||||||
PolicyManagementDataHolder.getInstance().getPolicyMonitoringService(deviceType.getName());
|
PolicyManagementDataHolder.getInstance().getPolicyMonitoringService(deviceType.getName());
|
||||||
List<Device> devices = deviceManagementProviderService.getAllDevices(deviceType.getName());
|
List<Device> devices = deviceManagementProviderService.getAllDevices(deviceType.getName());
|
||||||
if (monitoringService != null && !devices.isEmpty()) {
|
if (monitoringService != null && !devices.isEmpty()) {
|
||||||
monitoringManager.addMonitoringOperation(devices);
|
|
||||||
|
|
||||||
List<Device> notifiableDevices = new ArrayList<>();
|
List<Device> notifiableDevices = new ArrayList<>();
|
||||||
|
|
||||||
@ -118,6 +117,7 @@ public class MonitoringTask implements Task {
|
|||||||
log.debug(device.getDeviceIdentifier());
|
log.debug(device.getDeviceIdentifier());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
monitoringManager.addMonitoringOperation(notifiableDevices);
|
||||||
monitoringService.notifyDevices(notifiableDevices);
|
monitoringService.notifyDevices(notifiableDevices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user