diff options
author | Parshad Patel <pars.patel@samsung.com> | 2019-04-10 16:43:34 +0900 |
---|---|---|
committer | Parshad Patel <pars.patel@samsung.com> | 2019-04-10 16:43:46 +0900 |
commit | 274a2398e0fd209c5589979beb3c4d339e592d80 (patch) | |
tree | 90f1994132e6418af3c6b3517d75166e6bce6571 /dcae-analytics-dmaap/src/main | |
parent | 032a765013bf6b0e23aca59aac2343c2d1903aec (diff) |
Fix sonar issues in dcaegen2-analytics-tca4.0.0-ONAPdublin
Fix Constructor has 9 parameters, which is greater than 7 authorized
Fix Constructor has 11 parameters, which is greater than 7 authorized
Issue-ID: DCAEGEN2-1384
Change-Id: Ifb91cb5e70ad824d5c0935ac33cbb45936e0ba56
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'dcae-analytics-dmaap/src/main')
2 files changed, 24 insertions, 44 deletions
diff --git a/dcae-analytics-dmaap/src/main/java/org/onap/dcae/apod/analytics/dmaap/domain/config/DMaaPMRPublisherConfig.java b/dcae-analytics-dmaap/src/main/java/org/onap/dcae/apod/analytics/dmaap/domain/config/DMaaPMRPublisherConfig.java index 8dfc289..e5e67e6 100644 --- a/dcae-analytics-dmaap/src/main/java/org/onap/dcae/apod/analytics/dmaap/domain/config/DMaaPMRPublisherConfig.java +++ b/dcae-analytics-dmaap/src/main/java/org/onap/dcae/apod/analytics/dmaap/domain/config/DMaaPMRPublisherConfig.java @@ -47,24 +47,16 @@ public class DMaaPMRPublisherConfig extends DMaaPMRBaseConfig { private int maxRecoveryQueueSize; - private DMaaPMRPublisherConfig(@Nonnull String hostName, - @Nonnull Integer portNumber, - @Nonnull String topicName, - @Nonnull String protocol, - String userName, - String userPassword, - @Nonnull String contentType, - int maxBatchSize, - int maxRecoveryQueueSize) { - this.hostName = hostName; - this.portNumber = portNumber; - this.topicName = topicName; - this.protocol = protocol; - this.userName = userName; - this.userPassword = userPassword; - this.contentType = contentType; - this.maxBatchSize = maxBatchSize; - this.maxRecoveryQueueSize = maxRecoveryQueueSize; + private DMaaPMRPublisherConfig(Builder builder) { + this.hostName = builder.hostName; + this.portNumber = builder.portNumber; + this.topicName = builder.topicName; + this.protocol = builder.protocol; + this.userName = builder.userName; + this.userPassword = builder.userPassword; + this.contentType = builder.contentType; + this.maxBatchSize = builder.maxBatchSize; + this.maxRecoveryQueueSize = builder.maxRecoveryQueueSize; } @@ -189,8 +181,7 @@ public class DMaaPMRPublisherConfig extends DMaaPMRBaseConfig { * @return Builds and returns thread safe, immutable {@link DMaaPMRPublisherConfig} object */ public DMaaPMRPublisherConfig build() { - return new DMaaPMRPublisherConfig(hostName, portNumber, topicName, protocol, userName, userPassword, - contentType, maxBatchSize, maxRecoveryQueueSize); + return new DMaaPMRPublisherConfig(this); } } diff --git a/dcae-analytics-dmaap/src/main/java/org/onap/dcae/apod/analytics/dmaap/domain/config/DMaaPMRSubscriberConfig.java b/dcae-analytics-dmaap/src/main/java/org/onap/dcae/apod/analytics/dmaap/domain/config/DMaaPMRSubscriberConfig.java index 8158b6b..ee988a2 100644 --- a/dcae-analytics-dmaap/src/main/java/org/onap/dcae/apod/analytics/dmaap/domain/config/DMaaPMRSubscriberConfig.java +++ b/dcae-analytics-dmaap/src/main/java/org/onap/dcae/apod/analytics/dmaap/domain/config/DMaaPMRSubscriberConfig.java @@ -43,28 +43,18 @@ public final class DMaaPMRSubscriberConfig extends DMaaPMRBaseConfig { private final Integer timeoutMS; private final Integer messageLimit; - private DMaaPMRSubscriberConfig(@Nonnull String hostName, - @Nonnull Integer portNumber, - @Nonnull String topicName, - @Nonnull String protocol, - String userName, - String userPassword, - @Nonnull String contentType, - @Nonnull String consumerId, - @Nonnull String consumerGroup, - @Nonnull Integer timeoutMS, - @Nonnull Integer messageLimit) { - this.hostName = hostName; - this.portNumber = portNumber; - this.topicName = topicName; - this.protocol = protocol; - this.userName = userName; - this.userPassword = userPassword; - this.contentType = contentType; - this.consumerId = consumerId; - this.consumerGroup = consumerGroup; - this.timeoutMS = timeoutMS; - this.messageLimit = messageLimit; + private DMaaPMRSubscriberConfig(Builder builder) { + this.hostName = builder.hostName; + this.portNumber = builder.portNumber; + this.topicName = builder.topicName; + this.protocol = builder.protocol; + this.userName = builder.userName; + this.userPassword = builder.userPassword; + this.contentType = builder.contentType; + this.consumerId = builder.consumerId; + this.consumerGroup = builder.consumerGroup; + this.timeoutMS = builder.timeoutMS; + this.messageLimit = builder.messageLimit; } /** @@ -215,8 +205,7 @@ public final class DMaaPMRSubscriberConfig extends DMaaPMRBaseConfig { * @return immutable DMaaP Subscriber Config Object */ public DMaaPMRSubscriberConfig build() { - return new DMaaPMRSubscriberConfig(hostName, portNumber, topicName, protocol, userName, userPassword, - contentType, consumerId, consumerGroup, timeoutMS, messageLimit); + return new DMaaPMRSubscriberConfig(this); } } |