diff options
author | pwielebs <piotr.wielebski@nokia.com> | 2018-09-04 09:44:33 +0200 |
---|---|---|
committer | pwielebs <piotr.wielebski@nokia.com> | 2018-09-04 09:44:33 +0200 |
commit | a4c979b6de8c1c76f0f12ae2b8dd0e60c3084830 (patch) | |
tree | 5fd8eca8889fb37000b834128fdd742dc05664df /prh-app-server/src | |
parent | 3737046ff3c8e032257b257912778403fc058ee0 (diff) |
Fixing code issues
1. SonarIssues
2. CheckStyle corrections
3. Empty code deletions
4. Adding AAIHeaders config to cloud configurations
Change-Id: Id624c52bc7f57338fad5276fffd9f29b21af2f69
Issue-ID: DCAEGEN2-606
Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src')
4 files changed, 9 insertions, 7 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfiguration.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfiguration.java index 11c75e80..10626a32 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfiguration.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfiguration.java @@ -26,6 +26,7 @@ import java.util.Properties; import org.onap.dcaegen2.services.prh.config.AaiClientConfiguration; import org.onap.dcaegen2.services.prh.config.DmaapConsumerConfiguration; import org.onap.dcaegen2.services.prh.config.DmaapPublisherConfiguration; +import org.onap.dcaegen2.services.prh.config.ImmutableAaiClientConfiguration; import org.onap.dcaegen2.services.prh.model.EnvProperties; import org.onap.dcaegen2.services.prh.service.PrhConfigurationProvider; import org.slf4j.Logger; @@ -99,7 +100,9 @@ public class CloudConfiguration extends AppConfig { @Override public AaiClientConfiguration getAaiClientConfiguration() { - return Optional.ofNullable(aaiClientCloudConfiguration).orElse(super.getAaiClientConfiguration()); + return Optional.ofNullable(ImmutableAaiClientConfiguration.copyOf(aaiClientCloudConfiguration) + .withAaiHeaders(aaiClientConfiguration.aaiHeaders())) + .orElse(ImmutableAaiClientConfiguration.copyOf(super.getAaiClientConfiguration())); } @Override diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/PrhConfigurationProvider.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/PrhConfigurationProvider.java index 414c5a34..c80ecfaf 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/PrhConfigurationProvider.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/PrhConfigurationProvider.java @@ -59,7 +59,7 @@ public class PrhConfigurationProvider { LOGGER.info("Retrieving Config Binding Service endpoint from Consul"); try { return httpGetClient.callHttpGet(getConsulUrl(envProperties), JsonArray.class) - .flatMap(jsonArray -> this.createConfigBindingserviceurl(jsonArray, envProperties.appName())); + .flatMap(jsonArray -> this.createConfigBindingServiceUrl(jsonArray, envProperties.appName())); } catch (URISyntaxException e) { LOGGER.warn("Malformed Consul uri", e); return Mono.error(e); @@ -77,12 +77,12 @@ public class PrhConfigurationProvider { } - private Mono<String> createConfigBindingserviceurl(JsonArray jsonArray, String appName) { + private Mono<String> createConfigBindingServiceUrl(JsonArray jsonArray, String appName) { return getConfigBindingObject(jsonArray) - .flatMap(jsonObject -> buildConfigBindingserviceurl(jsonObject, appName)); + .flatMap(jsonObject -> buildConfigBindingServiceUrl(jsonObject, appName)); } - private Mono<String> buildConfigBindingserviceurl(JsonObject jsonObject, String appName) { + private Mono<String> buildConfigBindingServiceUrl(JsonObject jsonObject, String appName) { try { return Mono.just(getUri(jsonObject.get("ServiceAddress").getAsString(), jsonObject.get("ServicePort").getAsInt(), "/service_component", appName)); diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTask.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTask.java index d322a43e..a6baf4a5 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTask.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTask.java @@ -43,6 +43,6 @@ abstract class DmaapConsumerTask { protected abstract Mono<ConsumerDmaapModel> execute(String object); WebClient buildWebClient() { - return new DMaaPReactiveWebClient().fromConfiguration(resolveConfiguration()).build(); + return new DMaaPReactiveWebClient().build(); } } diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java index 728c0dae..92d810ff 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java @@ -20,7 +20,6 @@ package org.onap.dcaegen2.services.prh.tasks; - import static org.onap.dcaegen2.services.prh.model.logging.MdcVariables.INSTANCE_UUID; import static org.onap.dcaegen2.services.prh.model.logging.MdcVariables.RESPONSE_CODE; |