Search in sources :

Example 1 with StorageSyncScheduleParameters

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

the class StorageDRListModel method onSave.

private void onSave() {
    final StorageDRModel model = (StorageDRModel) getWindow();
    if (!model.validate()) {
        return;
    }
    StorageDomain storageDomain = getEntity();
    final StorageSyncSchedule syncSchedule = new StorageSyncSchedule();
    syncSchedule.setFrequency(model.getFrequency().getSelectedItem());
    syncSchedule.setHour(model.getHour().getSelectedItem());
    syncSchedule.setMins(model.getMins().getSelectedItem());
    Guid georepId = model.getGeoRepSession().getSelectedItem() != null ? model.getGeoRepSession().getSelectedItem().getId() : null;
    StorageSyncScheduleParameters parameter = new StorageSyncScheduleParameters(syncSchedule, storageDomain.getId(), georepId);
    model.startProgress();
    Frontend.getInstance().runAction(ActionType.ScheduleGlusterStorageSync, parameter, result -> {
        StorageDRListModel localModel = (StorageDRListModel) result.getState();
        model.stopProgress();
        localModel.postSaveAction(result.getReturnValue());
    }, this);
}
Also used : StorageSyncSchedule(org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) Guid(org.ovirt.engine.core.compat.Guid) StorageSyncScheduleParameters(org.ovirt.engine.core.common.action.StorageSyncScheduleParameters)

Aggregations

StorageSyncScheduleParameters (org.ovirt.engine.core.common.action.StorageSyncScheduleParameters)1 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)1 StorageSyncSchedule (org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule)1 Guid (org.ovirt.engine.core.compat.Guid)1