Search in sources :

Example 1 with StandardLifecycle

use of org.opentosca.toscana.model.operation.StandardLifecycle in project TOSCAna by StuPro-TOSCAna.

the class NodeVisitor method getScripts.

private void getScripts(RootNode node, Application application) {
    StandardLifecycle lifecycle = node.getStandardLifecycle();
    Optional<Operation> configureOptional = lifecycle.getConfigure();
    // get configure script
    if (configureOptional.isPresent()) {
        Optional<Artifact> configureArtifact = configureOptional.get().getArtifact();
        configureArtifact.ifPresent(artifact -> application.addExecuteFile(artifact.getFilePath(), node));
    }
    // get create script
    Optional<Operation> createOptional = lifecycle.getCreate();
    if (createOptional.isPresent()) {
        Optional<Artifact> createArtifact = createOptional.get().getArtifact();
        createArtifact.ifPresent(artifact -> application.addExecuteFile(artifact.getFilePath(), node));
    }
}
Also used : StandardLifecycle(org.opentosca.toscana.model.operation.StandardLifecycle) Operation(org.opentosca.toscana.model.operation.Operation) Artifact(org.opentosca.toscana.model.artifact.Artifact)

Aggregations

Artifact (org.opentosca.toscana.model.artifact.Artifact)1 Operation (org.opentosca.toscana.model.operation.Operation)1 StandardLifecycle (org.opentosca.toscana.model.operation.StandardLifecycle)1