mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Removed unnecessary logs and added null checks in MonitoringManager
This commit is contained in:
parent
8c748b3dfd
commit
7fed00a14d
@ -293,13 +293,16 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
} catch (PolicyManagerDAOException e) {
|
} catch (PolicyManagerDAOException e) {
|
||||||
PolicyManagementDAOFactory.rollbackTransaction();
|
PolicyManagementDAOFactory.rollbackTransaction();
|
||||||
throw new PolicyComplianceException("Error occurred reading the applied policies to devices.", e);
|
throw new PolicyComplianceException("Error occurred reading the applied policies to devices.", e);
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
PolicyManagementDAOFactory.rollbackTransaction();
|
||||||
|
throw new PolicyComplianceException("Error occurred while adding monitoring operation to DB.");
|
||||||
} finally {
|
} finally {
|
||||||
PolicyManagementDAOFactory.closeConnection();
|
PolicyManagementDAOFactory.closeConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addMonitoringOperationsToDatabase(List<Device> devices)
|
private void addMonitoringOperationsToDatabase(List<Device> devices)
|
||||||
throws PolicyComplianceException, OperationManagementException {
|
throws PolicyComplianceException, OperationManagementException, DeviceManagementException {
|
||||||
|
|
||||||
List<DeviceIdentifier> deviceIdentifiers = this.getDeviceIdentifiersFromDevices(devices);
|
List<DeviceIdentifier> deviceIdentifiers = this.getDeviceIdentifiersFromDevices(devices);
|
||||||
CommandOperation monitoringOperation = new CommandOperation();
|
CommandOperation monitoringOperation = new CommandOperation();
|
||||||
@ -308,9 +311,10 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
monitoringOperation.setCode(OPERATION_MONITOR);
|
monitoringOperation.setCode(OPERATION_MONITOR);
|
||||||
|
|
||||||
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
|
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
|
||||||
|
if (service == null) {
|
||||||
|
throw new DeviceManagementException("Error occurred while retrieving Device Management Service");
|
||||||
|
}
|
||||||
service.addOperation(monitoringOperation, deviceIdentifiers);
|
service.addOperation(monitoringOperation, deviceIdentifiers);
|
||||||
// PolicyManagementDataHolder.getInstance().getDeviceManagementService().
|
|
||||||
// addOperation(monitoringOperation, deviceIdentifiers);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<DeviceIdentifier> getDeviceIdentifiersFromDevices(List<Device> devices) {
|
private List<DeviceIdentifier> getDeviceIdentifiersFromDevices(List<Device> devices) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user