Search in sources :

Example 1 with NullRule

use of com.predic8.membrane.core.rules.NullRule in project service-proxy by membrane.

the class OAuth2TestUtil method makeExchangeValid.

public static void makeExchangeValid(Exchange exc) throws Exception {
    exc.setOriginalRequestUri(exc.getRequest().getUri());
    exc.setRule(new NullRule());
}
Also used : NullRule(com.predic8.membrane.core.rules.NullRule)

Example 2 with NullRule

use of com.predic8.membrane.core.rules.NullRule in project service-proxy by membrane.

the class RuleMatchingInterceptor method handleRequest.

@Override
public Outcome handleRequest(Exchange exc) throws Exception {
    if (exc.getRule() != null)
        return Outcome.CONTINUE;
    Rule rule = getRule(exc);
    exc.setRule(rule);
    if (exc.getRule().getSslOutboundContext() != null) {
        exc.setProperty(Exchange.SSL_CONTEXT, exc.getRule().getSslOutboundContext());
    }
    if (rule instanceof NullRule) {
        handleNoRuleFound(exc);
        return Outcome.ABORT;
    }
    if (xForwardedForEnabled && (rule instanceof AbstractServiceProxy))
        insertXForwardedFor(exc);
    return Outcome.CONTINUE;
}
Also used : AbstractServiceProxy(com.predic8.membrane.core.rules.AbstractServiceProxy) NullRule(com.predic8.membrane.core.rules.NullRule) Rule(com.predic8.membrane.core.rules.Rule) NullRule(com.predic8.membrane.core.rules.NullRule) ProxyRule(com.predic8.membrane.core.rules.ProxyRule)

Aggregations

NullRule (com.predic8.membrane.core.rules.NullRule)2 AbstractServiceProxy (com.predic8.membrane.core.rules.AbstractServiceProxy)1 ProxyRule (com.predic8.membrane.core.rules.ProxyRule)1 Rule (com.predic8.membrane.core.rules.Rule)1