<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.dmaap.messagerouter.msgrtr</groupId>
<artifactId>msgrtr</artifactId>
- <version>1.1.19-SNAPSHOT</version>
+ <version>1.1.20-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dmaap-messagerouter-msgrtr</name>
<description>Message Router - Restful interface built for kafka</description>
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;
throw new DMaaPAccessDeniedException(errRes);
}
- } else if( null != metaTopic.getOwner() && !metaTopic.getOwner().isEmpty()) {
+ } else if( null!=metaTopic&& null != metaTopic.getOwner() && !metaTopic.getOwner().isEmpty()) {
final NsaApiKey user = DMaaPAuthenticatorImpl.getAuthenticatedUser(ctx);
if(SUBSCRIBE_ACTION.equals(action)) {
metaTopic.checkUserRead(user);
private int getMessageTimeout(HttpServletRequest request) {
String timeoutMsAsString = getPropertyFromAJSCmap(TIMEOUT_PROPERTY);
- int defaultTimeoutMs = StringUtils.isNotEmpty(timeoutMsAsString) ? NumberUtils.toInt(timeoutMsAsString, CambriaConstants.kNoTimeout) :
+ int defaultTimeoutMs = timeoutMsAsString!=null ? NumberUtils.toInt(timeoutMsAsString, CambriaConstants.kNoTimeout) :
CambriaConstants.kNoTimeout;
String timeoutProperty = request.getParameter(TIMEOUT_PROPERTY);
private boolean isTopicNameEnforcedAaf(String topicName) {
String topicNameStd = getPropertyFromAJSCmap("enforced.topic.name.AAF");
- return StringUtils.isNotEmpty(topicNameStd) && topicName.startsWith(topicNameStd);
+ return !topicNameStd.isEmpty() && topicName.startsWith(topicNameStd);
}
private boolean isCacheEnabled() {
String cachePropsSetting = getPropertyFromAJSCmap(ConsumerFactory.kSetting_EnableCache);
- return StringUtils.isNotEmpty(cachePropsSetting) ? Boolean.parseBoolean(cachePropsSetting) : ConsumerFactory.kDefault_IsCacheEnabled;
+ return !cachePropsSetting.isEmpty() ? Boolean.parseBoolean(cachePropsSetting) : ConsumerFactory.kDefault_IsCacheEnabled;
}
private void verifyHostId() {
String lhostId = getPropertyFromAJSCmap("clusterhostid");
- if (StringUtils.isEmpty(lhostId)) {
+ if (lhostId.isEmpty()) {
try {
InetAddress.getLocalHost().getCanonicalHostName();
} catch (UnknownHostException e) {
private String getMetricTopicName() {
String metricTopicFromProps = getPropertyFromAJSCmap("metrics.send.cambria.topic");
- return StringUtils.isNotEmpty(metricTopicFromProps) ? metricTopicFromProps : "msgrtr.apinode.metrics.dmaap";
+ return !metricTopicFromProps.isEmpty() ? metricTopicFromProps : "msgrtr.apinode.metrics.dmaap";
}
/**
}
private boolean isTransactionIdRequired() {
- String transIdReqProperty = getPropertyFromAJSCmap("transidUEBtopicreqd");
- return StringUtils.isNotEmpty(transIdReqProperty) && transIdReqProperty.equalsIgnoreCase("true");
+ return getPropertyFromAJSCmap("transidUEBtopicreqd").equalsIgnoreCase("true");
}
/**