Search in sources :

Example 1 with RestoreFromSnapshotSimulatorOperation

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);
    }
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask) RestoreFromSnapshotSimulatorOperation(com.emc.storageos.driver.driversimulator.operations.RestoreFromSnapshotSimulatorOperation)

Aggregations

RestoreFromSnapshotSimulatorOperation (com.emc.storageos.driver.driversimulator.operations.RestoreFromSnapshotSimulatorOperation)1 DriverTask (com.emc.storageos.storagedriver.DriverTask)1