From 31090c9fbc6c29477acd784a6c9f03766b5cc981 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Wed, 7 Jun 2023 14:25:33 +0100 Subject: Add failure handling support in Intermediary Add Failure handling support in Intermediary, and refactor the communication between Participant and Intermediary. Issue-ID: POLICY-4707 Change-Id: Ica22e0e820efda372886d6d8da9c3526633321e2 Signed-off-by: FrancescoFioraEst --- .../participant/http/config/ParticipantConfig.java | 43 ---------------------- .../AutomationCompositionElementHandler.java | 4 +- 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/config/ParticipantConfig.java (limited to 'participant/participant-impl/participant-impl-http/src/main') diff --git a/participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/config/ParticipantConfig.java b/participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/config/ParticipantConfig.java deleted file mode 100644 index e2b5d1718..000000000 --- a/participant/participant-impl/participant-impl-http/src/main/java/org/onap/policy/clamp/acm/participant/http/config/ParticipantConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.clamp.acm.participant.http.config; - -import org.onap.policy.clamp.acm.participant.http.main.handler.AutomationCompositionElementHandler; -import org.onap.policy.clamp.acm.participant.intermediary.api.ParticipantIntermediaryApi; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class ParticipantConfig { - - /** - * Register AutomationCompositionElementListener. - * - * @param intermediaryApi the ParticipantIntermediaryApi - * @param acElementHandler the AutomationComposition Element Handler - */ - @Autowired - public void registerAutomationCompositionElementListener(ParticipantIntermediaryApi intermediaryApi, - AutomationCompositionElementHandler acElementHandler) { - intermediaryApi.registerAutomationCompositionElementListener(acElementHandler); - acElementHandler.setIntermediaryApi(intermediaryApi); - } -} 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 966aee971..711887423 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 @@ -34,7 +34,6 @@ import java.util.stream.Collectors; import javax.validation.Validation; import javax.ws.rs.core.Response.Status; import lombok.RequiredArgsConstructor; -import lombok.Setter; import org.apache.commons.lang3.tuple.Pair; import org.onap.policy.clamp.acm.participant.http.main.models.ConfigRequest; import org.onap.policy.clamp.acm.participant.http.main.webclient.AcHttpClient; @@ -70,8 +69,7 @@ public class AutomationCompositionElementHandler implements AutomationCompositio private final ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); - @Setter - private ParticipantIntermediaryApi intermediaryApi; + private final ParticipantIntermediaryApi intermediaryApi; private final AcHttpClient acHttpClient; -- cgit 1.2.3-korg