Commit a6f4d0cb authored by Łukasz Szymański's avatar Łukasz Szymański
Browse files

change to check if IAAS nodes are already collected by SAL (BYON nodes are not...

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
parent 71593047
Pipeline #15609 passed with stages
in 6 minutes and 5 seconds
......@@ -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<PAGateway> paGatewayOptional = getPAGateway();
if(paGatewayOptional.isPresent()) {
List<NodeCandidate> 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<NodeCandidate> nodeCandidates = paGatewayOptional.get().findNodeCandidates(Collections.singletonList(nodeTypeRequirement));
log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: nodeCandidates size= {}", nodeCandidates.size());
if (nodeCandidates.isEmpty()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment