Search in sources :

Example 1 with RecoverTopologyException

use of org.alien4cloud.tosca.editor.exception.RecoverTopologyException in project alien4cloud by alien4cloud.

the class EditorService method checkTopologyRecovery.

/**
 * Checks if the topology needs to be recovered and eventually throws an error.
 * The {@link RecoverTopologyOperation} is cache for later use in recovering process
 */
public void checkTopologyRecovery() {
    Topology topology = EditionContextManager.getTopology();
    EditionContext context = EditionContextManager.get();
    context.setRecoveryOperation(recoveryHelperService.buildRecoveryOperation(topology));
    if (context.getRecoveryOperation() != null) {
        throw new RecoverTopologyException("The topology needs to be recovered.", context.getRecoveryOperation());
    }
}
Also used : Topology(org.alien4cloud.tosca.model.templates.Topology) RecoverTopologyException(org.alien4cloud.tosca.editor.exception.RecoverTopologyException)

Aggregations

RecoverTopologyException (org.alien4cloud.tosca.editor.exception.RecoverTopologyException)1 Topology (org.alien4cloud.tosca.model.templates.Topology)1