Package org.apache.ws.policy

Examples of org.apache.ws.policy.XorCompositeAssertion


    if (!policy.isNormalized()) {
      throw new RuntimeException("Policy is not in normalized format");
    }

    XorCompositeAssertion xor = (XorCompositeAssertion) policy.getTerms()
        .get(0);
    List listOfPolicyAlternatives = xor.getTerms();

    boolean success = false;
    int numberOfAlternatives = listOfPolicyAlternatives.size();

    for (int i = 0; !success && i < numberOfAlternatives; i++) {
View Full Code Here


    andCompositeAssertion.addTerms(readTerms(element));
    return andCompositeAssertion;
  }

  private XorCompositeAssertion readXorComposite(Element element) {
    XorCompositeAssertion xorCompositeAssertion = new XorCompositeAssertion();
    xorCompositeAssertion.addTerms(readTerms(element));
    return xorCompositeAssertion;
  }
View Full Code Here

            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();
                while (pAsserations.hasNext()) {
                    PrimitiveAssertion pa = (PrimitiveAssertion) pAsserations
View Full Code Here

        andCompositeAssertion.addTerms(readTerms(element));
        return andCompositeAssertion;
    }

    private XorCompositeAssertion readXorComposite(Element element) {
        XorCompositeAssertion xorCompositeAssertion = new XorCompositeAssertion();
        xorCompositeAssertion.addTerms(readTerms(element));
        return xorCompositeAssertion;
    }
View Full Code Here

  public static List getPrimTermsList(Policy policy) {
    if (!policy.isNormalized()) {
      policy = (Policy) policy.normalize();
    }

    XorCompositeAssertion xorTerm = (XorCompositeAssertion) policy
        .getTerms().get(0);
    AndCompositeAssertion andTerm = (AndCompositeAssertion) xorTerm
        .getTerms().get(0);

    return andTerm.getTerms();
  }
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

    andCompositeAssertion.addTerms(readTerms(element));
    return andCompositeAssertion;
  }

  private XorCompositeAssertion readXorComposite(OMElement element) {
    XorCompositeAssertion xorCompositeAssertion = new XorCompositeAssertion();
    xorCompositeAssertion.addTerms(readTerms(element));
    return xorCompositeAssertion;
  }
View Full Code Here

      policy = (Policy) policy.normalize();
    }

    HashMap map = new HashMap();

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

    for (Iterator iterator = AND.getTerms().iterator(); iterator.hasNext();) {

      AndCompositeAssertion nAND = new AndCompositeAssertion();
      PrimitiveAssertion pa = (PrimitiveAssertion) iterator.next();

      String namespace = pa.getName().getNamespaceURI();
      nAND.addTerm(pa);

      while (iterator.hasNext()) {
        pa = (PrimitiveAssertion) iterator.next();

        if (namespace.equals(pa.getName().getNamespaceURI())) {
          nAND.addTerm(pa);
        }
      }

      map.put(namespace, nAND);
      AND.getTerms().removeAll(nAND.getTerms());

      iterator = AND.getTerms().iterator();
    }

    for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
      String namespace = (String) iterator.next();
            PolicyExtension policyExtension = (PolicyExtension) ns2Exts.get(namespace);
           
//      AxisModule axisModule = (AxisModule) ns2modules.get(namespace);

      if (policyExtension == null) {
        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);
           
      policyExtension.addMethodsToStub(document, rootElement, opName, nPolicy);
    }
  }
View Full Code Here

TOP

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

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.