aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-http/src/main/java
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2024-06-14 14:10:58 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2024-06-17 09:04:18 +0000
commitca2ee94054c580827fcfc7f07c9db641301d6b9a (patch)
tree837edef253934aa10a09ecafa5819035b9ca0097 /participant/participant-impl/participant-impl-http/src/main/java
parentb52e095b34ee7c576f7ee83df05e2a09366a8c8a (diff)
Remove restarting implementation from participants
Remove restarting implementation from participants and Remove local Map from a1pms and kserve participants. Issue-ID: POLICY-5046 Change-Id: I9cc2a33d603751c60007475414b45ca54f0aac25 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-impl/participant-impl-http/src/main/java')
-rw-r--r--participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/main/handler/AutomationCompositionElementHandler.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/main/handler/AutomationCompositionElementHandler.java b/participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/main/handler/AutomationCompositionElementHandler.java
index 752b8d938..161cf9278 100644
--- a/participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/main/handler/AutomationCompositionElementHandler.java
+++ b/participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/main/handler/AutomationCompositionElementHandler.java
@@ -36,7 +36,6 @@ import org.onap.policy.clamp.models.acm.concepts.StateChangeResult;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
-import org.onap.policy.models.base.PfModelException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
@@ -76,11 +75,9 @@ public class AutomationCompositionElementHandler extends AcElementListenerV1 {
* @param automationCompositionId the automationComposition Id
* @param element the information on the automation composition element
* @param properties properties Map
- * @throws PfModelException in case of a exception
*/
@Override
- public void deploy(UUID automationCompositionId, AcElementDeploy element, Map<String, Object> properties)
- throws PfModelException {
+ public void deploy(UUID automationCompositionId, AcElementDeploy element, Map<String, Object> properties) {
try {
var configRequest = getConfigRequest(properties);
var restResponseMap = acHttpClient.run(configRequest);
@@ -104,11 +101,13 @@ public class AutomationCompositionElementHandler extends AcElementListenerV1 {
private ConfigRequest getConfigRequest(Map<String, Object> properties) throws AutomationCompositionException {
try {
var configRequest = CODER.convert(properties, ConfigRequest.class);
- var violations = Validation.buildDefaultValidatorFactory().getValidator().validate(configRequest);
- if (!violations.isEmpty()) {
- LOGGER.error("Violations found in the config request parameters: {}", violations);
- throw new AutomationCompositionException(Status.BAD_REQUEST,
- "Constraint violations in the config request");
+ try (var validatorFactory = Validation.buildDefaultValidatorFactory()) {
+ var violations = validatorFactory.getValidator().validate(configRequest);
+ if (!violations.isEmpty()) {
+ LOGGER.error("Violations found in the config request parameters: {}", violations);
+ throw new AutomationCompositionException(Status.BAD_REQUEST,
+ "Constraint violations in the config request");
+ }
}
return configRequest;
} catch (CoderException e) {