|
|
|
@ -229,7 +229,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|
|
|
|
//int tenantId = PolicyManagerUtil.getTenantId();
|
|
|
|
|
Map<Integer, Device> deviceIds = new HashMap<>();
|
|
|
|
|
List<ComplianceData> complianceDatas = new ArrayList<>();
|
|
|
|
|
HashMap<Integer, Integer> devicePolicyIdMap;
|
|
|
|
|
HashMap<Integer, Integer> devicePolicyIdMap = null;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
PolicyManagementDAOFactory.openConnection();
|
|
|
|
@ -247,7 +247,13 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|
|
|
|
}
|
|
|
|
|
List<Integer> deviceIDs = new ArrayList<>(deviceIds.keySet());
|
|
|
|
|
|
|
|
|
|
devicePolicyIdMap = policyDAO.getAppliedPolicyIds(deviceIDs);
|
|
|
|
|
HashMap<Integer, Integer> temp = policyDAO.getAppliedPolicyIds();
|
|
|
|
|
for (Integer id : deviceIDs) {
|
|
|
|
|
if (temp != null && temp.containsKey(id)) {
|
|
|
|
|
devicePolicyIdMap.put(id, temp.get(id));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new PolicyComplianceException("SQL error occurred while getting monitoring details.", e);
|
|
|
|
|
} catch (MonitoringDAOException e) {
|
|
|
|
@ -380,19 +386,19 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|
|
|
|
monitoringOperation.setEnabled(true);
|
|
|
|
|
monitoringOperation.setType(Operation.Type.COMMAND);
|
|
|
|
|
monitoringOperation.setCode(OPERATION_MONITOR);
|
|
|
|
|
CommandOperation infoOperation = new CommandOperation();
|
|
|
|
|
infoOperation.setEnabled(true);
|
|
|
|
|
infoOperation.setType(Operation.Type.COMMAND);
|
|
|
|
|
infoOperation.setCode(OPERATION_INFO);
|
|
|
|
|
CommandOperation appListOperation = new CommandOperation();
|
|
|
|
|
appListOperation.setEnabled(true);
|
|
|
|
|
appListOperation.setType(Operation.Type.COMMAND);
|
|
|
|
|
appListOperation.setCode(OPERATION_APP_LIST);
|
|
|
|
|
// CommandOperation infoOperation = new CommandOperation();
|
|
|
|
|
// infoOperation.setEnabled(true);
|
|
|
|
|
// infoOperation.setType(Operation.Type.COMMAND);
|
|
|
|
|
// infoOperation.setCode(OPERATION_INFO);
|
|
|
|
|
// CommandOperation appListOperation = new CommandOperation();
|
|
|
|
|
// appListOperation.setEnabled(true);
|
|
|
|
|
// appListOperation.setType(Operation.Type.COMMAND);
|
|
|
|
|
// appListOperation.setCode(OPERATION_APP_LIST);
|
|
|
|
|
|
|
|
|
|
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
|
|
|
|
|
service.addOperation(monitoringOperation, deviceIdentifiers);
|
|
|
|
|
service.addOperation(infoOperation, deviceIdentifiers);
|
|
|
|
|
service.addOperation(appListOperation, deviceIdentifiers);
|
|
|
|
|
// service.addOperation(infoOperation, deviceIdentifiers);
|
|
|
|
|
// service.addOperation(appListOperation, deviceIdentifiers);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<DeviceIdentifier> getDeviceIdentifiersFromDevices(List<Device> devices) {
|
|
|
|
|