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);
}
}
Aggregations