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;
}
Aggregations