use of org.alien4cloud.tosca.editor.operations.RecoverTopologyOperation in project alien4cloud by alien4cloud.
the class EditorService method getRecoverTopologyOperation.
private RecoverTopologyOperation getRecoverTopologyOperation(String topologyId) {
try {
editionContextManager.init(topologyId);
RecoverTopologyOperation operation = EditionContextManager.get().getRecoveryOperation();
EditionContextManager.get().setRecoveryOperation(null);
return operation != null ? operation : new RecoverTopologyOperation();
} finally {
editionContextManager.destroy();
}
}
use of org.alien4cloud.tosca.editor.operations.RecoverTopologyOperation in project alien4cloud by alien4cloud.
the class EditorService method recover.
/**
* Recovers a topology
*
* @param topologyId The id of the topology.
* @param lastOperationId
* @return
*/
public TopologyDTO recover(String topologyId, String lastOperationId) {
// The recovering process is done via operation so that we can have it in the history
RecoverTopologyOperation operation = getRecoverTopologyOperation(topologyId);
operation.setPreviousOperationId(lastOperationId);
return executeAndSave(topologyId, operation);
}
use of org.alien4cloud.tosca.editor.operations.RecoverTopologyOperation in project alien4cloud by alien4cloud.
the class EditorTopologyRecoveryHelperService method buildRecoveryOperation.
/**
* analyse a given topology and build a {@link RecoverTopologyOperation} to apply to the topology to make it synch
* with the dependencies present in the repository
*
* @param topology
* @return a {@link RecoverTopologyOperation}
*/
@ToscaContextual(requiresNew = true)
public RecoverTopologyOperation buildRecoveryOperation(Topology topology) {
RecoverTopologyOperation operation = new RecoverTopologyOperation();
buildRecoveryOperation(topology, operation);
return CollectionUtils.isNotEmpty(operation.getUpdatedDependencies()) ? operation : null;
}
Aggregations