summaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-policy/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'participant/participant-impl/participant-impl-policy/src/main')
-rw-r--r--participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/config/ParticipantConfig.java24
-rw-r--r--participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/ParticipantPolicyParameters.java4
2 files changed, 11 insertions, 17 deletions
diff --git a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/config/ParticipantConfig.java b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/config/ParticipantConfig.java
index 3b8324151..7b49a9a6b 100644
--- a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/config/ParticipantConfig.java
+++ b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/config/ParticipantConfig.java
@@ -21,29 +21,23 @@
package org.onap.policy.clamp.controlloop.participant.policy.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.policy.main.handler.ControlLoopElementHandler;
-import org.onap.policy.clamp.controlloop.participant.policy.main.parameters.ParticipantPolicyParameters;
-import org.springframework.context.annotation.Bean;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ParticipantConfig {
/**
- * Create ParticipantIntermediaryApi.
+ * Register ControlLoopElementListener.
*
- * @param parameters the Participant Policy Parameters
- * @param controlLoopElementHandler the ControlLoop Element Handler
- * @return ParticipantIntermediaryApi
+ * @param intermediaryApi the ParticipantIntermediaryApi
+ * @param clElementHandler the ControlLoop Element Handler
*/
- @Bean
- public ParticipantIntermediaryApi participantIntermediaryApi(ParticipantPolicyParameters parameters,
- ControlLoopElementHandler controlLoopElementHandler) {
- ParticipantIntermediaryApi intermediaryApi = new ParticipantIntermediaryFactory().createApiImplementation();
- intermediaryApi.init(parameters.getIntermediaryParameters());
- intermediaryApi.registerControlLoopElementListener(controlLoopElementHandler);
- controlLoopElementHandler.setIntermediaryApi(intermediaryApi);
- return intermediaryApi;
+ @Autowired
+ public void registerControlLoopElementListener(ParticipantIntermediaryApi intermediaryApi,
+ ControlLoopElementHandler clElementHandler) {
+ intermediaryApi.registerControlLoopElementListener(clElementHandler);
+ clElementHandler.setIntermediaryApi(intermediaryApi);
}
}
diff --git a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/ParticipantPolicyParameters.java b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/ParticipantPolicyParameters.java
index 91f7ae47f..ced9d1bd0 100644
--- a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/ParticipantPolicyParameters.java
+++ b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/ParticipantPolicyParameters.java
@@ -25,12 +25,12 @@ 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.clamp.controlloop.participant.intermediary.parameters.ParticipantParameters;
import org.onap.policy.common.endpoints.parameters.RestClientParameters;
import org.onap.policy.common.parameters.validation.ParameterGroupConstraint;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;
-
/**
* Class to hold all parameters needed for the policy participant.
*
@@ -39,7 +39,7 @@ import org.springframework.validation.annotation.Validated;
@Getter
@Setter
@ConfigurationProperties(prefix = "participant")
-public class ParticipantPolicyParameters {
+public class ParticipantPolicyParameters implements ParticipantParameters {
@NotNull
@Valid