Search in sources :

Example 1 with MigrationBandwidthLimitType

use of org.ovirt.engine.core.common.businessentities.MigrationBandwidthLimitType in project ovirt-engine by oVirt.

the class ClusterPopupPresenterWidget method computeCustomMigrationBandwidthLimitEnabledState.

/**
 * @return true ~ enable, false ~ disable, null ~ can't be computed
 */
private Optional<Boolean> computeCustomMigrationBandwidthLimitEnabledState(ClusterModel clusterModel) {
    final Version clusterVersion = clusterModel.getVersion().getSelectedItem();
    final MigrationBandwidthLimitType limitType = clusterModel.getMigrationBandwidthLimitType().getSelectedItem();
    if (clusterVersion == null || limitType == null) {
        return Optional.empty();
    }
    final Optional<Boolean> enabled = Optional.of(AsyncDataProvider.getInstance().isMigrationPoliciesSupported(clusterVersion) && limitType == MigrationBandwidthLimitType.CUSTOM);
    return enabled;
}
Also used : MigrationBandwidthLimitType(org.ovirt.engine.core.common.businessentities.MigrationBandwidthLimitType) Version(org.ovirt.engine.core.compat.Version)

Aggregations

MigrationBandwidthLimitType (org.ovirt.engine.core.common.businessentities.MigrationBandwidthLimitType)1 Version (org.ovirt.engine.core.compat.Version)1