use of com.emc.storageos.driver.driversimulator.operations.RestoreFromSnapshotSimulatorOperation in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method restoreSnapshot.
@Override
public DriverTask restoreSnapshot(List<VolumeSnapshot> snapshots) {
RestoreFromSnapshotSimulatorOperation restoreSnapshotSimulatorOperation = new RestoreFromSnapshotSimulatorOperation(snapshots);
if (simulatorConfig.getSimulateAsynchronousResponses()) {
DriverTask driverTask = restoreSnapshotSimulatorOperation.getDriverTask();
taskOperationMap.put(driverTask.getTaskId(), restoreSnapshotSimulatorOperation);
return driverTask;
} else if (simulatorConfig.getSimulateFailures()) {
String failMsg = restoreSnapshotSimulatorOperation.getFailureMessage();
return restoreSnapshotSimulatorOperation.doFailure(failMsg);
} else {
String successMsg = restoreSnapshotSimulatorOperation.getSuccessMessage(snapshots);
return restoreSnapshotSimulatorOperation.doSuccess(successMsg);
}
}
Aggregations