Search in sources :

Example 1 with CreateGroupCloneSimulatorOperation

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

the class StorageDriverSimulator method createConsistencyGroupClone.

@Override
public DriverTask createConsistencyGroupClone(VolumeConsistencyGroup consistencyGroup, List<VolumeClone> clones, List<CapabilityInstance> capabilities) {
    CreateGroupCloneSimulatorOperation createCloneSimulatorOperation = new CreateGroupCloneSimulatorOperation(consistencyGroup, 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.updateGroupCloneInfo(consistencyGroup, clones);
        String successMsg = createCloneSimulatorOperation.getSuccessMessage(clones);
        return createCloneSimulatorOperation.doSuccess(successMsg);
    }
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask) CreateGroupCloneSimulatorOperation(com.emc.storageos.driver.driversimulator.operations.CreateGroupCloneSimulatorOperation)

Aggregations

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