Search in sources :

Example 1 with FilterChains

use of com.yahoo.vespa.model.container.http.FilterChains in project vespa by vespa-engine.

the class HttpBuilder method doBuild.

@Override
protected Http doBuild(AbstractConfigProducer ancestor, Element spec) {
    FilterChains filterChains;
    List<Binding> bindings = new ArrayList<>();
    AccessControl accessControl = null;
    Element filteringElem = XML.getChild(spec, "filtering");
    if (filteringElem != null) {
        filterChains = new FilterChainsBuilder().build(ancestor, filteringElem);
        bindings = readFilterBindings(filteringElem);
        Element accessControlElem = XML.getChild(filteringElem, "access-control");
        if (accessControlElem != null) {
            accessControl = buildAccessControl(ancestor, accessControlElem);
            bindings.addAll(accessControl.getBindings());
            filterChains.add(new Chain<>(FilterChains.emptyChainSpec(ACCESS_CONTROL_CHAIN_ID)));
        }
    } else {
        filterChains = new FilterChainsBuilder().newChainsInstance(ancestor);
    }
    Http http = new Http(bindings, accessControl);
    http.setFilterChains(filterChains);
    buildHttpServers(ancestor, http, spec);
    return http;
}
Also used : Binding(com.yahoo.vespa.model.container.http.Http.Binding) Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) Http(com.yahoo.vespa.model.container.http.Http) FilterChains(com.yahoo.vespa.model.container.http.FilterChains) AccessControl(com.yahoo.vespa.model.container.http.AccessControl)

Aggregations

AccessControl (com.yahoo.vespa.model.container.http.AccessControl)1 FilterChains (com.yahoo.vespa.model.container.http.FilterChains)1 Http (com.yahoo.vespa.model.container.http.Http)1 Binding (com.yahoo.vespa.model.container.http.Http.Binding)1 ArrayList (java.util.ArrayList)1 Element (org.w3c.dom.Element)1