use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostListModel method checkForUpgrade.
public void checkForUpgrade() {
final VDS host = getSelectedItem();
Model model = new HostUpgradeCheckConfirmationModel(host);
setWindow(model);
model.initialize();
// $NON-NLS-1$
model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this));
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostListModel method postOnAssignTags.
@Override
public void postOnAssignTags(Map<Guid, Boolean> attachedTags) {
TagListModel model = (TagListModel) getWindow();
ArrayList<Guid> hostIds = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
hostIds.add(vds.getId());
}
// prepare attach/detach lists
ArrayList<Guid> tagsToAttach = new ArrayList<>();
ArrayList<Guid> tagsToDetach = new ArrayList<>();
if (model.getItems() != null && model.getItems().size() > 0) {
ArrayList<TagModel> tags = (ArrayList<TagModel>) model.getItems();
TagModel rootTag = tags.get(0);
TagModel.recursiveEditAttachDetachLists(rootTag, attachedTags, tagsToAttach, tagsToDetach);
}
ArrayList<ActionParametersBase> prmsToAttach = new ArrayList<>();
for (Guid tag_id : tagsToAttach) {
prmsToAttach.add(new AttachEntityToTagParameters(tag_id, hostIds));
}
Frontend.getInstance().runMultipleAction(ActionType.AttachVdsToTag, prmsToAttach);
ArrayList<ActionParametersBase> prmsToDetach = new ArrayList<>();
for (Guid tag_id : tagsToDetach) {
prmsToDetach.add(new AttachEntityToTagParameters(tag_id, hostIds));
}
Frontend.getInstance().runMultipleAction(ActionType.DetachVdsFromTag, prmsToDetach);
cancel();
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostListModel method stop.
public void stop(String uiCommand) {
ConfirmationModel model = new ConfirmationModel();
setConfirmWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().stopHostsTitle());
model.setHelpTag(HelpTag.stop_host);
// $NON-NLS-1$
model.setHashName("stop_host");
model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToStopTheFollowingHostsMsg());
// model.Items = SelectedItems.Cast<VDS>().Select(a => a.vds_name);
ArrayList<String> items = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
items.add(vds.getName());
}
model.setItems(items);
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand(uiCommand, this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(tempVar2);
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostListModel method numaSupport.
private void numaSupport() {
if (getWindow() != null) {
return;
}
VDS host = getSelectedItem();
List<VDS> hosts = getSelectedItems();
NumaSupportModel model = new NumaSupportModel(hosts, host, this);
setWindow(model);
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostListModel method onSshRestart.
public void onSshRestart() {
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
VdsActionParameters params = new VdsActionParameters(vds.getId());
params.setPrevVdsStatus(vds.getStatus());
list.add(params);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.SshHostReboot, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancelConfirm();
}, model);
}
Aggregations