use of org.opentosca.toscana.model.operation.Interface in project TOSCAna by StuPro-TOSCAna.
the class LinkResolver method resolveImplementationArtifacts.
private static void resolveImplementationArtifacts(ServiceGraph graph) {
logger.debug(LogFormat.indent(1, "artifacts"));
Map<String, RootNode> nodes = new TypeWrapper().wrapNodes(graph);
for (RootNode node : nodes.values()) {
for (Interface thisInterface : node.getInterfaces()) {
for (Operation operation : thisInterface.getOperations()) {
Optional<Artifact> optionalArtifact = operation.getArtifact();
if (optionalArtifact.isPresent()) {
Artifact operationArtifact = optionalArtifact.get();
for (Artifact nodeArtifact : node.getArtifacts()) {
if (operationArtifact.getFilePath().equals(nodeArtifact.getEntityName())) {
graph.replaceEntity(operationArtifact.getBackingEntity(), nodeArtifact.getBackingEntity());
logger.debug(LogFormat.pointAt(2, operationArtifact.getBackingEntity().getId(), nodeArtifact.getBackingEntity().getId()));
// at this point it's obvious: we need a better solution for navigating the service graph...
}
}
}
}
}
}
}