Package org.apache.ws.policy

Examples of org.apache.ws.policy.Policy


      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 a Policy object which has the same policyURI
   * @throws IllegalArgumentException
   */
  public Policy lookup(String policyURI) throws IllegalArgumentException {

    Policy policy = (Policy) reg.get(policyURI);

    if (policy == null && parent != null) {
      policy = parent.lookup(policyURI);
    }

View Full Code Here

    public OMElement normalize() {
        Iterator iterator = getArgs().iterator();
        OMElement element = (OMElement) iterator.next();

        Policy argOne = getReader().readPolicy(getInputStream(element));
        Policy normalized = (Policy) argOne.normalize();
        return getOMElement(normalized);
    }
View Full Code Here

        System.out.println("inside merge");

        OMElement element = (OMElement) iterator.next();
        OMElement element2 = (OMElement) iterator.next();

        Policy argOne = getReader().readPolicy(getInputStream(element));
        Policy argTwo = getReader().readPolicy(getInputStream(element2));

        Policy merged = (Policy) argOne.merge(argTwo);
        return getOMElement(merged);

    }
View Full Code Here

    public OMElement intersect() {
        Iterator iterator = getArgs().iterator();
        OMElement element = (OMElement) iterator.next();
        OMElement element2 = (OMElement) iterator.next();

        Policy argOne = getReader().readPolicy(getInputStream(element));
        Policy argTwo = getReader().readPolicy(getInputStream(element2));

        Policy intersected = (Policy) argOne.intersect(argTwo);
        return getOMElement(intersected);
    }
View Full Code Here

                } else if (WSDLConstants.POLICY
                        .equals(unknown.getElementType())) {

                    DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory
                            .getPolicyReader(PolicyFactory.DOM_POLICY_READER);
                    Policy policy = policyReader.readPolicy(unknown
                            .getElement());

                    addPolicy(description, originOfExtensibilityElements,
                            policy);
View Full Code Here

                UnknownExtensibilityElement unknown = (UnknownExtensibilityElement) extElement;
                if (WSDLConstants.POLICY.equals(unknown.getElementType())) {

                    DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory
                            .getPolicyReader(PolicyFactory.DOM_POLICY_READER);
                    Policy policy = policyReader.readPolicy(unknown
                            .getElement());

                    registry.register(policy.getPolicyURI(), policy);

                }
            }
        }
    }
View Full Code Here

 
  public void configureOperationPolices(AxisOperation op) throws AxisFault {
        PolicyInclude policyInclude = op.getPolicyInclude();

        if (policyInclude != null) {
            Policy policy = policyInclude.getEffectivePolicy();
            if (policy != null) {
                if (!policy.isNormalized()) {
                    policy = (Policy) policy.normalize();
                }

                XorCompositeAssertion XOR = (XorCompositeAssertion) policy
                        .getTerms().get(0);
                AndCompositeAssertion AND = (AndCompositeAssertion) XOR
                        .getTerms().get(0);

                Iterator pAsserations = AND.getTerms().iterator();
View Full Code Here

                                         PolicyInclude policyInclude) {
        OMPolicyReader reader = (OMPolicyReader) PolicyFactory
                .getPolicyReader(PolicyFactory.OM_POLICY_READER);

        while (policyElements.hasNext()) {
            Policy p = reader.readPolicy((OMElement) policyElements.next());
            policyInclude.addPolicyElement(type, p);
        }
    }
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.