diff options
author | Jim Hahn <jrh3@att.com> | 2021-06-29 15:17:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-06-29 15:17:11 +0000 |
commit | 77aa9bc1f763e4de8d0b46fefa211e6018303514 (patch) | |
tree | f0bca729dde4ac985285386c6139610aafa04199 /participant/participant-impl/participant-impl-simulator/src/main/java | |
parent | fef5b8c6cf7b5999d4ca9b3dbd65121b73076d01 (diff) | |
parent | 7f7f0c5790dc63e43a59c53154e796239ab34cbb (diff) |
Merge "Convert Intermediary Participant to Spring and refactor Participants"
Diffstat (limited to 'participant/participant-impl/participant-impl-simulator/src/main/java')
3 files changed, 6 insertions, 24 deletions
diff --git a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/ParticipantSimulatorApplication.java b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/ParticipantSimulatorApplication.java index 9f6e4aa4b..8267df477 100644 --- a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/ParticipantSimulatorApplication.java +++ b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/ParticipantSimulatorApplication.java @@ -23,6 +23,7 @@ package org.onap.policy.clamp.controlloop.participant.simulator; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
+import org.springframework.context.annotation.ComponentScan;
/**
* Starter.
@@ -30,6 +31,8 @@ import org.springframework.boot.context.properties.ConfigurationPropertiesScan; */
@SpringBootApplication
@ConfigurationPropertiesScan("org.onap.policy.clamp.controlloop.participant.simulator.main.parameters")
+@ComponentScan({"org.onap.policy.clamp.controlloop.participant.simulator",
+ "org.onap.policy.clamp.controlloop.participant.intermediary"})
public class ParticipantSimulatorApplication {
public static void main(String[] args) {
diff --git a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/config/ParticipantConfig.java b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/config/ParticipantConfig.java index f4e6791ec..c890ec247 100644 --- a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/config/ParticipantConfig.java +++ b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/config/ParticipantConfig.java @@ -20,9 +20,6 @@ package org.onap.policy.clamp.controlloop.participant.simulator.config; -import org.onap.policy.clamp.controlloop.participant.intermediary.api.ParticipantIntermediaryApi; -import org.onap.policy.clamp.controlloop.participant.intermediary.api.ParticipantIntermediaryFactory; -import org.onap.policy.clamp.controlloop.participant.simulator.main.parameters.ParticipantSimulatorParameters; import org.onap.policy.clamp.controlloop.participant.simulator.main.rest.RequestResponseLoggingFilter; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; @@ -32,19 +29,6 @@ import org.springframework.context.annotation.Configuration; public class ParticipantConfig { /** - * Create ParticipantIntermediaryApi. - * - * @param parameters the Participant Dcae Parameters - * @return ParticipantIntermediaryApi - */ - @Bean - public ParticipantIntermediaryApi participantIntermediaryApi(ParticipantSimulatorParameters parameters) { - ParticipantIntermediaryApi intermediaryApi = new ParticipantIntermediaryFactory().createApiImplementation(); - intermediaryApi.init(parameters.getIntermediaryParameters()); - return intermediaryApi; - } - - /** * logging Filter configuration. * * @return FilterRegistrationBean diff --git a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/ParticipantSimulatorParameters.java b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/ParticipantSimulatorParameters.java index 5110ac6a6..99579006c 100644 --- a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/ParticipantSimulatorParameters.java +++ b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/ParticipantSimulatorParameters.java @@ -25,8 +25,7 @@ import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; import org.onap.policy.clamp.controlloop.participant.intermediary.parameters.ParticipantIntermediaryParameters; -import org.onap.policy.common.parameters.validation.ParameterGroupConstraint; -import org.onap.policy.models.provider.PolicyModelsProviderParameters; +import org.onap.policy.clamp.controlloop.participant.intermediary.parameters.ParticipantParameters; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; @@ -38,13 +37,9 @@ import org.springframework.validation.annotation.Validated; @Getter @Setter @ConfigurationProperties(prefix = "participant") -public class ParticipantSimulatorParameters { +public class ParticipantSimulatorParameters implements ParticipantParameters { - @NotNull @Valid - private ParticipantIntermediaryParameters intermediaryParameters; - @NotNull - @ParameterGroupConstraint - private PolicyModelsProviderParameters databaseProviderParameters; + private ParticipantIntermediaryParameters intermediaryParameters; } |