Search in sources :

Example 1 with LibvirtSecretParameters

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

the class ProviderSecretListModel method onRemoveSecret.

private void onRemoveSecret() {
    ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
    if (model.getProgress() != null) {
        return;
    }
    ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    for (LibvirtSecret libvirtSecret : getSelectedItems()) {
        LibvirtSecretParameters param = new LibvirtSecretParameters(libvirtSecret);
        parameters.add(param);
    }
    Frontend.getInstance().runMultipleAction(ActionType.RemoveLibvirtSecret, parameters, result -> cancel());
}
Also used : LibvirtSecretParameters(org.ovirt.engine.core.common.action.LibvirtSecretParameters) ArrayList(java.util.ArrayList) LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 2 with LibvirtSecretParameters

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

the class BackendOpenStackVolumeAuthenticationKeyResource method remove.

@Override
public Response remove() {
    LibvirtSecret libvirtSecret = map(get(), null);
    LibvirtSecretParameters parameters = new LibvirtSecretParameters(libvirtSecret);
    return performAction(ActionType.RemoveLibvirtSecret, parameters);
}
Also used : LibvirtSecretParameters(org.ovirt.engine.core.common.action.LibvirtSecretParameters) LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret)

Example 3 with LibvirtSecretParameters

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

the class LibvirtSecretModel method onSave.

private void onSave() {
    if (!validate()) {
        return;
    }
    ActionType actionType = isNew() ? ActionType.AddLibvirtSecret : ActionType.UpdateLibvirtSecret;
    flush();
    Frontend.getInstance().runAction(actionType, new LibvirtSecretParameters(getEntity()), result -> {
        ActionReturnValue res = result.getReturnValue();
        if (res.getSucceeded()) {
            getCancelCommand().execute();
        }
    }, this);
}
Also used : LibvirtSecretParameters(org.ovirt.engine.core.common.action.LibvirtSecretParameters) ActionType(org.ovirt.engine.core.common.action.ActionType) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue)

Aggregations

LibvirtSecretParameters (org.ovirt.engine.core.common.action.LibvirtSecretParameters)3 LibvirtSecret (org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret)2 ArrayList (java.util.ArrayList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 ActionType (org.ovirt.engine.core.common.action.ActionType)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1