From 9659c99c9c8b4b7ce33d7f48e61df44a03090186 Mon Sep 17 00:00:00 2001 From: "saul.gill" Date: Thu, 2 Feb 2023 11:40:29 +0000 Subject: Refactor ParticipantUpdate to ParticipantPrime Refactored ParticipantUpdateAck to ParticipantPrimeAck Refactored ParticipantUpdate to ParticipantPrime Refactored all associated tests and code Issue-ID: POLICY-4548 Change-Id: I2265777add4e088173ec465603e26143e3f40070 Signed-off-by: saul.gill --- .../commissioning/CommissioningProvider.java | 10 +- .../runtime/supervision/SupervisionHandler.java | 22 ++-- .../comm/ParticipantPrimeAckListener.java | 69 ++++++++++++ .../comm/ParticipantPrimePublisher.java | 122 +++++++++++++++++++++ .../comm/ParticipantUpdateAckListener.java | 69 ------------ .../comm/ParticipantUpdatePublisher.java | 122 --------------------- 6 files changed, 207 insertions(+), 207 deletions(-) create mode 100644 runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantPrimeAckListener.java create mode 100644 runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantPrimePublisher.java delete mode 100644 runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdateAckListener.java delete mode 100644 runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java (limited to 'runtime-acm/src/main') 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 c273a627a..456e61c20 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 @@ -25,7 +25,7 @@ import java.util.UUID; import java.util.stream.Collectors; import javax.ws.rs.core.Response.Status; import lombok.RequiredArgsConstructor; -import org.onap.policy.clamp.acm.runtime.supervision.comm.ParticipantUpdatePublisher; +import org.onap.policy.clamp.acm.runtime.supervision.comm.ParticipantPrimePublisher; import org.onap.policy.clamp.models.acm.concepts.AcTypeState; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionDefinition; import org.onap.policy.clamp.models.acm.messages.rest.commissioning.AcTypeStateUpdate; @@ -53,7 +53,7 @@ public class CommissioningProvider { private final AcDefinitionProvider acDefinitionProvider; private final AutomationCompositionProvider acProvider; private final AcTypeStateResolver acTypeStateResolver; - private final ParticipantUpdatePublisher participantUpdatePublisher; + private final ParticipantPrimePublisher participantPrimePublisher; private CommissioningResponse createCommissioningResponse(UUID compositionId, ToscaServiceTemplate serviceTemplate) { @@ -191,9 +191,9 @@ public class CommissioningProvider { } private void prime(AutomationCompositionDefinition acmDefinition) { - var prearation = participantUpdatePublisher.prepareParticipantPriming(acmDefinition); + var prearation = participantPrimePublisher.prepareParticipantPriming(acmDefinition); acDefinitionProvider.updateAcDefinition(acmDefinition); - participantUpdatePublisher.sendPriming(prearation, acmDefinition.getCompositionId(), null); + participantPrimePublisher.sendPriming(prearation, acmDefinition.getCompositionId(), null); } private void deprime(AutomationCompositionDefinition acmDefinition) { @@ -204,7 +204,7 @@ public class CommissioningProvider { acmDefinition.setState(AcTypeState.DEPRIMING); acDefinitionProvider.updateAcDefinition(acmDefinition); } - participantUpdatePublisher.sendDepriming(acmDefinition.getCompositionId()); + participantPrimePublisher.sendDepriming(acmDefinition.getCompositionId()); } } diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandler.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandler.java index 374df0135..b31a95b18 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandler.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandler.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021,2023 Nordix Foundation. + * Copyright (C) 2021-2023 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,7 +36,7 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationComposition; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState; import org.onap.policy.clamp.models.acm.concepts.ParticipantUtils; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeployAck; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdateAck; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrimeAck; import org.onap.policy.clamp.models.acm.persistence.provider.AcDefinitionProvider; import org.onap.policy.clamp.models.acm.persistence.provider.AutomationCompositionProvider; import org.slf4j.Logger; @@ -85,29 +85,29 @@ public class SupervisionHandler { } /** - * Handle a ParticipantUpdateAck message from a participant. + * Handle a ParticipantPrimeAck message from a participant. * - * @param participantUpdateAckMessage the ParticipantUpdateAck message received from a participant + * @param participantPrimeAckMessage the ParticipantPrimeAck message received from a participant */ - @Timed(value = "listener.participant_update_ack", description = "PARTICIPANT_UPDATE_ACK messages received") - public void handleParticipantMessage(ParticipantUpdateAck participantUpdateAckMessage) { - LOGGER.debug("Participant Update Ack message received {}", participantUpdateAckMessage); - var acDefinitionOpt = acDefinitionProvider.findAcDefinition(participantUpdateAckMessage.getCompositionId()); + @Timed(value = "listener.participant_prime_ack", description = "PARTICIPANT_PRIME_ACK messages received") + public void handleParticipantMessage(ParticipantPrimeAck participantPrimeAckMessage) { + LOGGER.debug("Participant Prime Ack message received {}", participantPrimeAckMessage); + var acDefinitionOpt = acDefinitionProvider.findAcDefinition(participantPrimeAckMessage.getCompositionId()); if (acDefinitionOpt.isEmpty()) { - LOGGER.warn("AC Definition not found in database {}", participantUpdateAckMessage.getCompositionId()); + LOGGER.warn("AC Definition not found in database {}", participantPrimeAckMessage.getCompositionId()); return; } var acDefinition = acDefinitionOpt.get(); if (!AcTypeState.PRIMING.equals(acDefinition.getState()) && !AcTypeState.DEPRIMING.equals(acDefinition.getState())) { LOGGER.warn("AC Definition {} already primed/deprimed with participant {}", - participantUpdateAckMessage.getCompositionId(), participantUpdateAckMessage.getParticipantId()); + participantPrimeAckMessage.getCompositionId(), participantPrimeAckMessage.getParticipantId()); return; } var state = AcTypeState.PRIMING.equals(acDefinition.getState()) ? AcTypeState.PRIMED : AcTypeState.COMMISSIONED; boolean completed = true; for (var element : acDefinition.getElementStateMap().values()) { - if (participantUpdateAckMessage.getParticipantId().equals(element.getParticipantId())) { + if (participantPrimeAckMessage.getParticipantId().equals(element.getParticipantId())) { element.setState(state); } else if (!state.equals(element.getState())) { completed = false; diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantPrimeAckListener.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantPrimeAckListener.java new file mode 100644 index 000000000..163d0708e --- /dev/null +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantPrimeAckListener.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021-2023 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.runtime.supervision.comm; + +import org.onap.policy.clamp.acm.runtime.config.messaging.Listener; +import org.onap.policy.clamp.acm.runtime.supervision.SupervisionHandler; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrimeAck; +import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; +import org.onap.policy.common.endpoints.listeners.ScoListener; +import org.onap.policy.common.utils.coder.StandardCoderObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * Listener for ParticipantPrimeAck messages sent by participants. + */ +@Component +public class ParticipantPrimeAckListener extends ScoListener + implements Listener { + private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantPrimeAckListener.class); + + private final SupervisionHandler supervisionHandler; + + /** + * Constructs the object. + */ + public ParticipantPrimeAckListener(SupervisionHandler supervisionHandler) { + super(ParticipantPrimeAck.class); + this.supervisionHandler = supervisionHandler; + } + + @Override + public void onTopicEvent(final CommInfrastructure infra, final String topic, final StandardCoderObject sco, + final ParticipantPrimeAck participantPrimeAckMessage) { + LOGGER.debug("ParticipantPrimeAck message received from participant - {}", participantPrimeAckMessage); + supervisionHandler.handleParticipantMessage(participantPrimeAckMessage); + } + + @Override + public String getType() { + return ParticipantMessageType.PARTICIPANT_PRIME_ACK.name(); + } + + @Override + public ScoListener getScoListener() { + return this; + } +} diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantPrimePublisher.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantPrimePublisher.java new file mode 100644 index 000000000..24dcc2382 --- /dev/null +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantPrimePublisher.java @@ -0,0 +1,122 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021-2023 Nordix Foundation. + * ================================================================================ + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.runtime.supervision.comm; + +import io.micrometer.core.annotation.Timed; +import java.time.Instant; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import lombok.AllArgsConstructor; +import org.onap.policy.clamp.models.acm.concepts.AcTypeState; +import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionDefinition; +import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrime; +import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider; +import org.onap.policy.clamp.models.acm.utils.AcmUtils; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * This class is used to send ParticipantPrime messages to participants on DMaaP. + */ +@Component +@AllArgsConstructor +public class ParticipantPrimePublisher extends AbstractParticipantPublisher { + + private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantPrimePublisher.class); + + private final ParticipantProvider participantProvider; + + /** + * Send ParticipantPrime to Participant + * if participantId is null then message is broadcast. + * + * @param participantDefinitions the list of ParticipantDefinition to send + * @param compositionId the compositionId + * @param participantId the ParticipantId + */ + @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published") + public void sendPriming(List participantDefinitions, UUID compositionId, + UUID participantId) { + var message = new ParticipantPrime(); + message.setCompositionId(compositionId); + message.setParticipantId(participantId); + message.setTimestamp(Instant.now()); + message.setParticipantDefinitionUpdates(participantDefinitions); + LOGGER.debug("Participant Update sent {}", message); + super.send(message); + } + + /** + * Pepare the Priming message creating the list of ParticipantDefinition to send + * and fill the ElementState map of the AC Definition. + * + * @param acmDefinition the AutomationComposition Definition + * @return list of ParticipantDefinition + */ + public List prepareParticipantPriming(AutomationCompositionDefinition acmDefinition) { + acmDefinition.setState(AcTypeState.PRIMING); + var acElements = AcmUtils.extractAcElementsFromServiceTemplate(acmDefinition.getServiceTemplate()); + Map supportedElementMap = new HashMap<>(); + if (AcTypeState.PRIMED.equals(acmDefinition.getState())) { + // scenario Prime again, participants already assigned + for (var elementEntry : acElements) { + var elementState = acmDefinition.getElementStateMap().get(elementEntry.getKey()); + elementState.setState(AcTypeState.PRIMING); + var type = new ToscaConceptIdentifier(elementEntry.getValue().getType(), + elementEntry.getValue().getTypeVersion()); + supportedElementMap.put(type, elementState.getParticipantId()); + } + } else { + // scenario Prime participants not assigned yet + supportedElementMap = participantProvider.getSupportedElementMap(); + for (var elementEntry : acElements) { + var elementState = acmDefinition.getElementStateMap().get(elementEntry.getKey()); + elementState.setState(AcTypeState.PRIMING); + var type = new ToscaConceptIdentifier(elementEntry.getValue().getType(), + elementEntry.getValue().getTypeVersion()); + elementState.setParticipantId(supportedElementMap.get(type)); + } + } + return AcmUtils.prepareParticipantPriming(acElements, supportedElementMap); + } + + /** + * Send ParticipantPrime to Participant after that commissioning has been removed. + */ + @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published") + public void sendDepriming(UUID compositionId) { + var message = new ParticipantPrime(); + message.setCompositionId(compositionId); + message.setTimestamp(Instant.now()); + // DeCommission the automation composition but deleting participantdefinitions on participants + message.setParticipantDefinitionUpdates(null); + + LOGGER.debug("Participant Update sent {}", message); + super.send(message); + } +} diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdateAckListener.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdateAckListener.java deleted file mode 100644 index d75de775b..000000000 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdateAckListener.java +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. - * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * 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.runtime.supervision.comm; - -import org.onap.policy.clamp.acm.runtime.config.messaging.Listener; -import org.onap.policy.clamp.acm.runtime.supervision.SupervisionHandler; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdateAck; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; -import org.onap.policy.common.endpoints.listeners.ScoListener; -import org.onap.policy.common.utils.coder.StandardCoderObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -/** - * Listener for ParticipantUpdateAck messages sent by participants. - */ -@Component -public class ParticipantUpdateAckListener extends ScoListener - implements Listener { - private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantUpdateAckListener.class); - - private final SupervisionHandler supervisionHandler; - - /** - * Constructs the object. - */ - public ParticipantUpdateAckListener(SupervisionHandler supervisionHandler) { - super(ParticipantUpdateAck.class); - this.supervisionHandler = supervisionHandler; - } - - @Override - public void onTopicEvent(final CommInfrastructure infra, final String topic, final StandardCoderObject sco, - final ParticipantUpdateAck participantUpdateAckMessage) { - LOGGER.debug("ParticipantUpdateAck message received from participant - {}", participantUpdateAckMessage); - supervisionHandler.handleParticipantMessage(participantUpdateAckMessage); - } - - @Override - public String getType() { - return ParticipantMessageType.PARTICIPANT_UPDATE_ACK.name(); - } - - @Override - public ScoListener getScoListener() { - return this; - } -} diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java deleted file mode 100644 index 1915f1b0d..000000000 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java +++ /dev/null @@ -1,122 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2021-2023 Nordix Foundation. - * ================================================================================ - * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * 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.runtime.supervision.comm; - -import io.micrometer.core.annotation.Timed; -import java.time.Instant; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import lombok.AllArgsConstructor; -import org.onap.policy.clamp.models.acm.concepts.AcTypeState; -import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionDefinition; -import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdate; -import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider; -import org.onap.policy.clamp.models.acm.utils.AcmUtils; -import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -/** - * This class is used to send ParticipantUpdate messages to participants on DMaaP. - */ -@Component -@AllArgsConstructor -public class ParticipantUpdatePublisher extends AbstractParticipantPublisher { - - private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantUpdatePublisher.class); - - private final ParticipantProvider participantProvider; - - /** - * Send ParticipantUpdate to Participant - * if participantId is null then message is broadcast. - * - * @param participantDefinitions the list of ParticipantDefinition to send - * @param compositionId the compositionId - * @param participantId the ParticipantId - */ - @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published") - public void sendPriming(List participantDefinitions, UUID compositionId, - UUID participantId) { - var message = new ParticipantUpdate(); - message.setCompositionId(compositionId); - message.setParticipantId(participantId); - message.setTimestamp(Instant.now()); - message.setParticipantDefinitionUpdates(participantDefinitions); - LOGGER.debug("Participant Update sent {}", message); - super.send(message); - } - - /** - * Pepare the Priming message creating the list of ParticipantDefinition to send - * and fill the ElementState map of the AC Definition. - * - * @param acmDefinition the AutomationComposition Definition - * @return list of ParticipantDefinition - */ - public List prepareParticipantPriming(AutomationCompositionDefinition acmDefinition) { - acmDefinition.setState(AcTypeState.PRIMING); - var acElements = AcmUtils.extractAcElementsFromServiceTemplate(acmDefinition.getServiceTemplate()); - Map supportedElementMap = new HashMap<>(); - if (AcTypeState.PRIMED.equals(acmDefinition.getState())) { - // scenario Prime again, participants already assigned - for (var elementEntry : acElements) { - var elementState = acmDefinition.getElementStateMap().get(elementEntry.getKey()); - elementState.setState(AcTypeState.PRIMING); - var type = new ToscaConceptIdentifier(elementEntry.getValue().getType(), - elementEntry.getValue().getTypeVersion()); - supportedElementMap.put(type, elementState.getParticipantId()); - } - } else { - // scenario Prime participants not assigned yet - supportedElementMap = participantProvider.getSupportedElementMap(); - for (var elementEntry : acElements) { - var elementState = acmDefinition.getElementStateMap().get(elementEntry.getKey()); - elementState.setState(AcTypeState.PRIMING); - var type = new ToscaConceptIdentifier(elementEntry.getValue().getType(), - elementEntry.getValue().getTypeVersion()); - elementState.setParticipantId(supportedElementMap.get(type)); - } - } - return AcmUtils.prepareParticipantPriming(acElements, supportedElementMap); - } - - /** - * Send ParticipantUpdate to Participant after that commissioning has been removed. - */ - @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published") - public void sendDepriming(UUID compositionId) { - var message = new ParticipantUpdate(); - message.setCompositionId(compositionId); - message.setTimestamp(Instant.now()); - // DeCommission the automation composition but deleting participantdefinitions on participants - message.setParticipantDefinitionUpdates(null); - - LOGGER.debug("Participant Update sent {}", message); - super.send(message); - } -} -- cgit 1.2.3-korg