final Collection<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
if (endpointKey == null || policyMap == null) {
return features;
}
TransactionalFeature endpointFeature = getAtFeature(policyMap.getEndpointEffectivePolicy(endpointKey), false);
if (endpointFeature != null) {
features.add(endpointFeature);
}
for (PolicyMapKey key : policyMap.getAllOperationScopeKeys()) {
if (!endpointKey.equals(key)) {
continue;
}
final TransactionalFeature feature = getAtFeature(policyMap.getOperationEffectivePolicy(key), true);
if (feature == null || !feature.isEnabled()) {
continue;
}
if (endpointFeature == null) {
endpointFeature = feature;
features.add(endpointFeature);
} else if (endpointFeature.getVersion() != feature.getVersion()) {
throw LOGGER.logSevereException(new WebServiceException(LocalizationMessages.WSAT_1004_ENDPOINT_AND_OPERATION_POLICIES_DONT_MATCH(endpointKey, key)));
}
endpointFeature.setExplicitMode(true);
String opName = key.getOperation().getLocalPart();
feature.setFlowType(opName, feature.getFlowType());
feature.setEnabled(opName, true);
}
return features;
}