|
|
@ -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;
|
|
|
|
HashMap<Integer, Integer> devicePolicyIdMap = null;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
PolicyManagementDAOFactory.openConnection();
|
|
|
|
PolicyManagementDAOFactory.openConnection();
|
|
|
@ -247,7 +247,13 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<Integer> deviceIDs = new ArrayList<>(deviceIds.keySet());
|
|
|
|
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) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new PolicyComplianceException("SQL error occurred while getting monitoring details.", e);
|
|
|
|
throw new PolicyComplianceException("SQL error occurred while getting monitoring details.", e);
|
|
|
|
} catch (MonitoringDAOException e) {
|
|
|
|
} catch (MonitoringDAOException e) {
|
|
|
@ -380,19 +386,19 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|
|
|
monitoringOperation.setEnabled(true);
|
|
|
|
monitoringOperation.setEnabled(true);
|
|
|
|
monitoringOperation.setType(Operation.Type.COMMAND);
|
|
|
|
monitoringOperation.setType(Operation.Type.COMMAND);
|
|
|
|
monitoringOperation.setCode(OPERATION_MONITOR);
|
|
|
|
monitoringOperation.setCode(OPERATION_MONITOR);
|
|
|
|
CommandOperation infoOperation = new CommandOperation();
|
|
|
|
// CommandOperation infoOperation = new CommandOperation();
|
|
|
|
infoOperation.setEnabled(true);
|
|
|
|
// infoOperation.setEnabled(true);
|
|
|
|
infoOperation.setType(Operation.Type.COMMAND);
|
|
|
|
// infoOperation.setType(Operation.Type.COMMAND);
|
|
|
|
infoOperation.setCode(OPERATION_INFO);
|
|
|
|
// infoOperation.setCode(OPERATION_INFO);
|
|
|
|
CommandOperation appListOperation = new CommandOperation();
|
|
|
|
// CommandOperation appListOperation = new CommandOperation();
|
|
|
|
appListOperation.setEnabled(true);
|
|
|
|
// appListOperation.setEnabled(true);
|
|
|
|
appListOperation.setType(Operation.Type.COMMAND);
|
|
|
|
// appListOperation.setType(Operation.Type.COMMAND);
|
|
|
|
appListOperation.setCode(OPERATION_APP_LIST);
|
|
|
|
// appListOperation.setCode(OPERATION_APP_LIST);
|
|
|
|
|
|
|
|
|
|
|
|
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
|
|
|
|
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
|
|
|
|
service.addOperation(monitoringOperation, deviceIdentifiers);
|
|
|
|
service.addOperation(monitoringOperation, deviceIdentifiers);
|
|
|
|
service.addOperation(infoOperation, deviceIdentifiers);
|
|
|
|
// service.addOperation(infoOperation, deviceIdentifiers);
|
|
|
|
service.addOperation(appListOperation, deviceIdentifiers);
|
|
|
|
// service.addOperation(appListOperation, deviceIdentifiers);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<DeviceIdentifier> getDeviceIdentifiersFromDevices(List<Device> devices) {
|
|
|
|
private List<DeviceIdentifier> getDeviceIdentifiersFromDevices(List<Device> devices) {
|
|
|
|