From ceab2566acb5f61e631dca08993734cbb86f3806 Mon Sep 17 00:00:00 2001 From: Ace Date: Mon, 7 Dec 2020 13:27:57 +0530 Subject: [PATCH] Addressing review comments --- .../core/dao/impl/AbstractDeviceDAOImpl.java | 18 +++++++++++------- .../HeartBeatManagementServiceImpl.java | 1 + components/heartbeat-management/pom.xml | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java index 996dca889e..29ce88f342 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java @@ -788,7 +788,9 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } } } catch (SQLException e) { - throw new DeviceManagementDAOException("Error occurred while listing devices for type '" + type + "'", e); + String msg = "Error occurred while listing devices for type '" + type + "'"; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); } finally { DeviceManagementDAOUtil.cleanupResources(stmt, rs); } @@ -846,15 +848,17 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { } } } catch (Exception e) { - log.error("Error encountered while populating allocated active devices for server with index : " + serverIndex + - " active-server-count " + activeServerCount + " device-type " + type + " tenant-id " + tenantId); - throw new DeviceManagementDAOException("Error occurred while populating active devices '" + type + "'", e); + String msg = "Error encountered while populating allocated active devices for server with index : " + serverIndex + + " active-server-count " + activeServerCount + " device-type " + type + " tenant-id " + tenantId; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); } } } catch (SQLException e) { - log.error("Error encountered while retrieving allocated devices for server with index : " + serverIndex + - " active-server-count " + activeServerCount + " device-type " + type + " tenant-id " + tenantId); - throw new DeviceManagementDAOException("Error occurred while listing devices for type '" + type + "'", e); + String msg = "Error encountered while retrieving allocated devices for server with index : " + serverIndex + + " active-server-count " + activeServerCount + " device-type " + type + " tenant-id " + tenantId; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); } return devices; } diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java index 4281a6bc58..1c312e5368 100644 --- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java +++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java @@ -283,6 +283,7 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic } } catch (HeartBeatDAOException e) { String msg = "Error occurred while recording heart beat."; + log.error(msg); throw new HeartBeatManagementException(msg, e); } catch (TransactionManagementException e) { HeartBeatBeaconDAOFactory.rollbackTransaction(); diff --git a/components/heartbeat-management/pom.xml b/components/heartbeat-management/pom.xml index d00863f18e..1143f7e4d7 100644 --- a/components/heartbeat-management/pom.xml +++ b/components/heartbeat-management/pom.xml @@ -30,7 +30,7 @@ heartbeat-management pom Entgra - Task Allocation Framework - http://wso2.org + http://entgra.io io.entgra.server.bootup.heartbeat.beacon