Package org.apache.neethi

Examples of org.apache.neethi.PolicyReference


       
        assertions.clear();
        Policy p = new Policy();
        a = new PrimitiveAssertion(new QName("http://x.y.z", "a"));
        p.addAssertion(a);
        PolicyReference pr = new PolicyReference();
        pr.setURI("a#b");
        engine.getRegistry().register("a#b", p);
       
        engine.addAssertions(pr, false, assertions);
        assertEquals(1, assertions.size());
        assertSame(a, assertions.iterator().next());      
View Full Code Here


    return sbuf.toString();
  }

  public static PolicyReference createPolicyReference(Policy policy) {
    PolicyReference policyReference = new PolicyReference();
    String key = policy.getName();
    if (key == null) {
      key = policy.getId();
      if (key == null) {
        key = UUIDGenerator.getUUID();
        policy.setId(key);
      }
      policyReference.setURI("#" + key);
    } else {
      policyReference.setURI(key);
    }
    return policyReference;
  }
View Full Code Here

      if (policyElement instanceof Policy) {
        policy = (policy == null) ? (Policy) policyElement
            : (Policy) policy.merge((Policy) policyElement);

      } else {
        PolicyReference policyReference = (PolicyReference) policyElement;
        Policy policy2 = (Policy) policyReference.normalize(
            new AxisPolicyLocator(description), false);
        policy = (policy == null) ? policy2 : (Policy) policy
            .merge(policy2);
      }
    }
View Full Code Here

      if (policyElement instanceof Policy) {
        policy = (policy == null) ? (Policy) policyElement
            : (Policy) policy.merge((Policy) policyElement);

      } else {
        PolicyReference policyReference = (PolicyReference) policyElement;
        Policy policy2 = (Policy) policyReference.normalize(
            new PolicyLocator(service), false);
        policy = (policy == null) ? policy2 : (Policy) policy
            .merge(policy2);
      }
    }
View Full Code Here

    Collection attachPolicyComponents = policySubject
        .getAttachedPolicyComponents();

        for (Object policyElement : attachPolicyComponents) {
            if (policyElement instanceof Policy) {
                PolicyReference policyReference =
                        PolicyUtil.createPolicyReference((Policy)policyElement);
                OMElement policyRefElement =
                        PolicyUtil.getPolicyComponentAsOMElement(policyReference, serializer);

                OMNode firstChildElem = wsdlElement.getFirstElement();
                if (firstChildElem == null) {
                    wsdlElement.addChild(policyRefElement);
                } else {
                    firstChildElem.insertSiblingBefore(policyRefElement);
                }
                String key = policyReference.getURI();
                if (key.startsWith("#")) {
                    key = key.substring(key.indexOf("#") + 1);
                }
                addPolicyToDefinitionElement(key, (Policy)policyElement);
View Full Code Here

                } else if (WSDLConstants.WSDL11Constants.POLICY_REFERENCE
                        .equals(type)) {
                    if (isTraceEnabled) {
                        log.trace("copyExtensibleElements:: PolicyReference found " + unknown);
                    }
                    PolicyReference policyReference = (PolicyReference) PolicyUtil
                            .getPolicyComponent(unknown.getElement());
                    description.getPolicySubject().attachPolicyReference(policyReference);
                   
//                    int attachmentScope =
//                            getPolicyAttachmentPoint(description, originOfExtensibilityElements);
View Full Code Here

        String policyURIs = value.getLocalPart();

        if (policyURIs.length() != 0) {
          String[] uris = policyURIs.split(" ");

          PolicyReference ref;
          for (int i = 0; i < uris.length; i++) {
            ref = new PolicyReference();
            ref.setURI(uris[i]);

            if (PORT_TYPE.equals(origin)
                    || PORT_TYPE_OPERATION.equals(origin)
                    || PORT_TYPE_OPERATION_INPUT.equals(origin)
                    || PORT_TYPE_OPERATION_OUTPUT.equals(origin)) {
View Full Code Here

    }

    protected void processPolicyRefElements(Iterator policyRefElements,
                                            PolicySubject policySubject) {
        while (policyRefElements.hasNext()) {
            PolicyReference policyReference = PolicyEngine
                    .getPolicyReference((OMElement) policyRefElements.next());
            policySubject.attachPolicyReference(policyReference);
        }
    }
View Full Code Here

    public PolicyReference getPolicyReference(Element element) {
        if (!Constants.ELEM_POLICY_REF.equals(element.getLocalName())) {
            throw new PolicyException(new Message("NOT_A_POLICYREF_ELEMENT_EXC", BUNDLE));
        }
        synchronized (element) {
            PolicyReference reference = new PolicyReference();
            reference.setURI(element.getAttribute("URI"));
            return reference;
        }
    }
View Full Code Here

                    if (null != attachment.getPolicy()) {
                        p = p.merge(attachment.getPolicy());
                    }
                    attachment.setPolicy(p);
                } else if (PolicyConstants.isPolicyRefElem(qn)) {
                    PolicyReference ref = builder.getPolicyReference((Element)nd);
                    if (null != ref) {  
                        Policy p = resolveReference(ref, doc);
                        if (null != attachment.getPolicy()) {
                            p = p.merge(attachment.getPolicy());
                        }
View Full Code Here

TOP

Related Classes of org.apache.neethi.PolicyReference

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.