Search in sources :

Example 1 with DispatchSpec

use of com.yahoo.vespa.model.content.DispatchSpec in project vespa by vespa-engine.

the class DomDispatchBuilder method build.

public static DispatchSpec build(ModelElement contentXml) {
    DispatchSpec.Builder builder = new DispatchSpec.Builder();
    ModelElement dispatchElement = contentXml.getChild("dispatch");
    if (dispatchElement == null) {
        return builder.build();
    }
    builder.setNumDispatchGroups(dispatchElement.childAsInteger("num-dispatch-groups"));
    List<ModelElement> groupsElement = dispatchElement.subElements("group");
    if (groupsElement != null) {
        builder.setGroups(buildGroups(groupsElement));
    }
    return builder.build();
}
Also used : ModelElement(com.yahoo.vespa.model.builder.xml.dom.ModelElement) DispatchSpec(com.yahoo.vespa.model.content.DispatchSpec)

Aggregations

ModelElement (com.yahoo.vespa.model.builder.xml.dom.ModelElement)1 DispatchSpec (com.yahoo.vespa.model.content.DispatchSpec)1