// one section will be marked active
int totalNodes = this.clusterSanityAndCount(cluster);
logger.debug("total nodes: " + totalNodes);
final Cloudworkspace_Type[] vms = cluster.getWorkspace();
Contextualization_Type ctxDoc = null;
for (Cloudworkspace_Type vm : vms) {
if (Boolean.TRUE.equals(vm.getActive())) {
ctxDoc = vm.getCtx(); // clusterSanityAndCount guarantees one and only one
break;
}
}
// clusterSanity checked this already, this is to satisfy automatic
// code analysis
if (ctxDoc == null) {
throw new NullPointerException();
}
this.basicCtxdocValidate(ctxDoc);
for (Identity identity : identities) {
final String hostname = identity.getHostname();
if (hostname != null) {
logger.debug("hostname: " + hostname);
this.newHostname(workspaceID, hostname, resource);
}
final String ip = identity.getIp();
if (ip != null) {
logger.debug("ip: " + ip);
this.newIP(workspaceID, ip, resource);
}
}
resource.addWorkspace(workspaceID,
identities,
ctxDoc.getRequires(),
ctxDoc.getProvides(),
totalNodes);
}