use of org.opentosca.toscana.core.plugin.lifecycle.LifecyclePhase in project TOSCAna by StuPro-TOSCAna.
the class CsarImpl method wineryValidate.
private boolean wineryValidate() {
LifecyclePhase phase = getLifecyclePhase(Csar.Phase.VALIDATE);
phase.setState(LifecyclePhase.State.EXECUTING);
logger.info("Validating csar '{}'", identifier);
logger.debug(" > Validating TOSCA template", identifier);
try {
Reader.getReader().parse(Paths.get(this.contentDir.toString()), Paths.get(getTemplate().toString()));
logger.info("Template validation successful");
phase.setState(LifecyclePhase.State.DONE);
return true;
} catch (InvalidCsarException e) {
logger.error("Template validation failed");
phase.setState(LifecyclePhase.State.FAILED);
return false;
} catch (MultiException e) {
logger.error("Template validation failed", e);
phase.setState(LifecyclePhase.State.FAILED);
return false;
}
}
Aggregations