Package org.apache.neethi

Examples of org.apache.neethi.Policy


        }

        if (count == 0) {
            return newPrimitiveAssertion(element, atts.isEmpty() ? null : atts);
        } else if (policyCount == 1 && count == 1) {
            Policy policy = factory.getPolicyEngine().getPolicy(policyEl);
            return newPolicyContainingAssertion(element, atts.isEmpty() ? null : atts, policy);
        }
        return new XmlPrimitiveAssertion(element);
    }
View Full Code Here


        /*
         * now we should take the effective one .. it is necessary since
         * AxisDescription.applyPolicy(..) doesn't override policies at the
         * Upper levels.
         */
        Policy effPolicy = getPolicyInclude().getEffectivePolicy();

        /*
         * for the moment we consider policies with only one alternative. If the
         * policy contains multiple alternatives only the first alternative will
         * be considered.
         */
        Iterator iterator = effPolicy.getAlternatives();
        if (!iterator.hasNext()) {
            throw new AxisFault(
                    "Policy doesn't contain any policy alternatives");
        }

View Full Code Here

        AxisConfiguration configuration = getAxisConfiguration();
        if (configuration == null) {
            return; // CHECKME: May be we need to throw an Exception ??
        }

        Policy effPolicy = getPolicyInclude().getEffectivePolicy();

        if (effPolicy != null) {

            /*
             * for the moment we consider policies with only one alternative. If
             * the policy contains multiple alternatives only the first
             * alternative will be considered.
             */
            Iterator iterator = effPolicy.getAlternatives();
            if (!iterator.hasNext()) {
                throw new AxisFault(
                        "Policy doesn't contain any policy alternatives");
            }

View Full Code Here

                UnknownExtensibilityElement unknown = (UnknownExtensibilityElement) (wsdl4jElement);

                if (WSDLConstants.WSDL11Constants.POLICY.equals(unknown
                        .getElementType())) {

                    Policy policy = (Policy) PolicyUtil
                            .getPolicyComponent(unknown.getElement());
                    addPolicy(description, originOfExtensibilityElements,
                            policy);

                } else if (WSDLConstants.WSDL11Constants.POLICY_REFERENCE
View Full Code Here

            if (extElement instanceof UnknownExtensibilityElement) {
                UnknownExtensibilityElement unknown = (UnknownExtensibilityElement) extElement;
                if (WSDLConstants.WSDL11Constants.POLICY.equals(unknown
                        .getElementType())) {

                    Policy policy = (Policy) PolicyUtil
                            .getPolicyComponent(unknown.getElement());

                    String key;
                    if ((key = policy.getName()) != null
                            || (key = policy.getId()) != null) {
                        registry.register(key, policy);
                    }

                }
            }
View Full Code Here

    return null;
  }

  private void calculatePolicy() {

    Policy result = null;
    Iterator iterator = wrapperElements.values().iterator();

    while (iterator.hasNext()) {
      Object policyElement = ((Wrapper) iterator.next()).getValue();
      Policy p;

      if (policyElement instanceof PolicyReference) {
                PolicyRegistry r = getPolicyRegistry();
        p = (Policy) ((PolicyReference) policyElement)
            .normalize(getPolicyRegistry(), false);
View Full Code Here

       
    this.policy = result;
  }

  private void calculateEffectivePolicy() {
    Policy result ;
   
    if (getParent() != null) {
      Policy parentPolicy = getParent().getEffectivePolicy();
     
      if (parentPolicy == null) {
        result = getPolicy();
       
      } else {
       
        if (getPolicy() != null) {
          result = (Policy) parentPolicy.merge(getPolicy());
         
        } else {
          result = parentPolicy;
        }
      }
View Full Code Here

    }

    @Override
    public void initialize(Client client, Bus bus) {
        Endpoint endpoint = client.getEndpoint();
        Policy p = initializeEndpointPolicy(endpoint, bus);
        PolicyEngine pe = bus.getExtension(PolicyEngine.class);
        EndpointInfo ei = endpoint.getEndpointInfo();
        EndpointPolicy ep = pe.getClientEndpointPolicy(ei, null);
        pe.setClientEndpointPolicy(ei, ep.updatePolicy(p));
    }
View Full Code Here

    }

    @Override
    public void initialize(Server server, Bus bus) {
        Endpoint endpoint = server.getEndpoint();
        Policy p = initializeEndpointPolicy(endpoint, bus);
        PolicyEngine pe = bus.getExtension(PolicyEngine.class);
        EndpointInfo ei = endpoint.getEndpointInfo();
        EndpointPolicy ep = pe.getServerEndpointPolicy(ei, null);
        pe.setServerEndpointPolicy(ei, ep.updatePolicy(p));
View Full Code Here

                }
            }
            if (null != policyReferenceElements) {
                for (Element e : policyReferenceElements) {
                    PolicyReference pr = builder.getPolicyReference(e);
                    Policy resolved = resolveReference(pr, builder, bus, i);
                    if (null != resolved) {
                        loadedPolicies.add(resolved);
                    }
                }
            }
        }
       
        Policy thePolicy = new Policy();
       
        if (policies != null) {
            for (Policy p : policies) {
                thePolicy = thePolicy.merge(p);
            }
        }
       
        if (loadedPolicies != null) {
            for (Policy p : loadedPolicies) {
                thePolicy = thePolicy.merge(p);
            }
        }
       
        return thePolicy;
    }
View Full Code Here

TOP

Related Classes of org.apache.neethi.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.