use of com.yahoo.vespa.model.admin.Configserver in project vespa by vespa-engine.
the class DomAdminV2Builder method getConfigServers.
// Extra stupid because configservers tag is voluntary
private List<Configserver> getConfigServers(AbstractConfigProducer parent, Element adminE) {
SimpleConfigProducer configServers = new SimpleConfigProducer(parent, "configservers");
List<Configserver> cfgs = new ArrayList<>();
Element configserversE = XML.getChild(adminE, "configservers");
if (configserversE == null) {
Element configserverE = XML.getChild(adminE, "configserver");
if (configserverE == null) {
configserverE = XML.getChild(adminE, "adminserver");
} else {
parent.deployLogger().log(LogLevel.INFO, "Specifying configserver without parent element configservers in services.xml is deprecated");
}
Configserver cfgs0 = new ConfigserverBuilder(0).build(configServers, configserverE);
cfgs0.setProp("index", 0);
cfgs.add(cfgs0);
return cfgs;
}
// configservers tag in use
int i = 0;
for (Element configserverE : XML.getChildren(configserversE, "configserver")) {
Configserver cfgsrv = new ConfigserverBuilder(i).build(configServers, configserverE);
cfgsrv.setProp("index", i);
cfgs.add(cfgsrv);
i++;
}
return cfgs;
}
Aggregations