Search in sources :

Example 1 with HttpFilterConfig

use of com.tremolosecurity.proxy.filter.HttpFilterConfig in project OpenUnison by TremoloSecurity.

the class UrlComp method init.

/**
 * Initializes a URL from the XML configuration.  Multiple calls perform no actions.
 * @throws Exception
 */
public void init() throws Exception {
    if (!this.inited) {
        this.lowerCasePath = url.getUri().toLowerCase();
        this.filterChain = new ArrayList<HttpFilter>();
        List<FilterConfigType> filterCfgs = url.getFilterChain().getFilter();
        if (filterCfgs != null) {
            Iterator<FilterConfigType> it = filterCfgs.iterator();
            while (it.hasNext()) {
                FilterConfigType cfg = it.next();
                HttpFilter filter = (HttpFilter) Class.forName(cfg.getClazz()).newInstance();
                this.filterChain.add(filter);
                filter.initFilter(new HttpFilterConfig(cfg, this.cfg));
            }
        }
        this.inited = true;
    }
}
Also used : FilterConfigType(com.tremolosecurity.config.xml.FilterConfigType) HttpFilterConfig(com.tremolosecurity.proxy.filter.HttpFilterConfig) HttpFilter(com.tremolosecurity.proxy.filter.HttpFilter)

Aggregations

FilterConfigType (com.tremolosecurity.config.xml.FilterConfigType)1 HttpFilter (com.tremolosecurity.proxy.filter.HttpFilter)1 HttpFilterConfig (com.tremolosecurity.proxy.filter.HttpFilterConfig)1