use of org.opentosca.toscana.model.relation.RootRelationship in project TOSCAna by StuPro-TOSCAna.
the class CloudFormationVisitorExtension method getHostsOfConnectedTo.
protected Set<Compute> getHostsOfConnectedTo(RootNode node) {
Set<Compute> connected = new HashSet<>();
Set<RootRelationship> incomingEdges = topology.incomingEdgesOf(node);
for (RootRelationship incomingEdge : incomingEdges) {
RootNode source = topology.getEdgeSource(incomingEdge);
if (source instanceof WebApplication) {
WebApplication webApplication = (WebApplication) source;
Compute compute = getCompute(webApplication);
connected.add(compute);
}
}
return connected;
}
use of org.opentosca.toscana.model.relation.RootRelationship in project TOSCAna by StuPro-TOSCAna.
the class EffectiveModel method initEdges.
private void initEdges() {
logger.info("Populating edges");
for (RootNode node : topology.vertexSet()) {
for (Requirement<?, ?, ?> requirement : node.getRequirements()) {
Set<? extends RootNode> fulfillers = requirement.getFulfillers();
for (RootNode fulfiller : fulfillers) {
RootRelationship relationship = requirement.get(requirement.RELATIONSHIP);
logger.info(LogFormat.pointAt(1, 25, node.getEntityName(), relationship.getClass().getSimpleName(), fulfiller.getEntityName()));
topology.addEdge(node, fulfiller, relationship);
}
}
}
initialized = true;
}
Aggregations