Collection<PubSubFeature> features = EnumSet.noneOf(PubSubFeature.class);
for (Feature feature : infoNode.getFeatures()) {
if (feature.getVar().startsWith(PubSub.NAMESPACE + "#")) {
String f = feature.getVar().substring(feature.getVar().indexOf("#") + 1);
try {
PubSubFeature pubSubFeature = PubSubFeature.valueOf(f.toUpperCase().replace("-", "_"));
if (pubSubFeature != null) {
features.add(pubSubFeature);
}
} catch (Exception e) {
logger.log(Level.WARNING, "Server advertised unknown pubsub feature: " + f);