diff options
author | ramverma <ram.krishna.verma@ericsson.com> | 2018-09-09 14:24:10 +0100 |
---|---|---|
committer | ramverma <ram.krishna.verma@ericsson.com> | 2018-09-09 21:30:40 +0100 |
commit | 0afa5b5791c0ac739b980cf53f77e11bc1d3a0da (patch) | |
tree | 1e8814f33d2ded011b47b36bc0d3a29f8f929b8e /plugins/reception-plugins/src | |
parent | ed51ed0f7f1f479e394634de9ffb0778de4ea307 (diff) |
Fixing sonar bugs in distribution
Change-Id: I3ec5c73c54145b1ba9f637eaa95c843e25f46a10
Issue-ID: POLICY-1035
Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'plugins/reception-plugins/src')
-rw-r--r-- | plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandlerConfigurationParameterGroup.java | 199 |
1 files changed, 99 insertions, 100 deletions
diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandlerConfigurationParameterGroup.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandlerConfigurationParameterGroup.java index ce925bb7..08fd707c 100644 --- a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandlerConfigurationParameterGroup.java +++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandlerConfigurationParameterGroup.java @@ -22,15 +22,15 @@ package org.onap.policy.distribution.reception.handling.sdc; import java.util.List; import java.util.UUID; + import org.onap.policy.common.parameters.GroupValidationResult; import org.onap.policy.common.parameters.ValidationStatus; import org.onap.policy.common.utils.validation.ParameterValidationUtils; import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup; /** - * This class handles reading, parsing and validating of the Policy SDC Service Distribution - * parameters from Json format, which strictly adheres to the interface:IConfiguration, defined by - * SDC SDK. + * This class handles reading, parsing and validating of the Policy SDC Service Distribution parameters from Json + * format, which strictly adheres to the interface:IConfiguration, defined by SDC SDK. */ public class SdcReceptionHandlerConfigurationParameterGroup extends ReceptionHandlerConfigurationParameterGroup { @@ -52,6 +52,100 @@ public class SdcReceptionHandlerConfigurationParameterGroup extends ReceptionHan private boolean isUseHttpsWithDmaap; /** + * The constructor for instantiating {@link SdcReceptionHandlerConfigurationParameterGroup} class. + * + * @param builder the SDC configuration builder + */ + private SdcReceptionHandlerConfigurationParameterGroup(final SdcConfigurationBuilder builder) { + asdcAddress = builder.asdcAddress; + messageBusAddress = builder.messageBusAddress; + user = builder.user; + password = builder.password; + pollingInterval = builder.pollingInterval; + pollingTimeout = builder.pollingTimeout; + consumerId = builder.consumerId; + artifactTypes = builder.artifactTypes; + consumerGroup = builder.consumerGroup; + environmentName = builder.environmentName; + keyStorePath = builder.keystorePath; + keyStorePassword = builder.keystorePassword; + activeServerTlsAuth = builder.activeserverTlsAuth; + isFilterInEmptyResources = builder.isFilterinEmptyResources; + isUseHttpsWithDmaap = builder.isUseHttpsWithDmaap; + + } + + public String getAsdcAddress() { + return asdcAddress; + } + + public List<String> getMessageBusAddress() { + return messageBusAddress; + } + + public String getUser() { + return user; + } + + public String getPassword() { + return password; + } + + public int getPollingInterval() { + return pollingInterval; + } + + public int getPollingTimeout() { + return pollingTimeout; + } + + public String getConsumerId() { + return consumerId; + } + + public List<String> getArtifactTypes() { + return artifactTypes; + } + + public String getConsumerGroup() { + return consumerGroup; + } + + public String getEnvironmentName() { + return environmentName; + } + + public String getKeyStorePassword() { + return keyStorePassword; + } + + public boolean isActiveServerTlsAuth() { + return activeServerTlsAuth; + } + + public String getKeyStorePath() { + return keyStorePath; + } + + public boolean isFilterInEmptyResources() { + return isFilterInEmptyResources; + } + + public boolean isUseHttpsWithDmaap() { + return isUseHttpsWithDmaap; + } + + /** + * Set the name of this group. + * + * @param name the name to set. + */ + @Override + public void setName(final String name) { + super.setName(name + "_" + UUID.randomUUID().toString()); + } + + /** * Inner static class is to used as a Builder. * */ @@ -148,7 +242,7 @@ public class SdcReceptionHandlerConfigurationParameterGroup extends ReceptionHan } /** - * Creates a new PssdConfigurationParametersGroup instance. + * Creates an instance of {@link SdcReceptionHandlerConfigurationParameterGroup}. */ public SdcReceptionHandlerConfigurationParameterGroup build() { return new SdcReceptionHandlerConfigurationParameterGroup(this); @@ -156,91 +250,6 @@ public class SdcReceptionHandlerConfigurationParameterGroup extends ReceptionHan } /** - * The constructor for instantiating PssdConfigurationParametersGroup. It is kept private so - * that it could only be called by PssdConfigurationBuilder. - * - * @param builder stores all the values used by PssdConfigurationParametersGroup - */ - private SdcReceptionHandlerConfigurationParameterGroup(final SdcConfigurationBuilder builder) { - asdcAddress = builder.asdcAddress; - messageBusAddress = builder.messageBusAddress; - user = builder.user; - password = builder.password; - pollingInterval = builder.pollingInterval; - pollingTimeout = builder.pollingTimeout; - consumerId = builder.consumerId; - artifactTypes = builder.artifactTypes; - consumerGroup = builder.consumerGroup; - environmentName = builder.environmentName; - keyStorePath = builder.keystorePath; - keyStorePassword = builder.keystorePassword; - activeServerTlsAuth = builder.activeserverTlsAuth; - isFilterInEmptyResources = builder.isFilterinEmptyResources; - isUseHttpsWithDmaap = builder.isUseHttpsWithDmaap; - - } - - public String getAsdcAddress() { - return asdcAddress; - } - - public List<String> getMessageBusAddress() { - return messageBusAddress; - } - - public String getUser() { - return user; - } - - public String getPassword() { - return password; - } - - public int getPollingInterval() { - return pollingInterval; - } - - public int getPollingTimeout() { - return pollingTimeout; - } - - public String getConsumerId() { - return consumerId; - } - - public List<String> getArtifactTypes() { - return artifactTypes; - } - - public String getConsumerGroup() { - return consumerGroup; - } - - public String getEnvironmentName() { - return environmentName; - } - - public String getKeyStorePassword() { - return keyStorePassword; - } - - public boolean isActiveServerTlsAuth() { - return activeServerTlsAuth; - } - - public String getKeyStorePath() { - return keyStorePath; - } - - public boolean isFilterInEmptyResources() { - return isFilterInEmptyResources; - } - - public boolean isUseHttpsWithDmaap() { - return isUseHttpsWithDmaap; - } - - /** * {@inheritDoc} */ @Override @@ -250,16 +259,6 @@ public class SdcReceptionHandlerConfigurationParameterGroup extends ReceptionHan } /** - * Set the name of this group. - * - * @param name the name to set. - */ - @Override - public void setName(final String name) { - super.setName(name + "_" + UUID.randomUUID().toString()); - } - - /** * {@inheritDoc} */ @Override @@ -324,7 +323,7 @@ public class SdcReceptionHandlerConfigurationParameterGroup extends ReceptionHan */ private void validateStringElement(final GroupValidationResult validationResult, final String element, final String elementName) { - if (!ParameterValidationUtils.validateStringParameter(asdcAddress)) { + if (!ParameterValidationUtils.validateStringParameter(element)) { validationResult.setResult(elementName, ValidationStatus.INVALID, elementName + " must be a non-blank string"); } |