From d54d78a02bd269a401fb537a8cbaf5c9a499883a Mon Sep 17 00:00:00 2001 From: charitha Date: Mon, 20 Aug 2018 21:16:08 +0530 Subject: [PATCH] Refactoring --- .../analytics/data/publisher/DataPublisherUtil.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherUtil.java index f810ecbd7b..1d65b3092e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherUtil.java @@ -18,6 +18,8 @@ */ package org.wso2.carbon.device.mgt.analytics.data.publisher; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; import org.wso2.carbon.databridge.agent.exception.DataEndpointConfigurationException; import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; @@ -32,6 +34,8 @@ import java.util.regex.Pattern; public class DataPublisherUtil { + private static final Log log = LogFactory.getLog(DataPublisherUtil.class); + private DataPublisherUtil(){ } @@ -76,8 +80,10 @@ public class DataPublisherUtil { } if (isLBURL && isFailOverURL) { - throw new DataEndpointConfigurationException("Invalid data endpoints URL set provided : " + aURLGroup + - ", a URL group can be configured as failover OR load balancing endpoints."); + String msg = "Invalid data endpoints URL set provided : " + aURLGroup + + ", a URL group can be configured as failover OR load balancing endpoints."; + log.error(msg); + throw new DataEndpointConfigurationException(msg); } else { String[] urls; if (isLBURL) {