Search in sources :

Example 1 with CreateVolumeCloneSimulatorOperation

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

the class StorageDriverSimulator method createVolumeClone.

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

Aggregations

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