Package org.apache.ws.policy

Examples of org.apache.ws.policy.Policy


      }
   }

   private Policy resolvePolicyReference(PolicyReference policyRef, PolicyRegistry localPolicies)
   {
      Policy normPolicy;
      try
      {
         normPolicy = (Policy)policyRef.normalize(localPolicies);
      }
      catch (RuntimeException e)
View Full Code Here


         ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
         extMetaData.addExtension(ext);
      }
      try
      {
         Policy deployedPolicy = deployer.deployServerside(policy, extMetaData);
         ext.addPolicy(scope, deployedPolicy);
      }
      catch (UnsupportedPolicy e)
      {
         log.warn("Policy Not supported:" + policy.getPolicyURI());
View Full Code Here

   private static List<PrimitiveAssertion> getWSRMPAssertions(PrimitiveAssertion assertion)
   {
      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++)
         {
View Full Code Here

      throw new UnsupportedAssertion();
   }
  
   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++)
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

            } 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

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.