use of org.ovirt.engine.core.common.businessentities.network.BondMode in project ovirt-engine by oVirt.
the class VdsBrokerObjectsBuilder method normalizeBondOptions.
private static String normalizeBondOptions(String bondOptions) {
Matcher matcher = Pattern.compile("mode=([\\w-\\.]+)").matcher(bondOptions);
if (!matcher.find()) {
return bondOptions;
}
BondMode bondMode = BondMode.getBondMode(matcher.group(1));
if (bondMode != null) {
return matcher.replaceAll("mode=" + bondMode.getValue());
}
return bondOptions;
}
use of org.ovirt.engine.core.common.businessentities.network.BondMode in project ovirt-engine by oVirt.
the class AsyncDataProvider method getBondingOptionListDependingOnNetwork.
public ArrayList<Map.Entry<String, EntityModel<String>>> getBondingOptionListDependingOnNetwork(RefObject<Map.Entry<String, EntityModel<String>>> defaultItem, boolean hasVmNetworkAttached) {
ArrayList<Map.Entry<String, EntityModel<String>>> list = new ArrayList<>();
for (BondMode mode : BondMode.values()) {
if (!mode.isBondModeValidForVmNetwork() && hasVmNetworkAttached) {
continue;
}
KeyValuePairCompat<String, EntityModel<String>> bondOption = getBondOption(mode);
list.add(bondOption);
if (mode.equals(BondMode.BOND4)) {
defaultItem.argvalue = bondOption;
}
}
EntityModel<String> entityModel = new EntityModel<>();
// $NON-NLS-1$
entityModel.setEntity("");
list.add(new KeyValuePairCompat<>(SetupNetworksBondModel.CUSTOM_BONDING_MODE, entityModel));
return list;
}
Aggregations