summaryrefslogtreecommitdiffstats
path: root/runtime-acm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime-acm')
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java
index 18a8e8a26..de3fc753b 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java
@@ -21,10 +21,15 @@
package org.onap.policy.clamp.acm.runtime.participants;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
+import org.apache.commons.collections4.MapUtils;
import org.onap.policy.clamp.acm.runtime.supervision.comm.ParticipantStatusReqPublisher;
+import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement;
+import org.onap.policy.clamp.models.acm.concepts.NodeTemplateState;
import org.onap.policy.clamp.models.acm.concepts.ParticipantInformation;
import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
@@ -69,6 +74,10 @@ public class AcmParticipantProvider {
var participant = this.participantProvider.getParticipantById(participantId);
var participantInformation = new ParticipantInformation();
participantInformation.setParticipant(participant);
+
+ participantInformation.setAcElementInstanceMap(getAutomationCompositionElementsForParticipant(participantId));
+ participantInformation.setAcNodeTemplateStateDefinitionMap(getNodeTemplateStatesForParticipant(participantId));
+
return participantInformation;
}
@@ -93,4 +102,21 @@ public class AcmParticipantProvider {
public void sendAllParticipantStatusRequest() {
this.participantStatusReqPublisher.send((UUID) null);
}
+
+ private Map<UUID, AutomationCompositionElement> getAutomationCompositionElementsForParticipant(UUID participantId) {
+ var automationCompositionElements = participantProvider
+ .getAutomationCompositionElements(participantId);
+ Map<UUID, AutomationCompositionElement> map = new HashMap<>();
+ MapUtils.populateMap(map, automationCompositionElements, AutomationCompositionElement::getId);
+
+ return map;
+ }
+
+ private Map<UUID, NodeTemplateState> getNodeTemplateStatesForParticipant(UUID participantId) {
+ var acNodeTemplateStates = participantProvider.getAcNodeTemplateStates(participantId);
+ Map<UUID, NodeTemplateState> map = new HashMap<>();
+ MapUtils.populateMap(map, acNodeTemplateStates, NodeTemplateState::getNodeTemplateStateId);
+
+ return map;
+ }
}