use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class PermissionListModel method onRemove.
private void onRemove() {
if (getSelectedItems() != null && getSelectedItems().size() > 0) {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object perm : getSelectedItems()) {
PermissionsOperationsParameters tempVar = new PermissionsOperationsParameters();
tempVar.setPermission((Permission) perm);
list.add(tempVar);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemovePermission, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class SystemPermissionListModel method onRemove.
private void onRemove() {
if (getSelectedItems() != null && getSelectedItems().size() > 0) {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object perm : getSelectedItems()) {
PermissionsOperationsParameters tempVar = new PermissionsOperationsParameters();
tempVar.setPermission((Permission) perm);
list.add(tempVar);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveSystemPermission, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class AffinityLabelListModel method onRemove.
private void onRemove() {
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (Label affinityLabel : getSelectedItems()) {
parameters.add(new LabelActionParameters(affinityLabel));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveLabel, parameters, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class AffinityGroupListModel method onRemove.
private void onRemove() {
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (AffinityGroup affinityGroup : getSelectedItems()) {
parameters.add(new AffinityGroupCRUDParameters(affinityGroup.getId(), affinityGroup));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveAffinityGroup, parameters, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class GuideModel method checkVdsClusterChangeSucceeded.
protected void checkVdsClusterChangeSucceeded(final String searchStr, final List<ActionParametersBase> changeVdsParameterList, final List<ActionParametersBase> activateVdsParameterList) {
final Map<Guid, Guid> hostClusterIdMap = new HashMap<>();
for (ActionParametersBase param : changeVdsParameterList) {
hostClusterIdMap.put(((ChangeVDSClusterParameters) param).getVdsId(), ((ChangeVDSClusterParameters) param).getClusterId());
}
Frontend.getInstance().runQuery(QueryType.Search, new SearchParameters(searchStr, SearchType.VDS), new AsyncQuery<QueryReturnValue>(returnValue -> {
List<VDS> hosts = returnValue.getReturnValue();
boolean succeeded = true;
for (VDS host : hosts) {
if (!host.getClusterId().equals(hostClusterIdMap.get(host.getId()))) {
succeeded = false;
}
}
if (!succeeded) {
getWindow().stopProgress();
cancel();
errorPopupManager.show(ConstantsManager.getInstance().getConstants().hostChangeClusterTimeOut());
} else {
activateHostsAfterClusterChange(searchStr, activateVdsParameterList);
}
}));
}
Aggregations