Search in sources :

Example 56 with ActionParametersBase

use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.

the class HostListModel method onStop.

public void onStop() {
    ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
    if (model.getProgress() != null) {
        return;
    }
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VDS vds = (VDS) item;
        list.add(new FenceVdsActionParameters(vds.getId()));
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.StopVds, list, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancelConfirm();
    }, model);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) FenceVdsActionParameters(org.ovirt.engine.core.common.action.FenceVdsActionParameters) ArrayList(java.util.ArrayList) JsSingleValueStringObject(org.ovirt.engine.ui.frontend.utils.JsSingleValueStringObject) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) HostMaintenanceConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.HostMaintenanceConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 57 with ActionParametersBase

use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.

the class HostListModel method start.

public void start() {
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VDS vds = (VDS) item;
        list.add(new FenceVdsActionParameters(vds.getId()));
    }
    Frontend.getInstance().runMultipleAction(ActionType.StartVds, list, result -> {
    }, null);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) FenceVdsActionParameters(org.ovirt.engine.core.common.action.FenceVdsActionParameters) ArrayList(java.util.ArrayList) JsSingleValueStringObject(org.ovirt.engine.ui.frontend.utils.JsSingleValueStringObject) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 58 with ActionParametersBase

use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.

the class HostListModel method onManualFence.

public void onManualFence() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (!model.validate()) {
        return;
    }
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VDS vds = (VDS) item;
        FenceVdsManualyParameters parameters = new FenceVdsManualyParameters(true);
        parameters.setStoragePoolId(vds.getStoragePoolId());
        parameters.setVdsId(vds.getId());
        list.add(parameters);
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.FenceVdsManualy, list, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) ArrayList(java.util.ArrayList) JsSingleValueStringObject(org.ovirt.engine.ui.frontend.utils.JsSingleValueStringObject) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) HostMaintenanceConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.HostMaintenanceConfirmationModel) FenceVdsManualyParameters(org.ovirt.engine.core.common.action.FenceVdsManualyParameters) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 59 with ActionParametersBase

use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.

the class HostListModel method refreshCapabilities.

private void refreshCapabilities() {
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VDS vds = (VDS) item;
        list.add(new VdsActionParameters(vds.getId()));
    }
    Frontend.getInstance().runMultipleAction(ActionType.RefreshHost, list, result -> {
    }, null);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) ArrayList(java.util.ArrayList) VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters) UpdateVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters) AddVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters) FenceVdsActionParameters(org.ovirt.engine.core.common.action.FenceVdsActionParameters) JsSingleValueStringObject(org.ovirt.engine.ui.frontend.utils.JsSingleValueStringObject) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 60 with ActionParametersBase

use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.

the class SharedMacPoolListModel method onRemove.

private void onRemove() {
    cancel();
    ArrayList<ActionParametersBase> params = new ArrayList<>();
    for (MacPool macPool : getSelectedItems()) {
        params.add(new RemoveMacPoolByIdParameters(macPool.getId()));
    }
    Frontend.getInstance().runMultipleAction(ActionType.RemoveMacPool, params);
}
Also used : MacPool(org.ovirt.engine.core.common.businessentities.MacPool) ArrayList(java.util.ArrayList) RemoveMacPoolByIdParameters(org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Aggregations

ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)204 ArrayList (java.util.ArrayList)149 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)53 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)52 ActionType (org.ovirt.engine.core.common.action.ActionType)45 Test (org.junit.Test)44 Guid (org.ovirt.engine.core.compat.Guid)35 VDS (org.ovirt.engine.core.common.businessentities.VDS)26 List (java.util.List)23 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)23 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)20 VM (org.ovirt.engine.core.common.businessentities.VM)19 QueryType (org.ovirt.engine.core.common.queries.QueryType)18 Frontend (org.ovirt.engine.ui.frontend.Frontend)18 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)18 IFrontendActionAsyncCallback (org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback)18 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)16 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)16 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)16 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)15