FileDocCategorySizeDatePackage
BuilderHandler.javaAPI DocExample5036Tue May 29 16:56:36 BST 2007com.sun.xml.ws.policy.jaxws

BuilderHandler

public abstract class BuilderHandler extends Object
author
Jakub Podlesak (jakub.podlesak at sun.com)

Fields Summary
private static final com.sun.xml.ws.policy.privateutil.PolicyLogger
LOGGER
Map
policyStore
Collection
policyURIs
Object
policySubject
Constructors Summary
BuilderHandler(Collection policyURIs, Map policyStore, Object policySubject)
Creates a new instance of BuilderHandler

    
               
          
        this.policyStore = policyStore;
        this.policyURIs = policyURIs;
        this.policySubject = policySubject;
    
Methods Summary
protected abstract voiddoPopulate(com.sun.xml.ws.policy.PolicyMapExtender policyMapExtender)

final java.util.CollectiongetPolicies()

        if (null == policyURIs) {
            throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_1013_POLICY_URIS_CAN_NOT_BE_NULL()));
        }
        if (null == policyStore) {
            throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_1021_NO_POLICIES_DEFINED()));
        }
        
        final Collection<Policy> result = new ArrayList<Policy>(policyURIs.size());
        
        for (String policyURI : policyURIs) {
            final PolicySourceModel sourceModel = policyStore.get(policyURI);
            if (sourceModel == null) {
                throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_1014_POLICY_REFERENCE_DOES_NOT_EXIST(policyURI)));
            } else {
                result.add(PolicyModelTranslator.getTranslator().translate(sourceModel));
            }
        }
        
        return result;
    
final java.util.CollectiongetPolicySubjects()

        final Collection<Policy> policies = getPolicies();
        final Collection<PolicySubject> result =  new ArrayList<PolicySubject>(policies.size());
        for (Policy policy : policies) {
            result.add(new PolicySubject(policySubject, policy));
        }
        return result;
    
final voidpopulate(com.sun.xml.ws.policy.PolicyMapExtender policyMapExtender)

        if (null == policyMapExtender) {
            throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_1015_POLICY_MAP_EXTENDER_CAN_NOT_BE_NULL()));
        }
        
        doPopulate(policyMapExtender);