Search in sources :

Example 1 with ExportRepoImageParameters

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

the class ExportRepoImageModel method executeCommand.

@Override
public void executeCommand(UICommand command) {
    super.executeCommand(command);
    startProgress();
    ArrayList<ActionParametersBase> actionParameters = new ArrayList<>();
    for (EntityModel entity : getEntities()) {
        actionParameters.add(new ExportRepoImageParameters(// Source
        ((DiskImage) entity.getEntity()).getId(), // Destination
        getStorageDomain().getSelectedItem().getId()));
    }
    Frontend.getInstance().runMultipleAction(ActionType.ExportRepoImage, actionParameters, result -> {
        ImportExportRepoImageBaseModel model = (ImportExportRepoImageBaseModel) result.getState();
        model.stopProgress();
        model.cancel();
    }, this);
}
Also used : ArrayList(java.util.ArrayList) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ExportRepoImageParameters(org.ovirt.engine.core.common.action.ExportRepoImageParameters) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Aggregations

ArrayList (java.util.ArrayList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ExportRepoImageParameters (org.ovirt.engine.core.common.action.ExportRepoImageParameters)1 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)1 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)1