Search in sources :

Example 1 with ClusterParametersBase

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

the class AddDataCenterRM method rollback4.

private void rollback4() {
    Enlistment enlistment = context.enlistment;
    EnlistmentContext enlistmentContext = (EnlistmentContext) enlistment.getContext();
    ActionReturnValue returnValue = context.changeVDSClusterReturnValue;
    if (returnValue != null && returnValue.getSucceeded()) {
        // Remove cluster.
        if (enlistmentContext.getClusterId() != null) {
            Frontend.getInstance().runAction(ActionType.RemoveCluster, new ClusterParametersBase(enlistmentContext.getClusterId()), result -> rollback5());
        }
    } else {
        context.enlistment = null;
        enlistment.done();
    }
}
Also used : ClusterParametersBase(org.ovirt.engine.core.common.action.ClusterParametersBase) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) PreparingEnlistment(org.ovirt.engine.ui.uicompat.PreparingEnlistment) Enlistment(org.ovirt.engine.ui.uicompat.Enlistment)

Example 2 with ClusterParametersBase

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

the class ClusterListModel method onRemove.

public void onRemove() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    ArrayList<ActionParametersBase> prms = new ArrayList<>();
    for (Object a : getSelectedItems()) {
        prms.add(new ClusterParametersBase(((Cluster) a).getId()));
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.RemoveCluster, prms, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : ClusterParametersBase(org.ovirt.engine.core.common.action.ClusterParametersBase) ArrayList(java.util.ArrayList) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Aggregations

ClusterParametersBase (org.ovirt.engine.core.common.action.ClusterParametersBase)2 ArrayList (java.util.ArrayList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1 Enlistment (org.ovirt.engine.ui.uicompat.Enlistment)1 PreparingEnlistment (org.ovirt.engine.ui.uicompat.PreparingEnlistment)1