Search in sources :

Example 1 with RestoreFromCloneSimulatorOperation

use of com.emc.storageos.driver.driversimulator.operations.RestoreFromCloneSimulatorOperation in project coprhd-controller by CoprHD.

the class StorageDriverSimulator method restoreFromClone.

@Override
public DriverTask restoreFromClone(List<VolumeClone> clones) {
    RestoreFromCloneSimulatorOperation restoreCloneSimulatorOperation = new RestoreFromCloneSimulatorOperation(clones);
    if (simulatorConfig.getSimulateAsynchronousResponses()) {
        DriverTask driverTask = restoreCloneSimulatorOperation.getDriverTask();
        taskOperationMap.put(driverTask.getTaskId(), restoreCloneSimulatorOperation);
        return driverTask;
    } else if (simulatorConfig.getSimulateFailures()) {
        String failMsg = restoreCloneSimulatorOperation.getFailureMessage();
        return restoreCloneSimulatorOperation.doFailure(failMsg);
    } else {
        restoreCloneSimulatorOperation.updateCloneInfo(clones);
        String successMsg = restoreCloneSimulatorOperation.getSuccessMessage(clones);
        return restoreCloneSimulatorOperation.doSuccess(successMsg);
    }
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask) RestoreFromCloneSimulatorOperation(com.emc.storageos.driver.driversimulator.operations.RestoreFromCloneSimulatorOperation)

Aggregations

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