diff options
author | Tomek Kaminski <tomasz.kaminski@nokia.com> | 2019-07-26 13:41:01 +0200 |
---|---|---|
committer | Tomek Kaminski <tomasz.kaminski@nokia.com> | 2019-07-26 13:41:01 +0200 |
commit | 006e0ab43c9b11266ef079dfb8e17f27d01d7e16 (patch) | |
tree | 5a3eccf7179dbedc07369fb72237fdf92b17e138 /src/main | |
parent | bceb38a3a8ff0b4d80210724e339905bc714891d (diff) |
Fix failing build
Issue-ID: DMAAP-1249
Signed-off-by: Tomek Kaminski <tomasz.kaminski@nokia.com>
Change-Id: Iccef8315664a7c15e9a42866b58c6a10967f3b40
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java b/src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java index ec5bfc0..93c7f36 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java @@ -41,6 +41,7 @@ import java.util.Date; import java.util.LinkedList; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.MediaType; +import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; import org.apache.http.HttpStatus; import org.apache.kafka.clients.producer.ProducerRecord; @@ -264,7 +265,7 @@ public class EventsServiceImpl implements EventsService { private int getMessageTimeout(HttpServletRequest request) { String timeoutMsAsString = getPropertyFromAJSCmap(TIMEOUT_PROPERTY); - int defaultTimeoutMs = timeoutMsAsString!=null ? NumberUtils.toInt(timeoutMsAsString, CambriaConstants.kNoTimeout) : + int defaultTimeoutMs = StringUtils.isNotEmpty(timeoutMsAsString) ? NumberUtils.toInt(timeoutMsAsString, CambriaConstants.kNoTimeout) : CambriaConstants.kNoTimeout; String timeoutProperty = request.getParameter(TIMEOUT_PROPERTY); @@ -281,17 +282,17 @@ public class EventsServiceImpl implements EventsService { private boolean isTopicNameEnforcedAaf(String topicName) { String topicNameStd = getPropertyFromAJSCmap("enforced.topic.name.AAF"); - return !topicNameStd.isEmpty() && topicName.startsWith(topicNameStd); + return StringUtils.isNotEmpty(topicNameStd) && topicName.startsWith(topicNameStd); } private boolean isCacheEnabled() { String cachePropsSetting = getPropertyFromAJSCmap(ConsumerFactory.kSetting_EnableCache); - return !cachePropsSetting.isEmpty() ? Boolean.parseBoolean(cachePropsSetting) : ConsumerFactory.kDefault_IsCacheEnabled; + return StringUtils.isNotEmpty(cachePropsSetting) ? Boolean.parseBoolean(cachePropsSetting) : ConsumerFactory.kDefault_IsCacheEnabled; } private void verifyHostId() { String lhostId = getPropertyFromAJSCmap("clusterhostid"); - if (lhostId.isEmpty()) { + if (StringUtils.isEmpty(lhostId)) { try { InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { @@ -303,7 +304,7 @@ public class EventsServiceImpl implements EventsService { private String getMetricTopicName() { String metricTopicFromProps = getPropertyFromAJSCmap("metrics.send.cambria.topic"); - return !metricTopicFromProps.isEmpty() ? metricTopicFromProps : "msgrtr.apinode.metrics.dmaap"; + return StringUtils.isNotEmpty(metricTopicFromProps) ? metricTopicFromProps : "msgrtr.apinode.metrics.dmaap"; } /** @@ -360,7 +361,8 @@ public class EventsServiceImpl implements EventsService { } private boolean isTransactionIdRequired() { - return getPropertyFromAJSCmap("transidUEBtopicreqd").equalsIgnoreCase("true"); + String transIdReqProperty = getPropertyFromAJSCmap("transidUEBtopicreqd"); + return StringUtils.isNotEmpty(transIdReqProperty) && transIdReqProperty.equalsIgnoreCase("true"); } /** |