Merge pull request #939 from harshanL/master

Fixes for product-iots#1367 and product-iots#1285
revert-70aa11f8
Kamidu Sachith Punchihewa 7 years ago committed by GitHub
commit 8d880c50bd

@ -350,7 +350,9 @@ public class DeviceManagementPluginRepository implements DeviceManagerStartupLis
if (deviceStatusTaskPluginConfig != null && deviceStatusTaskPluginConfig.isRequireStatusMonitoring()) { if (deviceStatusTaskPluginConfig != null && deviceStatusTaskPluginConfig.isRequireStatusMonitoring()) {
try { try {
DeviceManagementDataHolder.getInstance().removeDeviceStatusTaskPluginConfig(deviceType); DeviceManagementDataHolder.getInstance().removeDeviceStatusTaskPluginConfig(deviceType);
deviceStatusTaskManagerService.stopTask(deviceType, deviceStatusTaskPluginConfig); if (deviceStatusTaskManagerService != null) {
deviceStatusTaskManagerService.stopTask(deviceType, deviceStatusTaskPluginConfig);
}
} catch (DeviceStatusTaskException e) { } catch (DeviceStatusTaskException e) {
throw new DeviceManagementException("Error occurred while stopping Device Status task service for '" + throw new DeviceManagementException("Error occurred while stopping Device Status task service for '" +
deviceManagementService.getType() + "'", e); deviceManagementService.getType() + "'", e);

@ -2333,8 +2333,14 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
DeviceManagementDAOFactory.openConnection(); DeviceManagementDAOFactory.openConnection();
info = deviceInfoDAO.getDeviceInformation(device.getId()); info = deviceInfoDAO.getDeviceInformation(device.getId());
DeviceLocation location = deviceInfoDAO.getDeviceLocation(device.getId()); DeviceLocation location = deviceInfoDAO.getDeviceLocation(device.getId());
if (info != null) { if (location != null) {
info.setLocation(location); //There are some cases where the device-info is not updated properly. Hence returning a null value.
if (info != null) {
info.setLocation(location);
} else {
info = new DeviceInfo();
info.setLocation(location);
}
} }
} catch (DeviceDetailsMgtDAOException e) { } catch (DeviceDetailsMgtDAOException e) {
String msg = "Error occurred while retrieving advance info of '" + device.getType() + String msg = "Error occurred while retrieving advance info of '" + device.getType() +

Loading…
Cancel
Save