Search in sources :

Example 1 with CheckModelNodeVisitor

use of org.opentosca.toscana.plugins.cloudformation.visitor.CheckModelNodeVisitor in project TOSCAna by StuPro-TOSCAna.

the class CloudFormationLifecycle method checkModel.

@Override
public boolean checkModel() {
    logger.info("Check model for compatibility to CloudFormation");
    Set<RootNode> nodes = model.getNodes();
    Set<RootRelationship> relationships = model.getTopology().edgeSet();
    try {
        CheckModelNodeVisitor checkModelNodeVisitor = new CheckModelNodeVisitor(context);
        logger.info("Check nodes");
        visitAllNodes(nodes, checkModelNodeVisitor);
        CheckModelRelationshipVisitor checkModelRelationshipVisitor = new CheckModelRelationshipVisitor(context);
        logger.info("Check relationships");
        visitAllRelationships(relationships, checkModelRelationshipVisitor);
    } catch (UnsupportedTypeException ute) {
        logger.error(ute.getMessage());
        return false;
    }
    return true;
}
Also used : RootNode(org.opentosca.toscana.model.node.RootNode) UnsupportedTypeException(org.opentosca.toscana.model.visitor.UnsupportedTypeException) CheckModelNodeVisitor(org.opentosca.toscana.plugins.cloudformation.visitor.CheckModelNodeVisitor) CheckModelRelationshipVisitor(org.opentosca.toscana.plugins.cloudformation.visitor.CheckModelRelationshipVisitor) RootRelationship(org.opentosca.toscana.model.relation.RootRelationship)

Aggregations

RootNode (org.opentosca.toscana.model.node.RootNode)1 RootRelationship (org.opentosca.toscana.model.relation.RootRelationship)1 UnsupportedTypeException (org.opentosca.toscana.model.visitor.UnsupportedTypeException)1 CheckModelNodeVisitor (org.opentosca.toscana.plugins.cloudformation.visitor.CheckModelNodeVisitor)1 CheckModelRelationshipVisitor (org.opentosca.toscana.plugins.cloudformation.visitor.CheckModelRelationshipVisitor)1