aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-controlloop
diff options
context:
space:
mode:
authorSirisha_Manchikanti <sirisha.manchikanti@est.tech>2021-08-10 21:51:48 +0100
committerSirisha_Manchikanti <sirisha.manchikanti@est.tech>2021-08-18 14:58:42 +0100
commitd0a1bcee60c43a736a0526d49c07c564632c4f02 (patch)
tree32d46f33307a9bb65215a1f52eb626ae7db3d1ee /runtime-controlloop
parenta37bd982693785af5fc791df0baaa49dda039846 (diff)
Updated ControlLoop component messages
Updated controlloop messages (ParticipantUpdate, ControlLoopUpdate, ParticipantStatus) according to the following Wiki and added implementation for the corresponding updates in runtime-controlloop and participant components https://wiki.onap.org/display/DW/The+CLAMP+Control+Loop+Participant+Protocol Issue-ID: POLICY-3417 Signed-off-by: Sirisha_Manchikanti <sirisha.manchikanti@est.tech> Change-Id: I80d96a7553a89ca47de2aa35e09df5a5c792acfa
Diffstat (limited to 'runtime-controlloop')
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java14
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java47
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java81
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java93
-rw-r--r--runtime-controlloop/src/test/resources/rest/controlloops/ControlLoops.json32
-rw-r--r--runtime-controlloop/src/test/resources/rest/servicetemplates/PMSHMultipleCLTosca.yaml4
-rw-r--r--runtime-controlloop/src/test/resources/rest/servicetemplates/pmsh_multiple_cl_tosca.yaml4
7 files changed, 228 insertions, 47 deletions
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
index 9180cedb3..0e2ff5ca9 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
@@ -311,18 +311,16 @@ public class SupervisionHandler {
private void superviseControlLoops(ParticipantStatus participantStatusMessage)
throws PfModelException, ControlLoopException {
- if (participantStatusMessage.getControlLoopInfoMap() != null) {
- for (Map.Entry<String, ControlLoopInfo> clEntry : participantStatusMessage.getControlLoopInfoMap()
- .entrySet()) {
- String[] key = clEntry.getKey().split(" ");
+ if (participantStatusMessage.getControlLoopInfoList() != null) {
+ for (ControlLoopInfo clEntry : participantStatusMessage.getControlLoopInfoList()) {
var dbControlLoop = controlLoopProvider.getControlLoop(
- new ToscaConceptIdentifier(key[0], key[1]));
+ new ToscaConceptIdentifier(clEntry.getControlLoopId()));
if (dbControlLoop == null) {
exceptionOccured(Response.Status.NOT_FOUND,
- "PARTICIPANT_STATUS control loop not found in database: " + clEntry.getKey());
+ "PARTICIPANT_STATUS control loop not found in database: " + clEntry.getControlLoopId());
}
- dbControlLoop.setState(clEntry.getValue().getState());
- monitoringProvider.createClElementStatistics(clEntry.getValue().getControlLoopStatistics()
+ dbControlLoop.setState(clEntry.getState());
+ monitoringProvider.createClElementStatistics(clEntry.getControlLoopStatistics()
.getClElementStatisticsList().getClElementStatistics());
}
}
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java
index 448662cfe..be9a2a27d 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java
@@ -20,9 +20,19 @@
package org.onap.policy.clamp.controlloop.runtime.supervision.comm;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
import lombok.AllArgsConstructor;
import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop;
+import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElement;
+import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantDefinition;
+import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantUpdates;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -44,8 +54,43 @@ public class ControlLoopUpdatePublisher extends AbstractParticipantPublisher<Con
public void send(ControlLoop controlLoop) {
var controlLoopUpdateMsg = new ControlLoopUpdate();
controlLoopUpdateMsg.setControlLoopId(controlLoop.getKey().asIdentifier());
- controlLoopUpdateMsg.setControlLoop(controlLoop);
+ controlLoopUpdateMsg.setMessageId(UUID.randomUUID());
+ controlLoopUpdateMsg.setTimestamp(Instant.now());
+
+ List<ParticipantUpdates> participantUpdates = new ArrayList<>();
+ for (ControlLoopElement element : controlLoop.getElements().values()) {
+ prepareParticipantUpdate(element, participantUpdates);
+ }
+ controlLoopUpdateMsg.setParticipantUpdatesList(participantUpdates);
+
LOGGER.debug("ControlLoopUpdate message sent", controlLoopUpdateMsg);
super.send(controlLoopUpdateMsg);
}
+
+ private void prepareParticipantUpdate(ControlLoopElement clElement,
+ List<ParticipantUpdates> participantUpdates) {
+ if (participantUpdates.isEmpty()) {
+ participantUpdates.add(getControlLoopElementList(clElement));
+ } else {
+ boolean participantExists = false;
+ for (ParticipantUpdates participantUpdate : participantUpdates) {
+ if (participantUpdate.getParticipantId().equals(clElement.getParticipantId())) {
+ participantUpdate.getControlLoopElementList().add(clElement);
+ participantExists = true;
+ }
+ }
+ if (!participantExists) {
+ participantUpdates.add(getControlLoopElementList(clElement));
+ }
+ }
+ }
+
+ private ParticipantUpdates getControlLoopElementList(ControlLoopElement clElement) {
+ ParticipantUpdates participantUpdate = new ParticipantUpdates();
+ List<ControlLoopElement> controlLoopElementList = new ArrayList<>();
+ participantUpdate.setParticipantId(clElement.getParticipantId());
+ controlLoopElementList.add(clElement);
+ participantUpdate.setControlLoopElementList(controlLoopElementList);
+ return participantUpdate;
+ }
}
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java
index cfc0e3932..5edf528b8 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java
@@ -21,15 +21,23 @@
package org.onap.policy.clamp.controlloop.runtime.supervision.comm;
import java.time.Instant;
+import java.util.ArrayList;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
-import java.util.UUID;
import lombok.AllArgsConstructor;
+import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElement;
import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElementDefinition;
+import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantDefinition;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate;
import org.onap.policy.clamp.controlloop.runtime.commissioning.CommissioningProvider;
+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.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -42,8 +50,9 @@ import org.springframework.stereotype.Component;
public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<ParticipantUpdate> {
private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantUpdatePublisher.class);
-
+ private static final String CONTROL_LOOP_ELEMENT = "ControlLoopElement";
private final CommissioningProvider commissioningProvider;
+ private static final Coder CODER = new StandardCoder();
/**
* Send ParticipantUpdate to Participant.
@@ -57,25 +66,71 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par
message.setParticipantType(participantType);
message.setTimestamp(Instant.now());
- var clDefinition = new ControlLoopElementDefinition();
- clDefinition.setId(UUID.randomUUID());
-
+ ToscaServiceTemplate toscaServiceTemplate;
try {
- clDefinition.setControlLoopElementToscaServiceTemplate(
- commissioningProvider.getToscaServiceTemplate(null, null));
+ toscaServiceTemplate = commissioningProvider.getToscaServiceTemplate(null, null);
} catch (PfModelException pfme) {
LOGGER.warn("Get of tosca service template failed, cannot send participantupdate", pfme);
return;
}
- Map<UUID, ControlLoopElementDefinition> controlLoopElementDefinitionMap = new LinkedHashMap<>();
- controlLoopElementDefinitionMap.put(UUID.randomUUID(), clDefinition);
-
- Map<String, Map<UUID, ControlLoopElementDefinition>> participantDefinitionUpdateMap = new LinkedHashMap<>();
- participantDefinitionUpdateMap.put(participantId.toString(), controlLoopElementDefinitionMap);
- message.setParticipantDefinitionUpdateMap(participantDefinitionUpdateMap);
+ List<ParticipantDefinition> participantDefinitionUpdates = new ArrayList<>();
+ for (Map.Entry<String, ToscaNodeTemplate> toscaInputEntry :
+ toscaServiceTemplate.getToscaTopologyTemplate().getNodeTemplates().entrySet()) {
+ if (toscaInputEntry.getValue().getType().contains(CONTROL_LOOP_ELEMENT)) {
+ ToscaConceptIdentifier clParticipantId;
+ try {
+ clParticipantId = CODER.decode(
+ toscaInputEntry.getValue().getProperties().get("participant_id").toString(),
+ ToscaConceptIdentifier.class);
+ } catch (CoderException e) {
+ throw new RuntimeException("cannot get ParticipantId from toscaNodeTemplate", e);
+ }
+ prepareParticipantDefinitionUpdate(clParticipantId, toscaInputEntry.getKey(),
+ toscaInputEntry.getValue(), participantDefinitionUpdates);
+ }
+ }
+ message.setParticipantDefinitionUpdates(participantDefinitionUpdates);
+ message.setToscaServiceTemplate(toscaServiceTemplate);
LOGGER.debug("Participant Update sent {}", message);
super.send(message);
}
+
+ private void prepareParticipantDefinitionUpdate(ToscaConceptIdentifier clParticipantId, String entryKey,
+ ToscaNodeTemplate entryValue, List<ParticipantDefinition> participantDefinitionUpdates) {
+
+ var clDefinition = new ControlLoopElementDefinition();
+ clDefinition.setClElementDefinitionId(new ToscaConceptIdentifier(
+ entryKey, entryValue.getVersion()));
+ clDefinition.setControlLoopElementToscaNodeTemplate(entryValue);
+ List<ControlLoopElementDefinition> controlLoopElementDefinitionList = new ArrayList<>();
+
+ if (participantDefinitionUpdates.isEmpty()) {
+ participantDefinitionUpdates.add(getParticipantDefinition(clDefinition, clParticipantId,
+ controlLoopElementDefinitionList));
+ } else {
+ boolean participantExists = false;
+ for (ParticipantDefinition participantDefinitionUpdate : participantDefinitionUpdates) {
+ if (participantDefinitionUpdate.getParticipantId().equals(clParticipantId)) {
+ participantDefinitionUpdate.getControlLoopElementDefinitionList().add(clDefinition);
+ participantExists = true;
+ }
+ }
+ if (!participantExists) {
+ participantDefinitionUpdates.add(getParticipantDefinition(clDefinition, clParticipantId,
+ controlLoopElementDefinitionList));
+ }
+ }
+ }
+
+ private ParticipantDefinition getParticipantDefinition(ControlLoopElementDefinition clDefinition,
+ ToscaConceptIdentifier clParticipantId,
+ List<ControlLoopElementDefinition> controlLoopElementDefinitionList) {
+ ParticipantDefinition participantDefinition = new ParticipantDefinition();
+ participantDefinition.setParticipantId(clParticipantId);
+ controlLoopElementDefinitionList.add(clDefinition);
+ participantDefinition.setControlLoopElementDefinitionList(controlLoopElementDefinitionList);
+ return participantDefinition;
+ }
}
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
index e74af7901..10116a240 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
@@ -21,7 +21,9 @@
package org.onap.policy.clamp.controlloop.runtime.supervision.comm;
import java.time.Instant;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@@ -30,6 +32,7 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElementDefinition;
+import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantDefinition;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ClElementStatisticsProvider;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ControlLoopProvider;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ParticipantProvider;
@@ -41,6 +44,7 @@ import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.Parti
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdateAck;
import org.onap.policy.clamp.controlloop.runtime.commissioning.CommissioningProvider;
+import org.onap.policy.clamp.controlloop.runtime.instantiation.InstantiationUtils;
import org.onap.policy.clamp.controlloop.runtime.main.parameters.ClRuntimeParameterGroup;
import org.onap.policy.clamp.controlloop.runtime.monitoring.MonitoringProvider;
import org.onap.policy.clamp.controlloop.runtime.supervision.SupervisionHandler;
@@ -48,6 +52,9 @@ import org.onap.policy.clamp.controlloop.runtime.util.CommonTestData;
import org.onap.policy.clamp.controlloop.runtime.util.rest.CommonRestController;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
+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.common.utils.coder.YamlJsonTranslator;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.base.PfModelException;
@@ -63,12 +70,15 @@ class SupervisionMessagesTest extends CommonRestController {
private static final Object lockit = new Object();
private static final CommInfrastructure INFRA = CommInfrastructure.NOOP;
private static final String TOPIC = "my-topic";
- private static final long interval = 1000;
private static SupervisionHandler supervisionHandler;
private static CommissioningProvider commissioningProvider;
private static ControlLoopProvider clProvider;
private static PolicyModelsProvider modelsProvider;
private static final YamlJsonTranslator yamlTranslator = new YamlJsonTranslator();
+ private static final String TOSCA_TEMPLATE_YAML =
+ "src/test/resources/rest/servicetemplates/pmsh_multiple_cl_tosca.yaml";
+ private static final String CONTROL_LOOP_ELEMENT = "ControlLoopElement";
+ private static final Coder CODER = new StandardCoder();
/**
* setup Db Provider Parameters.
@@ -118,7 +128,6 @@ class SupervisionMessagesTest extends CommonRestController {
ToscaServiceTemplate serviceTemplate = yamlTranslator.fromYaml(
ResourceUtils.getResourceAsString(TOSCA_SERVICE_TEMPLATE_YAML), ToscaServiceTemplate.class);
- List<ToscaNodeTemplate> listOfTemplates = commissioningProvider.getControlLoopDefinitions(null, null);
commissioningProvider.createControlLoopDefinitions(serviceTemplate);
participantRegisterListener.onTopicEvent(INFRA, TOPIC, null, participantRegisterMsg);
}
@@ -168,6 +177,9 @@ class SupervisionMessagesTest extends CommonRestController {
@Test
void testSendParticipantUpdate() throws Exception {
+ InstantiationUtils.storeToscaServiceTemplate(TOSCA_TEMPLATE_YAML, commissioningProvider);
+ commissioningProvider.getToscaServiceTemplate(null, null);
+
final ParticipantUpdate participantUpdateMsg = new ParticipantUpdate();
participantUpdateMsg.setParticipantId(getParticipantId());
participantUpdateMsg.setTimestamp(Instant.now());
@@ -175,32 +187,71 @@ class SupervisionMessagesTest extends CommonRestController {
participantUpdateMsg.setTimestamp(Instant.ofEpochMilli(3000));
participantUpdateMsg.setMessageId(UUID.randomUUID());
- ToscaServiceTemplate toscaServiceTemplate = new ToscaServiceTemplate();
- toscaServiceTemplate.setName("serviceTemplate");
- toscaServiceTemplate.setDerivedFrom("parentServiceTemplate");
- toscaServiceTemplate.setDescription("Description of serviceTemplate");
- toscaServiceTemplate.setVersion("1.2.3");
+ ToscaServiceTemplate toscaServiceTemplate = commissioningProvider.getToscaServiceTemplate(null, null);
+ List<ParticipantDefinition> participantDefinitionUpdates = new ArrayList<>();
+ for (Map.Entry<String, ToscaNodeTemplate> toscaInputEntry :
+ toscaServiceTemplate.getToscaTopologyTemplate().getNodeTemplates().entrySet()) {
+ if (toscaInputEntry.getValue().getType().contains(CONTROL_LOOP_ELEMENT)) {
+ ToscaConceptIdentifier clParticipantId;
+ try {
+ clParticipantId = CODER.decode(
+ toscaInputEntry.getValue().getProperties().get("participant_id").toString(),
+ ToscaConceptIdentifier.class);
+ } catch (CoderException e) {
+ throw new RuntimeException("cannot get ParticipantId from toscaNodeTemplate", e);
+ }
+ prepareParticipantDefinitionUpdate(clParticipantId, toscaInputEntry.getKey(),
+ toscaInputEntry.getValue(), participantDefinitionUpdates);
+ }
+ }
- ControlLoopElementDefinition clDefinition = new ControlLoopElementDefinition();
- clDefinition.setId(UUID.randomUUID());
- clDefinition.setControlLoopElementToscaServiceTemplate(toscaServiceTemplate);
- Map<String, String> commonPropertiesMap = Map.of("Prop1", "PropValue");
- clDefinition.setCommonPropertiesMap(commonPropertiesMap);
+ participantUpdateMsg.setParticipantDefinitionUpdates(participantDefinitionUpdates);
+ participantUpdateMsg.setToscaServiceTemplate(toscaServiceTemplate);
+ synchronized (lockit) {
+ ParticipantUpdatePublisher participantUpdatePublisher =
+ new ParticipantUpdatePublisher(commissioningProvider);
+ participantUpdatePublisher.active(Collections.singletonList(Mockito.mock(TopicSink.class)));
+ participantUpdatePublisher.send(participantUpdateMsg);
+ }
+ }
- Map<UUID, ControlLoopElementDefinition> controlLoopElementDefinitionMap =
- Map.of(UUID.randomUUID(), clDefinition);
+ private void prepareParticipantDefinitionUpdate(ToscaConceptIdentifier clParticipantId, String entryKey,
+ ToscaNodeTemplate entryValue, List<ParticipantDefinition> participantDefinitionUpdates) {
- Map<String, Map<UUID, ControlLoopElementDefinition>> participantDefinitionUpdateMap =
- Map.of(getParticipantId().toString(), controlLoopElementDefinitionMap);
- participantUpdateMsg.setParticipantDefinitionUpdateMap(participantDefinitionUpdateMap);
+ var clDefinition = new ControlLoopElementDefinition();
+ clDefinition.setClElementDefinitionId(new ToscaConceptIdentifier(
+ entryKey, entryValue.getVersion()));
+ clDefinition.setControlLoopElementToscaNodeTemplate(entryValue);
+ List<ControlLoopElementDefinition> controlLoopElementDefinitionList = new ArrayList<>();
- synchronized (lockit) {
- ParticipantUpdatePublisher clUpdatePublisher = new ParticipantUpdatePublisher(commissioningProvider);
- clUpdatePublisher.active(Collections.singletonList(Mockito.mock(TopicSink.class)));
- clUpdatePublisher.send(participantUpdateMsg);
+ if (participantDefinitionUpdates.isEmpty()) {
+ participantDefinitionUpdates.add(getParticipantDefinition(clDefinition, clParticipantId,
+ controlLoopElementDefinitionList));
+ } else {
+ boolean participantExists = false;
+ for (ParticipantDefinition participantDefinitionUpdate : participantDefinitionUpdates) {
+ if (participantDefinitionUpdate.getParticipantId().equals(clParticipantId)) {
+ participantDefinitionUpdate.getControlLoopElementDefinitionList().add(clDefinition);
+ participantExists = true;
+ }
+ }
+ if (!participantExists) {
+ participantDefinitionUpdates.add(getParticipantDefinition(clDefinition, clParticipantId,
+ controlLoopElementDefinitionList));
+ }
}
}
+ private ParticipantDefinition getParticipantDefinition(ControlLoopElementDefinition clDefinition,
+ ToscaConceptIdentifier clParticipantId,
+ List<ControlLoopElementDefinition> controlLoopElementDefinitionList) {
+ ParticipantDefinition participantDefinition = new ParticipantDefinition();
+ participantDefinition.setParticipantId(clParticipantId);
+ controlLoopElementDefinitionList.add(clDefinition);
+ participantDefinition.setControlLoopElementDefinitionList(controlLoopElementDefinitionList);
+ return participantDefinition;
+ }
+
@Test
void testReceiveParticipantUpdateAckMessage() throws Exception {
final ParticipantUpdateAck participantUpdateAckMsg = new ParticipantUpdateAck();
diff --git a/runtime-controlloop/src/test/resources/rest/controlloops/ControlLoops.json b/runtime-controlloop/src/test/resources/rest/controlloops/ControlLoops.json
index 13ea1bfc4..64443ff62 100644
--- a/runtime-controlloop/src/test/resources/rest/controlloops/ControlLoops.json
+++ b/runtime-controlloop/src/test/resources/rest/controlloops/ControlLoops.json
@@ -17,6 +17,10 @@
"name": "org.onap.domain.pmsh.PMSH_DCAEMicroservice",
"version": "1.2.3"
},
+ "participantId": {
+ "name": "org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant",
+ "version": "2.3.4"
+ },
"participantType": {
"name": "org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant",
"version": "2.3.4"
@@ -31,6 +35,10 @@
"name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement",
"version": "1.2.3"
},
+ "participantId": {
+ "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "version": "2.3.1"
+ },
"participantType": {
"name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
"version": "2.3.1"
@@ -45,6 +53,10 @@
"name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement",
"version": "1.2.3"
},
+ "participantId": {
+ "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "version": "2.3.1"
+ },
"participantType": {
"name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
"version": "2.3.1"
@@ -59,6 +71,10 @@
"name": "org.onap.domain.pmsh.PMSH_CDS_ControlLoopElement",
"version": "1.2.3"
},
+ "participantId": {
+ "name": "org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant",
+ "version": "2.2.1"
+ },
"participantType": {
"name": "org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant",
"version": "2.2.1"
@@ -86,6 +102,10 @@
"name": "org.onap.domain.pmsh.PMSH_DCAEMicroservice",
"version": "1.2.3"
},
+ "participantId": {
+ "name": "org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant",
+ "version": "2.3.4"
+ },
"participantType": {
"name": "org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant",
"version": "2.3.4"
@@ -100,6 +120,10 @@
"name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement",
"version": "1.2.3"
},
+ "participantId": {
+ "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "version": "2.3.1"
+ },
"participantType": {
"name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
"version": "2.3.1"
@@ -114,6 +138,10 @@
"name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement",
"version": "1.2.3"
},
+ "participantId": {
+ "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "version": "2.3.1"
+ },
"participantType": {
"name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
"version": "2.3.1"
@@ -128,6 +156,10 @@
"name": "org.onap.domain.pmsh.PMSH_CDS_ControlLoopElement",
"version": "1.2.3"
},
+ "participantId": {
+ "name": "org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant",
+ "version": "2.2.1"
+ },
"participantType": {
"name": "org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant",
"version": "2.2.1"
diff --git a/runtime-controlloop/src/test/resources/rest/servicetemplates/PMSHMultipleCLTosca.yaml b/runtime-controlloop/src/test/resources/rest/servicetemplates/PMSHMultipleCLTosca.yaml
index 099e2e945..dc09b4623 100644
--- a/runtime-controlloop/src/test/resources/rest/servicetemplates/PMSHMultipleCLTosca.yaml
+++ b/runtime-controlloop/src/test/resources/rest/servicetemplates/PMSHMultipleCLTosca.yaml
@@ -129,7 +129,7 @@ topology_template:
description: Control loop element for CDS for Performance Management Subscription Handling
properties:
provider: Ericsson
- participant_Id:
+ participant_id:
name: org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant
version: 3.2.1
cds_blueprint_id:
@@ -197,7 +197,7 @@ topology_template:
description: Control loop element for CDS for Performance Management Subscription Handling
properties:
provider: Ericsson
- participant_Id:
+ participant_id:
name: org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant
version: 3.2.1
cds_blueprint_id:
diff --git a/runtime-controlloop/src/test/resources/rest/servicetemplates/pmsh_multiple_cl_tosca.yaml b/runtime-controlloop/src/test/resources/rest/servicetemplates/pmsh_multiple_cl_tosca.yaml
index 099e2e945..dc09b4623 100644
--- a/runtime-controlloop/src/test/resources/rest/servicetemplates/pmsh_multiple_cl_tosca.yaml
+++ b/runtime-controlloop/src/test/resources/rest/servicetemplates/pmsh_multiple_cl_tosca.yaml
@@ -129,7 +129,7 @@ topology_template:
description: Control loop element for CDS for Performance Management Subscription Handling
properties:
provider: Ericsson
- participant_Id:
+ participant_id:
name: org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant
version: 3.2.1
cds_blueprint_id:
@@ -197,7 +197,7 @@ topology_template:
description: Control loop element for CDS for Performance Management Subscription Handling
properties:
provider: Ericsson
- participant_Id:
+ participant_id:
name: org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant
version: 3.2.1
cds_blueprint_id: