Search in sources :

Example 36 with ActionParametersBase

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

the class PoolVmListModel method onDetach.

public void onDetach() {
    ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
    boolean latchChecked = !model.validate();
    if (model.getProgress() != null || latchChecked) {
        return;
    }
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VM vm = (VM) item;
        list.add(new RemoveVmFromPoolParameters(vm.getId(), true, true));
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.RemoveVmFromPool, list, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : RemoveVmFromPoolParameters(org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters) VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 37 with ActionParametersBase

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

the class VmListModel method cancelMigration.

private void cancelMigration() {
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VM a = (VM) item;
        list.add(new VmOperationParameterBase(a.getId()));
    }
    Frontend.getInstance().runMultipleAction(ActionType.CancelMigrateVm, list, result -> {
    }, null);
}
Also used : VmOperationParameterBase(org.ovirt.engine.core.common.action.VmOperationParameterBase) VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 38 with ActionParametersBase

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

the class VmListModel method cancelConversion.

private void cancelConversion() {
    List<ActionParametersBase> parameters = new ArrayList<>();
    for (VM vm : getSelectedItems()) {
        parameters.add(new VmOperationParameterBase(vm.getId()));
    }
    Frontend.getInstance().runMultipleAction(ActionType.CancelConvertVm, parameters);
}
Also used : VmOperationParameterBase(org.ovirt.engine.core.common.action.VmOperationParameterBase) VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 39 with ActionParametersBase

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

the class VmListModel method run.

private void run() {
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VM a = (VM) item;
        list.add(new RunVmParams(a.getId()));
    }
    Frontend.getInstance().runMultipleAction(ActionType.RunVm, list, result -> {
    }, null);
}
Also used : VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList) RunVmParams(org.ovirt.engine.core.common.action.RunVmParams) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 40 with ActionParametersBase

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

the class VmListModel method pause.

private void pause() {
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VM a = (VM) item;
        list.add(new VmOperationParameterBase(a.getId()));
    }
    Frontend.getInstance().runMultipleAction(ActionType.HibernateVm, list, result -> {
    }, null);
}
Also used : VmOperationParameterBase(org.ovirt.engine.core.common.action.VmOperationParameterBase) VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList) 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