Search in sources :

Example 11 with SnapshotSource

use of bio.terra.service.snapshot.SnapshotSource in project jade-data-repo by DataBiosphere.

the class CreateSnapshotFireStoreDataStep method undoStep.

@Override
public StepResult undoStep(FlightContext context) throws InterruptedException {
    // Remove the snapshot file system and any file dependencies created
    Snapshot snapshot = snapshotService.retrieveByName(snapshotReq.getName());
    fileDao.deleteFilesFromSnapshot(snapshot);
    for (SnapshotSource snapshotSource : snapshot.getSnapshotSources()) {
        Dataset dataset = datasetService.retrieve(snapshotSource.getDataset().getId());
        dependencyDao.deleteSnapshotFileDependencies(dataset, snapshot.getId().toString());
    }
    return StepResult.getStepResultSuccess();
}
Also used : Snapshot(bio.terra.service.snapshot.Snapshot) Dataset(bio.terra.service.dataset.Dataset) SnapshotSource(bio.terra.service.snapshot.SnapshotSource)

Aggregations

SnapshotSource (bio.terra.service.snapshot.SnapshotSource)11 Snapshot (bio.terra.service.snapshot.Snapshot)9 Dataset (bio.terra.service.dataset.Dataset)7 SnapshotMapTable (bio.terra.service.snapshot.SnapshotMapTable)4 MismatchedValueException (bio.terra.service.snapshot.exception.MismatchedValueException)4 StepResult (bio.terra.stairway.StepResult)4 Table (bio.terra.common.Table)3 PdaoException (bio.terra.common.exception.PdaoException)3 SnapshotRequestContentsModel (bio.terra.model.SnapshotRequestContentsModel)3 SnapshotRequestRowIdModel (bio.terra.model.SnapshotRequestRowIdModel)3 SnapshotRequestRowIdTableModel (bio.terra.model.SnapshotRequestRowIdTableModel)3 AssetTable (bio.terra.service.dataset.AssetTable)3 RowIdMatch (bio.terra.service.snapshot.RowIdMatch)3 AssetSpecification (bio.terra.service.dataset.AssetSpecification)2 DatasetService (bio.terra.service.dataset.DatasetService)2 DatasetTable (bio.terra.service.dataset.DatasetTable)2 IamRole (bio.terra.service.iam.IamRole)2 SnapshotMapColumn (bio.terra.service.snapshot.SnapshotMapColumn)2 SnapshotTable (bio.terra.service.snapshot.SnapshotTable)2 FlightMap (bio.terra.stairway.FlightMap)2