Package org.apache.tuscany.sca.policy

Examples of org.apache.tuscany.sca.policy.PolicySet


   
    /**
     * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
     */
    public Interceptor createInterceptor(Operation operation) {
        PolicySet ps = findPolicySet();
        return ps == null ? null : new BasicAuthenticationReferencePolicyInterceptor(getContext(), operation, ps);
    }
View Full Code Here


     * @param policySets list of attached policy sets
     * @param resolver
     */
    protected void resolvePolicySets(List<PolicySet> policySets, ModelResolver resolver) {
        List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
        PolicySet resolvedPolicySet = null;
        for (PolicySet policySet : policySets) {
            if (policySet.isUnresolved()) {
                resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
                resolvedPolicySets.add(resolvedPolicySet);
            } else {
View Full Code Here

        String value = reader.getAttributeValue(null, POLICY_SETS);
        if (value != null) {
            List<PolicySet> policySets = policySetAttachPoint.getPolicySets();
            for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
                QName qname = getQNameValue(reader, tokens.nextToken());
                PolicySet policySet = policyFactory.createPolicySet();
                policySet.setName(qname);
                if (operation != null) {
                    //FIXME Don't we need to handle policySet specification
                    // on an operation basis?
                    //policySet.getOperations().add(operation);
                }
                policySets.add(policySet);
            }
        }
       
        value = reader.getAttributeValue(SCA10_TUSCANY_NS, APPLICABLE_POLICY_SETS);
        if (value != null) {
            List<PolicySet> applicablePolicySets = policySetAttachPoint.getApplicablePolicySets();
            for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
                QName qname = getQNameValue(reader, tokens.nextToken());
                PolicySet policySet = policyFactory.createPolicySet();
                policySet.setName(qname);
                if (operation != null) {
                    //FIXME Don't we need to handle policySet specification
                    // on an operation basis?
                    //policySet.getOperations().add(operation);
                }
View Full Code Here

                policySetAttachPoint.getRequiredIntents().addAll(requiredIntents);
            }
           
            if ( policySetAttachPoint.getPolicySets() != null && policySetAttachPoint.getPolicySets().size() > 0 ) {
                List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
                PolicySet resolvedPolicySet = null;
                for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
                    resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
                    resolvedPolicySets.add(resolvedPolicySet);
                }
                policySetAttachPoint.getPolicySets().clear();
View Full Code Here

        String value = reader.getAttributeValue(null, POLICY_SETS);
        if (value != null) {
            List<PolicySet> policySets = policySubject.getPolicySets();
            for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
                QName qname = getQNameValue(reader, tokens.nextToken());
                PolicySet policySet = policyFactory.createPolicySet();
                policySet.setName(qname);
                if (operation != null) {
                    //FIXME Don't we need to handle policySet specification
                    // on an operation basis?
                    //policySet.getOperations().add(operation);
                }
View Full Code Here

                policySetAttachPoint.getRequiredIntents().addAll(requiredIntents);
            }
           
            if ( policySetAttachPoint.getPolicySets() != null && policySetAttachPoint.getPolicySets().size() > 0 ) {
                List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
                PolicySet resolvedPolicySet = null;
                for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
                    resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
                    resolvedPolicySets.add(resolvedPolicySet);
                }
                policySetAttachPoint.getPolicySets().clear();
View Full Code Here

        if (uri == null) {
            return null;
        }

        // pull out the binding intents to see what sort of transport is required
        PolicySet transportJmsPolicySet = AxisPolicyHelper.getPolicySet(wsBinding, TRANSPORT_JMS_QUALIFIED_INTENT);
        if (transportJmsPolicySet != null){
            if (!uri.startsWith("jms:/")) {
                uri = "jms:" + uri;
            }
           
            // construct the rest of the URI based on the policy. All the details are put
            // into the URI here rather than being place directly into the Axis configuration
            // as the Axis JMS sender relies on parsing the target URI     
            Axis2ConfigParamPolicy axis2ConfigParamPolicy = null;
            for ( Object policy : transportJmsPolicySet.getPolicies() ) {
                if ( policy instanceof Axis2ConfigParamPolicy ) {
                    axis2ConfigParamPolicy = (Axis2ConfigParamPolicy)policy;
                    Iterator paramIterator = axis2ConfigParamPolicy.getParamElements().get(DEFAULT_QUEUE_CONNECTION_FACTORY).getChildElements();
                   
                    if (paramIterator.hasNext()){
View Full Code Here

    public static final QName INTEGRITY_INTENT = new QName(XMLNS_SCA_11, "integrity");
    public static final QName MTOM_INTENT = new QName(XMLNS_SCA_11, "MTOM");
    public static final QName SOAP12_INTENT = new QName(XMLNS_SCA_11, "SOAP12");

    public static PolicySet getPolicySet(Binding wsBinding, QName intentName) {
        PolicySet returnPolicySet = null;

        if (wsBinding instanceof PolicySubject) {
            PolicySubject policiedBinding = (PolicySubject)wsBinding;
            for (PolicySet policySet : policiedBinding.getPolicySets()) {
                for (Intent intent : policySet.getProvidedIntents()) {
View Full Code Here

    /**
     * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
     */
    public Interceptor createInterceptor(Operation operation) {
        PolicySet ps = findPolicySet();
        return ps == null ? null : new BasicAuthenticationServicePolicyInterceptor(getContext(), operation, ps);
    }
View Full Code Here

   
    /**
     * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
     */
    public Interceptor createInterceptor(Operation operation) {
        PolicySet ps = findPolicySet();
        return ps == null ? null : new BasicAuthenticationReferencePolicyInterceptor(getContext(), operation, ps);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.policy.PolicySet

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.