diff options
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java')
-rw-r--r-- | policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java index b0c456da..6a9a2d6d 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java @@ -79,8 +79,7 @@ public class SingleThreadedDmaapTopicSource extends SingleThreadedBusTopicSource int fetchTimeout, int fetchLimit, String environment, String aftEnvironment, String partner, String latitude, String longitude, Map<String,String> additionalProps, - boolean useHttps, boolean allowSelfSignedCerts) - throws IllegalArgumentException { + boolean useHttps, boolean allowSelfSignedCerts) { super(servers, topic, apiKey, apiSecret, consumerGroup, consumerInstance, @@ -123,8 +122,7 @@ public class SingleThreadedDmaapTopicSource extends SingleThreadedBusTopicSource String apiKey, String apiSecret, String userName, String password, String consumerGroup, String consumerInstance, - int fetchTimeout, int fetchLimit, boolean useHttps, boolean allowSelfSignedCerts) - throws IllegalArgumentException { + int fetchTimeout, int fetchLimit, boolean useHttps, boolean allowSelfSignedCerts) { super(servers, topic, apiKey, apiSecret, @@ -148,19 +146,14 @@ public class SingleThreadedDmaapTopicSource extends SingleThreadedBusTopicSource */ @Override public void init() throws MalformedURLException { - if (this.userName == null || this.userName.isEmpty() || - this.password == null || this.password.isEmpty()) { + if (anyNullOrEmpty(this.userName, this.password)) { this.consumer = new BusConsumer.CambriaConsumerWrapper(this.servers, this.topic, this.apiKey, this.apiSecret, this.consumerGroup, this.consumerInstance, this.fetchTimeout, this.fetchLimit, this.useHttps, this.allowSelfSignedCerts); - } else if ((this.environment == null || this.environment.isEmpty()) && - (this.aftEnvironment == null || this.aftEnvironment.isEmpty()) && - (this.latitude == null || this.latitude.isEmpty()) && - (this.longitude == null || this.longitude.isEmpty()) && - (this.partner == null || this.partner.isEmpty())) { + } else if (allNullOrEmpty(this.environment, this.aftEnvironment, this.latitude, this.longitude, this.partner)) { this.consumer = new BusConsumer.CambriaConsumerWrapper(this.servers, this.topic, this.apiKey, this.apiSecret, |