aim.checkEffectivePolicy(policy.getPolicy()); } catch (PolicyException e) { LOG.fine("An exception was thrown when verifying that the effective policy for "
Collection<Assertion> getAssertions(EffectivePolicy pc, boolean includeOptional) { if (pc == null || pc.getChosenAlternative() == null) { return null; } Collection<Assertion> assertions = new ArrayList<>(); for (Assertion assertion : pc.getChosenAlternative()) { if (Constants.TYPE_ASSERTION == assertion.getType()) { if (includeOptional || !assertion.isOptional()) { assertions.add(assertion); } } else { addAssertions(assertion, includeOptional, assertions); } } return assertions; }
if (effectivePolicy != null) { PolicyUtils.logPolicy( LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy() ); addInterceptors(effectivePolicy.getInterceptors(), msg); assertions.addAll(effectivePolicy.getChosenAlternative()); if (effectivePolicy != null) { PolicyUtils.logPolicy( LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy() ); addInterceptors(effectivePolicy.getInterceptors(), msg); assertions.addAll(effectivePolicy.getChosenAlternative());
interceptors.addAll(ep.getInterceptors()); if (ep.getPolicy() != null) { msg.put(AssertionInfoMap.class, new AssertionInfoMap(ep.getPolicy())); msg.getInterceptorChain().add(PolicyVerificationInInterceptor.INSTANCE);
faultInterceptors.addAll(effectivePolicy.getInterceptors()); assertions.addAll(effectivePolicy.getChosenAlternative());
if (effectivePolicy != null) { PolicyUtils.logPolicy( LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy() ); addInterceptors(effectivePolicy.getInterceptors(), msg); assertions.addAll(effectivePolicy.getChosenAlternative()); if (effectivePolicy != null) { PolicyUtils.logPolicy( LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy() ); addInterceptors(effectivePolicy.getInterceptors(), msg); assertions.addAll(effectivePolicy.getChosenAlternative());
interceptors.addAll(ep.getInterceptors()); if (ep.getPolicy() != null) { msg.put(AssertionInfoMap.class, new AssertionInfoMap(ep.getPolicy())); msg.getInterceptorChain().add(PolicyVerificationInInterceptor.INSTANCE);
faultInterceptors.addAll(effectivePolicy.getInterceptors()); assertions.addAll(effectivePolicy.getChosenAlternative());
aim.checkEffectivePolicy(policy.getPolicy()); } catch (PolicyException e) { LOG.fine("An exception was thrown when verifying that the effective policy for "
Collection<Assertion> getAssertions(EffectivePolicy pc, boolean includeOptional) { if (pc == null || pc.getChosenAlternative() == null) { return null; } Collection<Assertion> assertions = new ArrayList<>(); for (Assertion assertion : pc.getChosenAlternative()) { if (Constants.TYPE_ASSERTION == assertion.getType()) { if (includeOptional || !assertion.isOptional()) { assertions.add(assertion); } } else { addAssertions(assertion, includeOptional, assertions); } } return assertions; }
public void handleMessage(Message message) throws Fault { EndpointInfo ei = message.getExchange().getEndpoint().getEndpointInfo(); BindingOperationInfo boi = message.getExchange().getBindingOperationInfo(); LOG.fine("Getting effective server request policy for endpoint " + ei + " and binding operation " + boi); EffectivePolicy ep = bus.getExtension(PolicyEngine.class).getEffectiveServerRequestPolicy(ei, boi, message); for (Iterator<List<Assertion>> it = ep.getPolicy().getAlternatives(); it.hasNext();) { Collection<Assertion> as = it.next(); LOG.fine("Checking alternative with " + as.size() + " assertions."); for (Assertion a : as) { LOG.fine("Assertion: " + a.getClass().getName()); HTTPServerPolicy p = (JaxbAssertion.cast(a, HTTPServerPolicy.class)).getData(); LOG.fine("server policy: " + ServerPolicyCalculator.toString(p)); } } }
boi, conduit, PhaseInterceptorChain.getCurrentMessage()); setPolicyInternal(effectivePolicy.getPolicy()); return boi;
aim.checkEffectivePolicy(effectivePolicy.getPolicy()); LOG.fine("Verified policies for inbound message.");
List<List<Assertion>> usedAlternatives = aim.checkEffectivePolicy(effectivePolicy.getPolicy()); if (usedAlternatives != null && !usedAlternatives.isEmpty() && message.getExchange() != null) { message.getExchange().put("ws-policy.validated.alternatives", usedAlternatives);
boi, conduit, PhaseInterceptorChain.getCurrentMessage()); setPolicyInternal(effectivePolicy.getPolicy()); return boi;
aim.checkEffectivePolicy(effectivePolicy.getPolicy()); LOG.fine("Verified policies for inbound message.");
List<List<Assertion>> usedAlternatives = aim.checkEffectivePolicy(effectivePolicy.getPolicy()); if (usedAlternatives != null && !usedAlternatives.isEmpty() && message.getExchange() != null) { message.getExchange().put("ws-policy.validated.alternatives", usedAlternatives);
operationPolicy.setPolicy(policy.getPolicy()); operationPolicy.setOperationAction(soapOperationInfo.getAction()); operationPolicy.setSoapMessageVersionNamespace(soapNS);