use of org.opentosca.toscana.core.parse.model.MappingEntity in project TOSCAna by StuPro-TOSCAna.
the class NavigationUtil method getEnclosingNode.
/**
* @return the MappingEntity representing the parent tosca node of given entity
*/
public static MappingEntity getEnclosingNode(Entity current) {
Entity parent = current;
do {
current = parent;
parent = current.getParent().orElseThrow(() -> new IllegalStateException("Entity does not have a parent"));
} while (!ToscaStructure.NODE_TEMPLATES.equals(parent.getId()));
return (MappingEntity) current;
}
use of org.opentosca.toscana.core.parse.model.MappingEntity in project TOSCAna by StuPro-TOSCAna.
the class ToscaStructure method buildBasicStructure.
public static void buildBasicStructure(ServiceGraph graph) {
graph.addEntity(new MappingEntity(REPOSITORIES, graph));
graph.addEntity(new MappingEntity(TOPOLOGY_TEMPLATE, graph));
graph.addEntity(new MappingEntity(NODE_TEMPLATES, graph));
graph.addEntity(new MappingEntity(INPUTS, graph));
graph.addEntity(new MappingEntity(OUTPUTS, graph));
}
Aggregations