Throw an exception if the policy map contains any policy with at least two
policy alternatives.
Optional assertions are not considered (unless they have been normalized into
two policy alternatives).
for (Policy policy : map) {
if (policy.getNumberOfAssertionSets() > 1) {
throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0035_RECONFIGURE_ALTERNATIVES(policy.getIdOrName())));
}
}
// Collection<PolicyMapKey> keys = map.getAllServiceScopeKeys();
// for (PolicyMapKey key : keys) {
// final Policy policy = map.getServiceEffectivePolicy(key);
// if (policy.getNumberOfAssertionSets() > 1) {
// throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0035_RECONFIGURE_ALTERNATIVES(policy.getIdOrName())));
// }
// }
// keys = map.getAllEndpointScopeKeys();
// for (PolicyMapKey key : keys) {
// final Policy policy = map.getEndpointEffectivePolicy(key);
// if (policy.getNumberOfAssertionSets() > 1) {
// throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0035_RECONFIGURE_ALTERNATIVES(policy.getIdOrName())));
// }
// }
// keys = map.getAllOperationScopeKeys();
// for (PolicyMapKey key : keys) {
// final Policy policy = map.getOperationEffectivePolicy(key);
// if (policy.getNumberOfAssertionSets() > 1) {
// throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0035_RECONFIGURE_ALTERNATIVES(policy.getIdOrName())));
// }
// }
// keys = map.getAllInputMessageScopeKeys();
// for (PolicyMapKey key : keys) {
// final Policy policy = map.getInputMessageEffectivePolicy(key);
// if (policy.getNumberOfAssertionSets() > 1) {
// throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0035_RECONFIGURE_ALTERNATIVES(policy.getIdOrName())));
// }
// }
// keys = map.getAllOutputMessageScopeKeys();
// for (PolicyMapKey key : keys) {
// final Policy policy = map.getOutputMessageEffectivePolicy(key);
// if (policy.getNumberOfAssertionSets() > 1) {
// throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0035_RECONFIGURE_ALTERNATIVES(policy.getIdOrName())));
// }
// }
// keys = map.getAllFaultMessageScopeKeys();
// for (PolicyMapKey key : keys) {
// final Policy policy = map.getFaultMessageEffectivePolicy(key);
// if (policy.getNumberOfAssertionSets() > 1) {
// throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0035_RECONFIGURE_ALTERNATIVES(policy.getIdOrName())));
// }
// }