FileDocCategorySizeDatePackage
PolicyMapUtil.javaAPI DocExample5780Tue May 29 16:56:40 BST 2007com.sun.xml.ws.policy.util

PolicyMapUtil

public final class PolicyMapUtil extends Object
Utility methods for PolicyMap

Fields Summary
private static final com.sun.xml.ws.policy.privateutil.PolicyLogger
LOGGER
Constructors Summary
Methods Summary
public static voidrejectAlternatives(com.sun.xml.ws.policy.PolicyMap map)
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).

param
map policy map to be processed
throws
PolicyException Thrown if the policy map contains at least one policy with more than one policy alternative

    
                                                                
            
        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())));
//            }
//        }