use of org.ovirt.engine.core.common.action.StoragePoolParametersBase in project ovirt-engine by oVirt.
the class DataCenterListModel method onRemove.
public void onRemove() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (StoragePool a : getSelectedItems()) {
parameters.add(new StoragePoolParametersBase(a.getId()));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveStoragePool, parameters, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.StoragePoolParametersBase in project ovirt-engine by oVirt.
the class DataCenterListModel method onForceRemove.
public void onForceRemove() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (!model.validate()) {
return;
}
StoragePoolParametersBase tempVar = new StoragePoolParametersBase(getSelectedItem().getId());
tempVar.setForceDelete(true);
ActionParametersBase parametersBase = tempVar;
Frontend.getInstance().runAction(ActionType.RemoveStoragePool, parametersBase);
cancel();
}
use of org.ovirt.engine.core.common.action.StoragePoolParametersBase in project ovirt-engine by oVirt.
the class RemoveStoragePoolCommandTest method allButMaintenance.
@Test
public void allButMaintenance() {
Arrays.stream(StorageDomainStatus.values()).filter(s -> s != StorageDomainStatus.Maintenance).forEach(s -> {
StoragePoolParametersBase param = new StoragePoolParametersBase();
RemoveStoragePoolCommand<StoragePoolParametersBase> cmd = createCommand(param);
List<StorageDomain> domainsList = createSingleDomainList(s);
domainsList.add(createDomain(StorageDomainStatus.Maintenance));
assertFalse(cmd.validateDomainsInMaintenance(domainsList));
});
}
use of org.ovirt.engine.core.common.action.StoragePoolParametersBase in project ovirt-engine by oVirt.
the class RemoveStoragePoolCommandTest method emptyDomainList.
@Test
public void emptyDomainList() {
StoragePoolParametersBase param = new StoragePoolParametersBase();
RemoveStoragePoolCommand<StoragePoolParametersBase> cmd = createCommand(param);
List<StorageDomain> domainsList = new ArrayList<>();
assertTrue(cmd.validateDomainsInMaintenance(domainsList));
}
use of org.ovirt.engine.core.common.action.StoragePoolParametersBase in project ovirt-engine by oVirt.
the class RemoveStoragePoolCommandTest method onlyMaintenanceDomainInList.
@Test
public void onlyMaintenanceDomainInList() {
StoragePoolParametersBase param = new StoragePoolParametersBase();
RemoveStoragePoolCommand<StoragePoolParametersBase> cmd = createCommand(param);
assertTrue(cmd.validateDomainsInMaintenance(createSingleDomainList(StorageDomainStatus.Maintenance)));
}
Aggregations