}
}
private FailoverFeature getFeature(boolean custom, boolean random, String ...address) {
FailoverFeature feature = new FailoverFeature();
List<String> alternateAddresses = new ArrayList<String>();
for (String s : address) {
alternateAddresses.add(s);
}
if (!random) {
SequentialStrategy strategy = new SequentialStrategy();
strategy.setAlternateAddresses(alternateAddresses);
feature.setStrategy(strategy);
} else {
RandomStrategy strategy = new RandomStrategy();
strategy.setAlternateAddresses(alternateAddresses);
feature.setStrategy(strategy);
}
if (custom) {
FailoverTargetSelector selector = new ReplaceInitialAddressSelector();
feature.setTargetSelector(selector);
}
return feature;
}