Examples of AndCompositeAssertion


Examples of org.apache.ws.policy.AndCompositeAssertion

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

        for (int i = 0; !success && i < numberOfAlternatives; i++) {
            AndCompositeAssertion aPolicyAlternative = (AndCompositeAssertion) listOfPolicyAlternatives
                    .get(i);

            List listOfAssertions = aPolicyAlternative.getTerms();

            Iterator iterator = listOfAssertions.iterator();
            /*
             * Loop over all assertions in this alternative. If all assertions
             * can be fulfilled then we choose this alternative and signal a
View Full Code Here

Examples of org.apache.ws.policy.AndCompositeAssertion

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

    for (int i = 0; !success && i < numberOfAlternatives; i++) {
      AndCompositeAssertion aPolicyAlternative = (AndCompositeAssertion) listOfPolicyAlternatives
          .get(i);

      List listOfAssertions = aPolicyAlternative.getTerms();

      Iterator iterator = listOfAssertions.iterator();
      /*
       * Loop over all assertions in this alternative. If all assertions
       * can be fulfilled then we choose this alternative and signal a
View Full Code Here

Examples of org.apache.ws.policy.AndCompositeAssertion

          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.next();
          String namespace = pa.getName().getNamespaceURI();
          ArrayList moduleList = (ArrayList)ns2modules.get(namespace);
         
View Full Code Here

Examples of org.apache.ws.policy.AndCompositeAssertion

      Policy policy = new Policy("myID");
      PrimitiveAssertion assertion1 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy","test"));
      PrimitiveAssertion assertion2 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy2","test2"));
      PrimitiveAssertion assertion3 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy3","test3"));
      PrimitiveAssertion assertion4 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy4","test4"));
      AndCompositeAssertion andAssertion1 = new AndCompositeAssertion();
      andAssertion1.addTerm(assertion1);
      andAssertion1.addTerm(assertion2);
      AndCompositeAssertion andAssertion2 = new AndCompositeAssertion();
      andAssertion2.addTerm(assertion3);
      andAssertion2.addTerm(assertion4);
      XorCompositeAssertion xorAssertion = new XorCompositeAssertion();
      xorAssertion.addTerm(andAssertion1);
      xorAssertion.addTerm(andAssertion2);
      policy.addTerm(xorAssertion);
      deployer.deployServerside(policy, null);
View Full Code Here

Examples of org.apache.ws.policy.AndCompositeAssertion

    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);

            QName operationName = operation.getName();
      policyExtension.addMethodsToStub(document, rootElement, operationName, nPolicy);
View Full Code Here

Examples of org.apache.ws.policy.AndCompositeAssertion

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

    for (int i = 0; !success && i < numberOfAlternatives; i++) {
      AndCompositeAssertion aPolicyAlternative = (AndCompositeAssertion) listOfPolicyAlternatives
          .get(i);

      List listOfAssertions = aPolicyAlternative.getTerms();

      Iterator iterator = listOfAssertions.iterator();
      /*
       * Loop over all assertions in this alternative. If all assertions
       * can be fulfilled then we choose this alternative and signal a
View Full Code Here

Examples of org.apache.ws.policy.AndCompositeAssertion

      List<PrimitiveAssertion> retVal = new LinkedList<PrimitiveAssertion>();
      if (assertion.getTerms().size() != 0)
      {
         Policy policy = (Policy)assertion.getTerms().get(0);
         XorCompositeAssertion xor = (XorCompositeAssertion)policy.getTerms().get(0);
         AndCompositeAssertion and = (AndCompositeAssertion)xor.getTerms().get(0);
         List<?> primitiveAssertions = and.getTerms();

         for (int i = 0; i < primitiveAssertions.size(); i++)
         {
            retVal.add((PrimitiveAssertion)primitiveAssertions.get(i));
         }
View Full Code Here

Examples of org.apache.ws.policy.AndCompositeAssertion

  
   private static List<PrimitiveAssertion> getWSRMPAssertions(PrimitiveAssertion assertion)
   {
      Policy policy = (Policy)assertion.getTerms().get(0);
      XorCompositeAssertion xor = (XorCompositeAssertion)policy.getTerms().get(0);
      AndCompositeAssertion and = (AndCompositeAssertion)xor.getTerms().get(0);
      List<?> primitiveAssertions = and.getTerms();

      List<PrimitiveAssertion> retVal = new LinkedList<PrimitiveAssertion>();
      for (int i = 0; i < primitiveAssertions.size(); i++)
      {
         retVal.add((PrimitiveAssertion)primitiveAssertions.get(i));
View Full Code Here

Examples of org.apache.ws.policy.AndCompositeAssertion

      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

Examples of org.apache.ws.policy.AndCompositeAssertion

  }

  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
TOP
Copyright © 2018 www.massapi.com. 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.