summaryrefslogtreecommitdiffstats
path: root/participant/participant-intermediary
diff options
context:
space:
mode:
authorsaul.gill <saul.gill@est.tech>2023-01-13 17:24:23 +0000
committersaul.gill <saul.gill@est.tech>2023-01-19 13:07:33 +0000
commit46964ab900060a560b9b41f7d34ab0e26ac7fd61 (patch)
treed4d15350f492cc19ee657df6cb926349bd724919 /participant/participant-intermediary
parent48df549e1fd90c2768a78c0c88e87dc3834b6222 (diff)
Add supported ac elements to participants
Added new supported elements table Added supported element names and versions to participant application.yaml files Issue-ID: POLICY-4512 Change-Id: I97d7f571f2906846514ac0804b4827f0601177d7 Signed-off-by: saul.gill <saul.gill@est.tech>
Diffstat (limited to 'participant/participant-intermediary')
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java6
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java6
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java9
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java5
4 files changed, 21 insertions, 5 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java
index 11f277885..9023d9460 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2022 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");
@@ -72,7 +72,7 @@ public class ParticipantMessagePublisher implements Publisher {
public void sendParticipantStatus(final ParticipantStatus participantStatus) {
validate();
topicSinkClient.send(participantStatus);
- LOGGER.debug("Sent Participant Status message to CLAMP - {}", participantStatus);
+ LOGGER.info("Sent Participant Status message to CLAMP - {}", participantStatus);
}
/**
@@ -84,7 +84,7 @@ public class ParticipantMessagePublisher implements Publisher {
public void sendParticipantRegister(final ParticipantRegister participantRegister) {
validate();
topicSinkClient.send(participantRegister);
- LOGGER.debug("Sent Participant Register message to CLAMP - {}", participantRegister);
+ LOGGER.info("Sent Participant Register message to CLAMP - {}", participantRegister);
}
/**
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java
index 6edf1ffd4..f9023be1a 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java
@@ -35,6 +35,7 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDef
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionInfo;
import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition;
import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantSupportedElementType;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionStateChange;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionUpdate;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantAckMessage;
@@ -70,6 +71,8 @@ public class ParticipantHandler {
private final Map<UUID, List<AutomationCompositionElementDefinition>> acElementDefsMap = new HashMap<>();
+ private final List<ParticipantSupportedElementType> supportedAcElementTypes;
+
/**
* Constructor, set the participant ID and sender.
*
@@ -82,6 +85,7 @@ public class ParticipantHandler {
this.participantId = parameters.getIntermediaryParameters().getParticipantId();
this.publisher = publisher;
this.automationCompositionHandler = automationCompositionHandler;
+ this.supportedAcElementTypes = parameters.getIntermediaryParameters().getParticipantSupportedElementTypes();
}
/**
@@ -92,6 +96,7 @@ public class ParticipantHandler {
@Timed(value = "listener.participant_status_req", description = "PARTICIPANT_STATUS_REQ messages received")
public void handleParticipantStatusReq(final ParticipantStatusReq participantStatusReqMsg) {
var participantStatus = makeHeartbeat(true);
+ participantStatus.setParticipantSupportedElementType(this.supportedAcElementTypes);
publisher.sendParticipantStatus(participantStatus);
}
@@ -148,6 +153,7 @@ public class ParticipantHandler {
var participantRegister = new ParticipantRegister();
participantRegister.setParticipantId(participantId);
participantRegister.setParticipantType(participantType);
+ participantRegister.setParticipantSupportedElementType(supportedAcElementTypes);
publisher.sendParticipantRegister(participantRegister);
}
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java
index dcbfd1b2e..953084890 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021-2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,12 +20,14 @@
package org.onap.policy.clamp.acm.participant.intermediary.parameters;
+import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import lombok.Getter;
import lombok.Setter;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantSupportedElementType;
import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.parameters.validation.ParameterGroupConstraint;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
@@ -58,4 +60,9 @@ public class ParticipantIntermediaryParameters {
@NotNull
@ParameterGroupConstraint
private TopicParameterGroup clampAutomationCompositionTopics;
+
+ @NotNull
+ @Valid
+ private List<ParticipantSupportedElementType> participantSupportedElementTypes;
+
}
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java
index 10c438f93..0e35c480b 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2022 Nordix Foundation.
+ * Copyright (C) 2021-2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,9 @@
package org.onap.policy.clamp.acm.participant.intermediary.main.parameters;
import java.io.File;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -111,6 +113,7 @@ public class CommonTestData {
map.put("participantType", getParticipantId());
map.put("reportingTimeIntervalMs", TIME_INTERVAL);
map.put("clampAutomationCompositionTopics", getTopicParametersMap(false));
+ map.put("participantSupportedElementTypes", new ArrayList<>());
return map;
}