Policy getAggregatedFaultPolicy(BindingFaultInfo bfi, Message m) { Policy aggregated = null; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(bfi, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedEndpointPolicy(EndpointInfo ei, Message m) { Policy aggregated = null; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(ei, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedOperationPolicy(BindingOperationInfo boi, Message m) { Policy aggregated = null; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(boi, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedMessagePolicy(BindingMessageInfo bmi, Message m) { Policy aggregated = null; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(bmi, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedFaultPolicy(BindingFaultInfo bfi, Message m) { Policy aggregated = null; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(bfi, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedEndpointPolicy(EndpointInfo ei, Message m) { Policy aggregated = null; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(ei, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedOperationPolicy(BindingOperationInfo boi, Message m) { Policy aggregated = null; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(boi, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedMessagePolicy(BindingMessageInfo bmi, Message m) { Policy aggregated = null; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(bmi, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedServicePolicy(ServiceInfo si, Message m) { if (si == null) { return new Policy(); } Policy aggregated = busPolicy; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(si, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
Policy getAggregatedServicePolicy(ServiceInfo si, Message m) { if (si == null) { return new Policy(); } Policy aggregated = busPolicy; for (PolicyProvider pp : getPolicyProviders()) { Policy p = pp.getEffectivePolicy(si, m); if (null == aggregated) { aggregated = p; } else if (p != null) { aggregated = aggregated.merge(p); } } return aggregated == null ? new Policy() : aggregated; }
@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()); } } }
@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()); } } }