Search in sources :

Example 1 with ExpandVolumeSimulatorOperation

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

the class StorageDriverSimulator method expandVolume.

@Override
public DriverTask expandVolume(StorageVolume volume, long newCapacity) {
    ExpandVolumeSimulatorOperation expandVolumeSimulatorOperation = new ExpandVolumeSimulatorOperation(volume, newCapacity);
    if (simulatorConfig.getSimulateAsynchronousResponses()) {
        DriverTask driverTask = expandVolumeSimulatorOperation.getDriverTask();
        taskOperationMap.put(driverTask.getTaskId(), expandVolumeSimulatorOperation);
        return driverTask;
    } else if (simulatorConfig.getSimulateFailures()) {
        String failMsg = expandVolumeSimulatorOperation.getFailureMessage();
        return expandVolumeSimulatorOperation.doFailure(failMsg);
    } else {
        expandVolumeSimulatorOperation.updateVolumeInfo(volume, newCapacity);
        String successMsg = expandVolumeSimulatorOperation.getSuccessMessage(volume);
        return expandVolumeSimulatorOperation.doSuccess(successMsg);
    }
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask) ExpandVolumeSimulatorOperation(com.emc.storageos.driver.driversimulator.operations.ExpandVolumeSimulatorOperation)

Aggregations

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