Search in sources :

Example 1 with Configserver

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;
}
Also used : SimpleConfigProducer(com.yahoo.vespa.model.SimpleConfigProducer) Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) Configserver(com.yahoo.vespa.model.admin.Configserver)

Aggregations

SimpleConfigProducer (com.yahoo.vespa.model.SimpleConfigProducer)1 Configserver (com.yahoo.vespa.model.admin.Configserver)1 ArrayList (java.util.ArrayList)1 Element (org.w3c.dom.Element)1