diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-03-14 12:48:45 +0000 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-03-15 10:10:01 +0000 |
commit | 9cf97c37b6d01142ce5b775dd319dc3d838294ac (patch) | |
tree | 0e5fa64627b9cc1cc0f890852c7472eb15a7cdb4 /runtime-acm/src/main/java | |
parent | 4f15b44c04a6f328f1a3357b859482c147fba0cd (diff) |
Upgrade Demo ACM element microservice
Upgrade chart Demo ACM element, upgrade servicetemplate example
and fix prime issue
Issue-ID: POLICY-4565
Change-Id: Icfc3a32f481840882eb6f20f25ed45b15d4991ff
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'runtime-acm/src/main/java')
-rw-r--r-- | runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java index 456e61c20..ca0b5c5ab 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java @@ -22,6 +22,8 @@ package org.onap.policy.clamp.acm.runtime.commissioning; import java.util.UUID; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.stream.Collectors; import javax.ws.rs.core.Response.Status; import lombok.RequiredArgsConstructor; @@ -55,6 +57,8 @@ public class CommissioningProvider { private final AcTypeStateResolver acTypeStateResolver; private final ParticipantPrimePublisher participantPrimePublisher; + private final ExecutorService executor = Executors.newFixedThreadPool(1); + private CommissioningResponse createCommissioningResponse(UUID compositionId, ToscaServiceTemplate serviceTemplate) { var response = new CommissioningResponse(); @@ -193,7 +197,9 @@ public class CommissioningProvider { private void prime(AutomationCompositionDefinition acmDefinition) { var prearation = participantPrimePublisher.prepareParticipantPriming(acmDefinition); acDefinitionProvider.updateAcDefinition(acmDefinition); - participantPrimePublisher.sendPriming(prearation, acmDefinition.getCompositionId(), null); + + executor.execute( + () -> participantPrimePublisher.sendPriming(prearation, acmDefinition.getCompositionId(), null)); } private void deprime(AutomationCompositionDefinition acmDefinition) { @@ -204,7 +210,7 @@ public class CommissioningProvider { acmDefinition.setState(AcTypeState.DEPRIMING); acDefinitionProvider.updateAcDefinition(acmDefinition); } - participantPrimePublisher.sendDepriming(acmDefinition.getCompositionId()); + executor.execute(() -> participantPrimePublisher.sendDepriming(acmDefinition.getCompositionId())); } } |