Search in sources :

Example 16 with MappingEntity

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;
}
Also used : MappingEntity(org.opentosca.toscana.core.parse.model.MappingEntity) Entity(org.opentosca.toscana.core.parse.model.Entity) MappingEntity(org.opentosca.toscana.core.parse.model.MappingEntity)

Example 17 with MappingEntity

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));
}
Also used : MappingEntity(org.opentosca.toscana.core.parse.model.MappingEntity)

Aggregations

MappingEntity (org.opentosca.toscana.core.parse.model.MappingEntity)17 Entity (org.opentosca.toscana.core.parse.model.Entity)10 ScalarEntity (org.opentosca.toscana.core.parse.model.ScalarEntity)9 ServiceGraph (org.opentosca.toscana.core.parse.model.ServiceGraph)7 EntityId (org.opentosca.toscana.model.EntityId)5 Test (org.junit.Test)3 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)3 Artifact (org.opentosca.toscana.model.artifact.Artifact)3 RootNode (org.opentosca.toscana.model.node.RootNode)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1 ToscaTemplateException (org.opentosca.toscana.core.parse.ToscaTemplateException)1 TypeWrapper (org.opentosca.toscana.core.parse.converter.TypeWrapper)1 BaseToscaElement (org.opentosca.toscana.model.BaseToscaElement)1 WebApplication (org.opentosca.toscana.model.node.WebApplication)1 Operation (org.opentosca.toscana.model.operation.Operation)1 RootRelationship (org.opentosca.toscana.model.relation.RootRelationship)1 Requirement (org.opentosca.toscana.model.requirement.Requirement)1