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); }
LOG.fine("ep: " + ep); if (ep != null) { faultInterceptors.addAll(ep.getFaultInterceptors(msg)); assertions.addAll(ep.getFaultVocabulary(msg));
EndpointPolicy ep = pe.getClientEndpointPolicy(ei, conduit, msg); if (ep != null) { interceptors.addAll(ep.getInterceptors(msg)); assertions.addAll(ep.getVocabulary(msg)); interceptors.addAll(ep.getInterceptors(msg)); assertions.addAll(ep.getVocabulary(msg));
void initialisePolicy(EndpointInfo ei, BindingOperationInfo boi, BindingFaultInfo bfi, PolicyEngine engine, Message m) { policy = engine.getServerEndpointPolicy(ei, (Destination)null, m).getPolicy(); policy = policy.merge(((PolicyEngineImpl)engine).getAggregatedOperationPolicy(boi, m)); if (bfi != null) { policy = policy.merge(((PolicyEngineImpl)engine).getAggregatedFaultPolicy(bfi, m)); } policy = policy.normalize(engine.getRegistry(), true); }
public <T> T getClientEndpointPolicy(Message m, EndpointInfo ei, Conduit c, PolicyCalculator<T> policyCalculator) { Collection<Assertion> alternative = getPolicyEngine().getClientEndpointPolicy(ei, c, m) .getChosenAlternative(); List<T> filteredPolicies = new ArrayList<>(); for (Assertion a : alternative) { if (policyCalculator.getDataClassName().equals(a.getName())) { T p = JaxbAssertion.cast(a, policyCalculator.getDataClass()).getData(); filteredPolicies.add(p); } } return getPolicy(filteredPolicies, policyCalculator); }
@Override public void initialize(Client client, Bus bus) { Endpoint endpoint = client.getEndpoint(); Policy p = initializeEndpointPolicy(endpoint, bus); PolicyEngine pe = bus.getExtension(PolicyEngine.class); EndpointInfo ei = endpoint.getEndpointInfo(); EndpointPolicy ep = pe.getClientEndpointPolicy(ei, null, null); pe.setClientEndpointPolicy(ei, ep.updatePolicy(p, createMessage(endpoint, bus))); }
EndpointPolicy ep = pe.getClientEndpointPolicy(ei, conduit, msg); if (ep != null) { interceptors.addAll(ep.getInterceptors(msg)); assertions.addAll(ep.getVocabulary(msg)); interceptors.addAll(ep.getInterceptors(msg)); assertions.addAll(ep.getVocabulary(msg));
void initialisePolicy(EndpointInfo ei, BindingOperationInfo boi, BindingFaultInfo bfi, PolicyEngine engine, Message m) { policy = engine.getServerEndpointPolicy(ei, (Destination)null, m).getPolicy(); policy = policy.merge(((PolicyEngineImpl)engine).getAggregatedOperationPolicy(boi, m)); if (bfi != null) { policy = policy.merge(((PolicyEngineImpl)engine).getAggregatedFaultPolicy(bfi, m)); } policy = policy.normalize(engine.getRegistry(), true); }
public <T> T getServerEndpointPolicy(Message m, EndpointInfo ei, Destination d, PolicyCalculator<T> policyCalculator) { Collection<Assertion> alternative = getPolicyEngine() .getServerEndpointPolicy(ei, d, m).getChosenAlternative(); List<T> filteredPolicies = new ArrayList<>(); for (Assertion a : alternative) { if (policyCalculator.getDataClassName().equals(a.getName())) { T p = JaxbAssertion.cast(a, policyCalculator.getDataClass()).getData(); filteredPolicies.add(p); } } return getPolicy(filteredPolicies, policyCalculator); }
@Override public void initialize(Client client, Bus bus) { Endpoint endpoint = client.getEndpoint(); Policy p = initializeEndpointPolicy(endpoint, bus); PolicyEngine pe = bus.getExtension(PolicyEngine.class); EndpointInfo ei = endpoint.getEndpointInfo(); EndpointPolicy ep = pe.getClientEndpointPolicy(ei, null, null); pe.setClientEndpointPolicy(ei, ep.updatePolicy(p, createMessage(endpoint, bus))); }
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); }
List<Interceptor<? extends Message>> interceptors = ep.getInterceptors(message); message.getInterceptorChain().add(interceptors); Collection<Assertion> assertions = ep.getVocabulary(message); if (null != assertions) { message.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
protected List<PolicyAssertion> getAssertions(PolicyEngine pe, org.apache.cxf.endpoint.Server s) { Policy p1 = pe.getServerEndpointPolicy( s.getEndpoint().getEndpointInfo(), null, null).getPolicy(); List<ExactlyOne> pops = CastUtils.cast(p1.getPolicyComponents(), ExactlyOne.class); assertEquals("New policy must have 1 top level policy operator", 1, pops.size()); List<All> alts = CastUtils.cast(pops.get(0).getPolicyComponents(), All.class); assertEquals("1 alternatives should be available", 1, alts.size()); return CastUtils.cast(alts.get(0).getAssertions(), PolicyAssertion.class); } }
public <T> T getServerEndpointPolicy(Message m, EndpointInfo ei, Destination d, PolicyCalculator<T> policyCalculator) { Collection<Assertion> alternative = getPolicyEngine() .getServerEndpointPolicy(ei, d, m).getChosenAlternative(); List<T> filteredPolicies = new ArrayList<>(); for (Assertion a : alternative) { if (policyCalculator.getDataClassName().equals(a.getName())) { T p = JaxbAssertion.cast(a, policyCalculator.getDataClass()).getData(); filteredPolicies.add(p); } } return getPolicy(filteredPolicies, policyCalculator); }
LOG.fine("ep: " + ep); if (ep != null) { faultInterceptors.addAll(ep.getFaultInterceptors(msg)); assertions.addAll(ep.getFaultVocabulary(msg));
@Override public void initialize(Server server, Bus bus) { Endpoint endpoint = server.getEndpoint(); Policy p = initializeEndpointPolicy(endpoint, bus); PolicyEngine pe = bus.getExtension(PolicyEngine.class); EndpointInfo ei = endpoint.getEndpointInfo(); EndpointPolicy ep = pe.getServerEndpointPolicy(ei, null, null); pe.setServerEndpointPolicy(ei, ep.updatePolicy(p, createMessage(endpoint, bus))); // Add policy to the service model (and consequently to the WSDL) // FIXME - ideally this should probably be moved up to where the policies are applied to the // endpoint, rather than this late. As a consequence of its location, you have to declare a // ws policy feature on every endpoint in order to get any policy attachments into the // wsdl. Alternatively add to the WSDLServiceBuilder somehow. ServiceModelPolicyUpdater pu = new ServiceModelPolicyUpdater(ei); for (PolicyProvider pp : ((PolicyEngineImpl) pe).getPolicyProviders()) { if (pp instanceof ExternalAttachmentProvider) { pu.addPolicyAttachments(((ExternalAttachmentProvider) pp).getAttachments()); } } }
Collection<Assertion> assertions = ep.getChosenAlternative(); for (Assertion a : assertions) { if (a instanceof TransportBinding) { Policy policy = ep.getPolicy(); List<PolicyComponent> pcList = policy.getPolicyComponents(); for (PolicyComponent a : pcList) {
List<Interceptor<? extends Message>> interceptors = ep.getInterceptors(message); message.getInterceptorChain().add(interceptors); Collection<Assertion> assertions = ep.getVocabulary(message); if (null != assertions) { message.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
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 <T> T getClientEndpointPolicy(Message m, EndpointInfo ei, Conduit c, PolicyCalculator<T> policyCalculator) { Collection<Assertion> alternative = getPolicyEngine().getClientEndpointPolicy(ei, c, m) .getChosenAlternative(); List<T> filteredPolicies = new ArrayList<>(); for (Assertion a : alternative) { if (policyCalculator.getDataClassName().equals(a.getName())) { T p = JaxbAssertion.cast(a, policyCalculator.getDataClass()).getData(); filteredPolicies.add(p); } } return getPolicy(filteredPolicies, policyCalculator); }