Package org.apache.neethi

Examples of org.apache.neethi.PolicyReference


    for (Iterator iterator = attachPolicyComponents.iterator(); iterator
        .hasNext();) {
      Object policyElement = iterator.next();

      if (policyElement instanceof Policy) {
        PolicyReference policyReference = PolicyUtil
            .createPolicyReference((Policy) policyElement);
        OMElement policyRefElement = PolicyUtil
            .getPolicyComponentAsOMElement(
                (PolicyComponent) policyReference, serializer);
View Full Code Here


            }
            return;
        }
   
        if (Constants.TYPE_POLICY_REF == pc.getType()) {
            PolicyReference pr = (PolicyReference)pc;
            pc = pr.normalize(registry, false);
        }

        PolicyOperator po = (PolicyOperator)pc;

        List<PolicyComponent> pcs = CastUtils.cast(po.getPolicyComponents(), PolicyComponent.class);
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

            }
            return;
        }
   
        if (Constants.TYPE_POLICY_REF == pc.getType()) {
            PolicyReference pr = (PolicyReference)pc;
            pc = pr.normalize(registry, false);
        }

        PolicyOperator po = (PolicyOperator)pc;

        List<PolicyComponent> pcs = CastUtils.cast(po.getPolicyComponents(), PolicyComponent.class);
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

    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 = UIDGenerator.generateUID();
        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

                    // <wsp:PolicyReference>
                } else if (Constants.isPolicyRef(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

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.