Package org.apache.ws.policy

Examples of org.apache.ws.policy.Policy


                OMAttribute attribute = factory.createOMAttribute("URI", null, policyURIString);
                refElement.addAttribute(attribute);
                element.addChild(refElement);
               
                PolicyRegistry reg = policyInclude.getPolicyRegistry();
                Policy p = reg.lookup(policyURIString);
               
                if(p == null) {
                    throw new Exception("Policy not found for uri : " + policyURIString);
                }
               
View Full Code Here


public class PolicyUtil {
   
  public static void writePolicy(PolicyInclude policy, OutputStream out) {
    if (policy != null) {
      Policy pl = policy.getEffectivePolicy();
      if (pl != null) {
        PolicyWriter write = PolicyFactory
            .getPolicyWriter(PolicyFactory.StAX_POLICY_WRITER);
        write.writePolicy(pl, out);
        try {
View Full Code Here

            throw new RuntimeException("unknown element ..");
        }
    }

    public Policy readPolicy(Element element) {
        Policy policy = new Policy();
        Attr attri;
        attri = element.getAttributeNodeNS(PolicyConstants.WSU_NAMESPACE_URI,
                "Id");
        if (attri != null) {
            policy.setId(attri.getValue());
        }

        attri = element.getAttributeNodeNS(PolicyConstants.XML_NAMESPACE_URI,
                "base");
        if (attri != null) {
            policy.setBase(attri.getValue());
        }

        policy.addTerms(readTerms(element));
        return policy;
    }
View Full Code Here

                Element childElement = (Element) node;
                if (childElement.getNamespaceURI().equals(
                        PolicyConstants.WS_POLICY_NAMESPACE_URI)
                        && childElement.getLocalName().equals(
                                PolicyConstants.WS_POLICY)) {
                    Policy policy = readPolicy(childElement);
                    result.addTerm(policy);

                } else {
                    PrimitiveAssertion pa = readPrimitiveAssertion(childElement);
                    result.addTerm(pa);
View Full Code Here

    return andTerm.getTerms();
  }

  public static Policy getSinglePolicy(List policyList, PolicyRegistry reg) {
    Policy policyTerm = null;
    Iterator iterator = policyList.iterator();

    Policy policyTerm2;
    while (iterator.hasNext()) {
      policyTerm2 = (Policy) iterator.next();
      policyTerm = (policyTerm == null) ? policyTerm2
          : (Policy) policyTerm.merge(policyTerm2, reg);
    }
View Full Code Here

    }
    return policyTerm;
  }

  public static Policy getPolicy(List terms) {
    Policy policyTerm = new Policy();
    XorCompositeAssertion xorTerm = new XorCompositeAssertion();
    AndCompositeAssertion andTerm = new AndCompositeAssertion();

    andTerm.addTerms(terms);
    xorTerm.addTerm(andTerm);
    policyTerm.addTerm(xorTerm);

    return policyTerm;
  }
View Full Code Here

      throw new RuntimeException("unknown element ..");
    }
  }

  public Policy readPolicy(OMElement element) {
    Policy policy = new Policy();

    OMAttribute attri;
    attri = element.getAttribute(new QName(
        PolicyConstants.WSU_NAMESPACE_URI, "Id"));
    if (attri != null) {
      policy.setId(attri.getAttributeValue());
    }
    attri = element.getAttribute(new QName(
        PolicyConstants.XML_NAMESPACE_URI, "base"));
    if (attri != null) {
      policy.setBase(attri.getAttributeValue());
    }

    policy.addTerms(readTerms(element));
    return policy;
  }
View Full Code Here

      if (childElement.getNamespace().getName().equals(
          PolicyConstants.WS_POLICY_NAMESPACE_URI)
          && childElement.getLocalName().equals(
              PolicyConstants.WS_POLICY)) {
        Policy policy = readPolicy(childElement);
        result.addTerm(policy);

      } else {
        PrimitiveAssertion pa = readPrimitiveAssertion(childElement);
        result.addTerm(pa);
View Full Code Here

    Element rootElement = document.createElement("stubMethods");
       
        AxisOperation axisOperation;
        QName opName;
        PolicyInclude policyInclude;
        Policy policy;
        Iterator a = axisService.getOperations();
       
        for (Iterator iterator = axisService.getOperations(); iterator.hasNext(); ) {
            axisOperation = (AxisOperation) iterator.next();
            opName = axisOperation.getName();
View Full Code Here

        System.err.println("cannot find a PolicyExtension to process "
            + namespace + "type assertions");
        continue;
      }

      Policy nPolicy = new Policy();
      XorCompositeAssertion nXOR = new XorCompositeAssertion();
      nPolicy.addTerm(nXOR);

      AndCompositeAssertion nAND = (AndCompositeAssertion) map
          .get(namespace);
      nXOR.addTerm(nAND);
           
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.