EffectivePolicyImpl createOutPolicyInfo() { return new EffectivePolicyImpl(); }
public void initialise(EndpointPolicy epi, PolicyEngine engine, boolean inbound, Message m) { initialise(epi, engine, inbound, false, m); }
public void initialise(EndpointInfo ei, BindingOperationInfo boi, PolicyEngine engine, Assertor assertor, List<List<Assertion>> incoming, Message m) { initialisePolicy(ei, boi, engine, false, false, assertor, m); chooseAlternative(engine, assertor, incoming, m); initialiseInterceptors(engine, false, m); }
public void initialise(EndpointInfo ei, BindingOperationInfo boi, PolicyEngine engine, boolean requestor, boolean request, Message m) { Assertor assertor = initialisePolicy(ei, boi, engine, requestor, request, null, m); if (requestor || !request) { chooseAlternative(engine, assertor, m); initialiseInterceptors(engine, requestor, m); } else { //incoming server should not choose an alternative, need to include all the policies Collection<Assertion> alternative = ((PolicyEngineImpl)engine).getAssertions(this.policy, true); this.setChosenAlternative(alternative); } }
void initialiseInterceptors(PolicyEngine engine, boolean useIn, boolean fault, Message m) { if (((PolicyEngineImpl)engine).getBus() != null) { PolicyInterceptorProviderRegistry reg = ((PolicyEngineImpl)engine).getBus().getExtension(PolicyInterceptorProviderRegistry.class); Set<Interceptor<? extends org.apache.cxf.message.Message>> out = new LinkedHashSet<>(); for (Assertion a : getChosenAlternative()) { initialiseInterceptors(reg, engine, out, a, useIn, fault, m); } setInterceptors(new ArrayList<Interceptor<? extends org.apache.cxf.message.Message>>(out)); } }
if (p != null) { EndpointPolicyImpl endpi = new EndpointPolicyImpl(p); EffectivePolicyImpl effectivePolicy = new EffectivePolicyImpl(); effectivePolicy.initialise(endpi, pe, true, true, msg); PolicyUtils.logPolicy(LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy()); faultInterceptors.addAll(effectivePolicy.getInterceptors()); assertions.addAll(effectivePolicy.getChosenAlternative()); } else {
engine.setServerEndpointPolicy(ei, epi); EffectivePolicyImpl effectiveOutbound = new EffectivePolicyImpl(); effectiveOutbound.initialise(epi, engine, false, false, message); EffectivePolicyImpl effectiveInbound = new EffectivePolicyImpl(); effectiveInbound.initialise(epi, engine, true, false, message);
public void initialise(EndpointPolicy epi, PolicyEngine engine, boolean inbound, boolean fault, Message m) { policy = epi.getPolicy(); chosenAlternative = epi.getChosenAlternative(); if (chosenAlternative == null) { chooseAlternative(engine, null, m); } initialiseInterceptors(engine, inbound, fault, m); }
void chooseAlternative(PolicyEngine engine, Assertor assertor, List<List<Assertion>> incoming, Message m) { Collection<Assertion> alternative = engine.getAlternativeSelector() .selectAlternative(policy, engine, assertor, incoming, m); if (null == alternative) { PolicyUtils.logPolicy(LOG, Level.FINE, "No alternative supported.", getPolicy()); throw new PolicyException(new org.apache.cxf.common.i18n.Message("NO_ALTERNATIVE_EXC", BUNDLE)); } setChosenAlternative(alternative); }
void initialiseInterceptors(PolicyInterceptorProviderRegistry reg, PolicyEngine engine, Set<Interceptor<? extends org.apache.cxf.message.Message>> out, Assertion a, boolean useIn, boolean fault, Message m) { QName qn = a.getName(); List<Interceptor<? extends org.apache.cxf.message.Message>> i = null; if (useIn && !fault) { i = reg.getInInterceptorsForAssertion(qn); } else if (!useIn && !fault) { i = reg.getOutInterceptorsForAssertion(qn); } else if (useIn && fault) { i = reg.getInFaultInterceptorsForAssertion(qn); } else if (!useIn && fault) { i = reg.getOutFaultInterceptorsForAssertion(qn); } out.addAll(i); if (a instanceof PolicyContainingAssertion) { Policy p = ((PolicyContainingAssertion)a).getPolicy(); if (p != null) { for (Assertion a2 : getSupportedAlternatives(engine, p, m)) { initialiseInterceptors(reg, engine, out, a2, useIn, fault, m); } } } }
void initialiseInterceptors(PolicyEngine engine, boolean useIn, Message m) { initialiseInterceptors(engine, useIn, false, m); }
void chooseAlternative(PolicyEngine engine, Assertor assertor, Message m) { chooseAlternative(engine, assertor, null, m); } void chooseAlternative(PolicyEngine engine, Assertor assertor, List<List<Assertion>> incoming, Message m) {
Assertor initialisePolicy(EndpointInfo ei, BindingOperationInfo boi, PolicyEngine engine, boolean requestor, boolean request, Assertor assertor, Message m) { if (boi.isUnwrapped()) { boi = boi.getUnwrappedOperation(); } BindingMessageInfo bmi = request ? boi.getInput() : boi.getOutput(); EndpointPolicy ep; if (requestor) { ep = engine.getClientEndpointPolicy(ei, getAssertorAs(assertor, Conduit.class), m); } else { ep = engine.getServerEndpointPolicy(ei, getAssertorAs(assertor, Destination.class), m); } policy = ep.getPolicy(); if (ep instanceof EndpointPolicyImpl) { assertor = ((EndpointPolicyImpl)ep).getAssertor(); } policy = policy.merge(((PolicyEngineImpl)engine).getAggregatedOperationPolicy(boi, m)); if (null != bmi) { policy = policy.merge(((PolicyEngineImpl)engine).getAggregatedMessagePolicy(bmi, m)); } policy = policy.normalize(engine.getRegistry(), true); return assertor; }
public EffectivePolicy getEffectiveClientFaultPolicy(EndpointInfo ei, BindingOperationInfo boi, BindingFaultInfo bfi, Message m) { EffectivePolicy effectivePolicy = null; if (bfi != null) { effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_CLIENT); } if (effectivePolicy == null) { synchronized (ei) { if (bfi != null) { effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_CLIENT); } if (null == effectivePolicy) { EffectivePolicyImpl epi = createOutPolicyInfo(); epi.initialisePolicy(ei, boi, bfi, this, m); if (bfi != null) { bfi.setProperty(POLICY_INFO_FAULT_CLIENT, epi); } effectivePolicy = epi; } } } return effectivePolicy; }
if (p != null) { EndpointPolicyImpl endpi = new EndpointPolicyImpl(p); EffectivePolicyImpl effectivePolicy = new EffectivePolicyImpl(); effectivePolicy.initialise(endpi, pe, true, true, msg); PolicyUtils.logPolicy(LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy()); faultInterceptors.addAll(effectivePolicy.getInterceptors()); assertions.addAll(effectivePolicy.getChosenAlternative()); } else {
public void initialise(EndpointInfo ei, BindingOperationInfo boi, PolicyEngine engine, boolean requestor, boolean request, Message m) { Assertor assertor = initialisePolicy(ei, boi, engine, requestor, request, null, m); if (requestor || !request) { chooseAlternative(engine, assertor, m); initialiseInterceptors(engine, requestor, m); } else { //incoming server should not choose an alternative, need to include all the policies Collection<Assertion> alternative = ((PolicyEngineImpl)engine).getAssertions(this.policy, true); this.setChosenAlternative(alternative); } }
void initialiseInterceptors(PolicyEngine engine, boolean useIn, boolean fault, Message m) { if (((PolicyEngineImpl)engine).getBus() != null) { PolicyInterceptorProviderRegistry reg = ((PolicyEngineImpl)engine).getBus().getExtension(PolicyInterceptorProviderRegistry.class); Set<Interceptor<? extends org.apache.cxf.message.Message>> out = new LinkedHashSet<>(); for (Assertion a : getChosenAlternative()) { initialiseInterceptors(reg, engine, out, a, useIn, fault, m); } setInterceptors(new ArrayList<Interceptor<? extends org.apache.cxf.message.Message>>(out)); } }
public void initialise(EndpointPolicy epi, PolicyEngine engine, boolean inbound, boolean fault, Message m) { policy = epi.getPolicy(); chosenAlternative = epi.getChosenAlternative(); if (chosenAlternative == null) { chooseAlternative(engine, null, m); } initialiseInterceptors(engine, inbound, fault, m); }
void chooseAlternative(PolicyEngine engine, Assertor assertor, List<List<Assertion>> incoming, Message m) { Collection<Assertion> alternative = engine.getAlternativeSelector() .selectAlternative(policy, engine, assertor, incoming, m); if (null == alternative) { PolicyUtils.logPolicy(LOG, Level.FINE, "No alternative supported.", getPolicy()); throw new PolicyException(new org.apache.cxf.common.i18n.Message("NO_ALTERNATIVE_EXC", BUNDLE)); } setChosenAlternative(alternative); }
void initialiseInterceptors(PolicyInterceptorProviderRegistry reg, PolicyEngine engine, Set<Interceptor<? extends org.apache.cxf.message.Message>> out, Assertion a, boolean useIn, boolean fault, Message m) { QName qn = a.getName(); List<Interceptor<? extends org.apache.cxf.message.Message>> i = null; if (useIn && !fault) { i = reg.getInInterceptorsForAssertion(qn); } else if (!useIn && !fault) { i = reg.getOutInterceptorsForAssertion(qn); } else if (useIn && fault) { i = reg.getInFaultInterceptorsForAssertion(qn); } else if (!useIn && fault) { i = reg.getOutFaultInterceptorsForAssertion(qn); } out.addAll(i); if (a instanceof PolicyContainingAssertion) { Policy p = ((PolicyContainingAssertion)a).getPolicy(); if (p != null) { for (Assertion a2 : getSupportedAlternatives(engine, p, m)) { initialiseInterceptors(reg, engine, out, a2, useIn, fault, m); } } } }