From a6f4d0cbdcde3b7680a4e0cb9be0f3616588846c Mon Sep 17 00:00:00 2001 From: LSZ Date: Tue, 31 Aug 2021 17:31:13 +0200 Subject: [PATCH] change to check if IAAS nodes are already collected by SAL (BYON nodes are not of our interest here) - we want to know if the background process to build NCs for IAAS has finished --- .../ProactiveClientServiceForIntegrationImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mule_esb/mule-integration/src/main/java/cloud/morphemic/mule_integration/proactive/ProactiveClientServiceForIntegrationImpl.java b/mule_esb/mule-integration/src/main/java/cloud/morphemic/mule_integration/proactive/ProactiveClientServiceForIntegrationImpl.java index 6843a1a9..54b90b5d 100644 --- a/mule_esb/mule-integration/src/main/java/cloud/morphemic/mule_integration/proactive/ProactiveClientServiceForIntegrationImpl.java +++ b/mule_esb/mule-integration/src/main/java/cloud/morphemic/mule_integration/proactive/ProactiveClientServiceForIntegrationImpl.java @@ -4,6 +4,8 @@ import cloud.morphemic.connectors.proactive.ProactiveClientServiceConnector; import com.google.common.base.MoreObjects; import org.activeeon.morphemic.PAGateway; import org.activeeon.morphemic.model.NodeCandidate; +import org.activeeon.morphemic.model.NodeType; +import org.activeeon.morphemic.model.NodeTypeRequirement; import org.apache.commons.lang3.ObjectUtils; import org.json.JSONArray; import org.json.JSONObject; @@ -11,10 +13,7 @@ import org.mule.api.annotations.param.Payload; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Optional; -import java.util.UUID; +import java.util.*; public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientServiceConnector implements ProactiveClientServiceForIntegration { private static final Logger log = LoggerFactory.getLogger(ProactiveClientServiceForIntegrationImpl.class); @@ -108,7 +107,10 @@ public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientSer log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: starting..."); Optional paGatewayOptional = getPAGateway(); if(paGatewayOptional.isPresent()) { - List nodeCandidates = paGatewayOptional.get().findNodeCandidates(null); + NodeTypeRequirement nodeTypeRequirement = new NodeTypeRequirement(); + nodeTypeRequirement.setNodeTypes(Collections.singletonList(NodeType.IAAS)); + log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: checking only for occurrence of IAAS nodeCandidates, passing requirement: {}", nodeTypeRequirement); + List nodeCandidates = paGatewayOptional.get().findNodeCandidates(Collections.singletonList(nodeTypeRequirement)); log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: nodeCandidates size= {}", nodeCandidates.size()); if (nodeCandidates.isEmpty()) { -- GitLab