Package org.apache.ws.policy

Examples of org.apache.ws.policy.Policy


        
         return getEffectivePolicy(policyList);
    }

  private Policy getEffectivePolicy(List policyList) {
    Policy policy = null;
    Object policyElement;
    ;

    for (Iterator iterator = policyList.iterator(); iterator.hasNext();) {
      policyElement = iterator.next();
      if (policyElement instanceof Policy) {
        policy = (policy == null) ? (Policy) policyElement
            : (Policy) policy.merge((Policy) policyElement,
                registry);

      } else if (policyElement instanceof PolicyReference) {
        policy = (policy == null) ? (Policy) ((PolicyReference) policyElement)
            .normalize(registry)
            : (Policy) policy.merge(
                (PolicyReference) policyElement, registry);

      }
    }

    if (!policy.isNormalized()) {
      policy = (Policy) policy.normalize(registry);
    }

    return policy;

  }
View Full Code Here


      if (extElement instanceof UnknownExtensibilityElement) {
        unknown = (UnknownExtensibilityElement) extElement;

        if (POLICY.equals(unknown.getElementType())) {
          Policy p = prdr.readPolicy(unknown.getElement());

          if (p.getPolicyURI() != null) {
            registry.register(p.getPolicyURI(), p);
          }
        }
      }
    }
  }
View Full Code Here

      if (extElement instanceof UnknownExtensibilityElement) {
        unknown = (UnknownExtensibilityElement) extElement;

        if (POLICY.equals(unknown.getElementType())) {

          Policy p = prdr.readPolicy(unknown.getElement());
          policyList.add(p);

        } else if (POLICY_REF.equals(unknown.getElementType())) {
          PolicyReference ref = prdr.readPolicyReference(unknown
              .getElement());
View Full Code Here

    QName PolicyURIs = (QName) extAttributes.get(new QName(
        PolicyConstants.WS_POLICY_NAMESPACE_URI, "PolicyURIs"));

    if (PolicyURIs != null) {
      String[] URIs = PolicyURIs.getLocalPart().split(" ");
      Policy policy;

      for (int i = 0; i < URIs.length; i++) {
        policy = registry.lookup(URIs[i]);

        if (policy == null) {
View Full Code Here

    return null;
  }

  private void calculatePolicy() {

    Policy result = null;
    Iterator iterator = wrapperElements.values().iterator();

    while (iterator.hasNext()) {
      Object policyElement = ((Wrapper) iterator.next()).getValue();
      Policy p;

      if (policyElement instanceof PolicyReference) {
        p = (Policy) ((PolicyReference) policyElement)
            .normalize(getPolicyRegistry());

      } else if (policyElement instanceof Policy) {
        p = (Policy) policyElement;

      } else {
        // TODO AxisFault?
        throw new RuntimeException();
      }

      result = (result == null) ? (Policy) p.normalize(reg)
          : (Policy) result.merge(p, reg);
    }
    this.policy = result;
    useCacheP(true);
  }
View Full Code Here

    this.policy = result;
    useCacheP(true);
  }

  private void calculateEffectivePolicy() {
    Policy result ;
   
    if (getParent() != null) {
      Policy parentPolicy = getParent().getEffectivePolicy();
     
      if (parentPolicy == null) {
        result = getPolicy();
       
      } else {
       
        if (getPolicy() != null) {
          result = (Policy) parentPolicy.merge(getPolicy(), reg);
         
        } else {
          result = parentPolicy;
        }
      }
View Full Code Here

      } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      Policy newPolicy = prdr.readPolicy(fis);
      newPolicy = (Policy) newPolicy.normalize();

      if (merged == null) {
        merged = newPolicy;
      } else {
        merged = (Policy) merged.merge(newPolicy);
View Full Code Here

            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            Policy newPolicy = prdr.readPolicy(fis);
            newPolicy = (Policy) newPolicy.normalize();

            if (merged == null) {
                merged = newPolicy;
            } else {
                merged = (Policy) merged.merge(newPolicy);
View Full Code Here

            // It should work in all containers, server/client side
            UnifiedVirtualFile vfPolicyFile = vfRoot.findChild(policyFileLocation);
            is = vfPolicyFile.toURL().openStream();
           
            DOMPolicyReader reader = (DOMPolicyReader)PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
            Policy unnormalizedPolicy = reader.readPolicy(is);
            Policy normPolicy = (Policy)unnormalizedPolicy.normalize();
            log.info("Deploying Annotated Policy = " + policyFileLocation);
            PolicyScopeLevel scope = anPolicy.scope();
            if (PolicyScopeLevel.WSDL_PORT.equals(scope) || PolicyScopeLevel.WSDL_PORT_TYPE.equals(scope) || PolicyScopeLevel.WSDL_BINDING.equals(scope))
            {
               deployPolicy(normPolicy, scope, epMetaData);
View Full Code Here

      //Collect all policies defined in our wsdl definitions
      DOMPolicyReader reader = (DOMPolicyReader)PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
      PolicyRegistry localPolicyRegistry = new PolicyRegistry();
      for (WSDLExtensibilityElement policyElement : wsdlDefinitions.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY))
      {
         Policy policy = reader.readPolicy(policyElement.getElement());
         localPolicyRegistry.register(policy.getPolicyURI(), policy);
      }
      //Port scope
      WSDLService wsdlService = wsdlDefinitions.getService(epMetaData.getServiceMetaData().getServiceName());
      if (wsdlService != null)
      {
View Full Code Here

TOP

Related Classes of org.apache.ws.policy.Policy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.