Package org.apache.ws.policy

Examples of org.apache.ws.policy.PrimitiveAssertion


          // TODO Auto-generated catch block
          e.printStackTrace();
          return new Boolean(false);
        }
      }
      PrimitiveAssertion pa = spc.getAssertion();
      String text = pa.getStrValue();
      if (text != null) {
        text = text.trim();
        System.out.println("Value: '" + text.toString() + "'");
      }
    case SecurityProcessorContext.COMMIT:
View Full Code Here


          // TODO Auto-generated catch block
          e.printStackTrace();
          return new Boolean(false);
        }
      }
      PrimitiveAssertion pa = spc.getAssertion();
      String text = pa.getStrValue();
      if (text != null) {
        text = text.trim();
        System.out.println("Value: '" + text.toString() + "'");
      }
    case SecurityProcessorContext.COMMIT:
View Full Code Here

        /*
         * We need to pick only the primitive assertions which contain a
         * WSSecurityPolicy policy assertion. For that we'll check the
         * namespace of the primitive assertion
         */
        PrimitiveAssertion pa = (PrimitiveAssertion) assertion;
        if (!(pa.getName().getNamespaceURI()
            .equals("http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"))) {
          System.out.println("Got a unexpected assertion: "
              + pa.getName().getLocalPart());
          continue;
        }
        all = processPrimitiveAssertion((PrimitiveAssertion) assertion);
      }
      /*
 
View Full Code Here

        : primTermsB;
    List smaller = (primTermsA.size() < primTermsB.size()) ? primTermsA
        : primTermsB;

    Iterator iterator = larger.iterator();
    PrimitiveAssertion primTerm;
    QName qname;
    Iterator iterator2;
    while (iterator.hasNext()) {
      primTerm = (PrimitiveAssertion) iterator.next();
      qname = primTerm.getName();
      iterator2 = smaller.iterator();

      boolean match = false;
      PrimitiveAssertion primTerm2;
      while (iterator2.hasNext()) {
        primTerm2 = (PrimitiveAssertion) iterator2.next();
        if (primTerm2.getName().equals(qname)) {
          match = true;
          break;
        }
      }
      if (!match) {
View Full Code Here

    return new PolicyReference(attribute.getAttributeValue());
  }

  private PrimitiveAssertion readPrimitiveAssertion(OMElement element) {
    QName qname = element.getQName();
    PrimitiveAssertion result = new PrimitiveAssertion(qname);

    result.setAttributes(getAttributes(element));

    String isOptional = result.getAttribute(new QName(
        PolicyConstants.WS_POLICY_NAMESPACE_URI, "Optional"));
    result.setOptional(new Boolean(isOptional).booleanValue());

    // setting the text value ..
    String strValue = element.getText();

    if (strValue != null && strValue.length() != 0) {
      result.setStrValue(strValue.trim());
    }

    //CHECK ME
    Iterator childElements = element.getChildElements();

    while (childElements.hasNext()) {
      OMElement childElement = (OMElement) childElements.next();

      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);
      }
    }
    return result;
  }
View Full Code Here

        /*
         * We need to pick only the primitive assertions which contain a
         * WSSecurityPolicy policy assertion. For that we'll check the
         * namespace of the primitive assertion
         */
        PrimitiveAssertion pa = (PrimitiveAssertion) assertion;
        if (!(pa.getName().getNamespaceURI()
            .equals("http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"))) {
          System.out.println("Got a unexpected assertion: "
              + pa.getName().getLocalPart());
          continue;
        }
        all = processPrimitiveAssertion((PrimitiveAssertion) assertion);
      }
      /*
 
View Full Code Here

  }

  private PrimitiveAssertion readPrimitiveAssertion(Element element) {
    QName qname = new QName(element.getNamespaceURI(), element
        .getLocalName(), element.getPrefix());
    PrimitiveAssertion result = new PrimitiveAssertion(qname);

    result.setAttributes(getAttributes(element));
    String isOptional = result.getAttribute(new QName(
        PolicyConstants.WS_POLICY_NAMESPACE_URI, "Optional"));
    result.setOptional(new Boolean(isOptional).booleanValue());

    //CHECK ME
    NodeList list = element.getChildNodes();
    int length = list.getLength();

    for (int i = 0; i < length; i++) {
      Node node = list.item(i);
      short nodeType = node.getNodeType();

      if (nodeType == Node.ELEMENT_NODE) {
        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);
        }
      } else if (nodeType == Node.TEXT_NODE) {
        String strValue = node.getNodeValue();
View Full Code Here

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

                    if (moduleList == null) {
                        System.err.println("cannot find a module to process "
View Full Code Here

    }

    private PrimitiveAssertion readPrimitiveAssertion(Element element) {
        QName qname = new QName(element.getNamespaceURI(), element
                .getLocalName(), element.getPrefix());
        PrimitiveAssertion result = new PrimitiveAssertion(qname);

        result.setAttributes(getAttributes(element));
        String isOptional = result.getAttribute(new QName(
                PolicyConstants.WS_POLICY_NAMESPACE_URI, "Optional"));
        result.setOptional(new Boolean(isOptional).booleanValue());

        //CHECK ME
        NodeList list = element.getChildNodes();
        int length = list.getLength();

        for (int i = 0; i < length; i++) {
            Node node = list.item(i);
            short nodeType = node.getNodeType();

            if (nodeType == Node.ELEMENT_NODE) {
                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);
                }
            } else if (nodeType == Node.TEXT_NODE) {
                String strValue = node.getNodeValue();
View Full Code Here

        : primTermsB;
    List smaller = (primTermsA.size() < primTermsB.size()) ? primTermsA
        : primTermsB;

    Iterator iterator = larger.iterator();
    PrimitiveAssertion primTerm;
    QName qname;
    Iterator iterator2;
    while (iterator.hasNext()) {
      primTerm = (PrimitiveAssertion) iterator.next();
      qname = primTerm.getName();
      iterator2 = smaller.iterator();

      boolean match = false;
      PrimitiveAssertion primTerm2;
      while (iterator2.hasNext()) {
        primTerm2 = (PrimitiveAssertion) iterator2.next();
        if (primTerm2.getName().equals(qname)) {
          match = true;
          break;
        }
      }
      if (!match) {
View Full Code Here

TOP

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

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.