Examples of PolicySet


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

            String[] policySetNames = policySetAnnotation.value();
            if (policySetNames.length != 0) {
                for (String policySetName : policySetNames) {

                    // Add each intent to the list
                    PolicySet policySet = policyFactory.createPolicySet();
                    policySet.setName(getQName(policySetName));
                    policySets.add(policySet);
                }
            }
        }
    }
View Full Code Here

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

                //operation.setName(method.getName());
                //operation.setUnresolved(true);
                for (String policySetName : policySetNames) {
                    // Add each intent to the list, associated with the
                    // operation corresponding to the annotated method
                    PolicySet policySet = policyFactory.createPolicySet();
                    policySet.setName(getQName(policySetName));
                    //intent.getOperations().add(operation);
                    policySets.add(policySet);
                }
            }
        }
View Full Code Here

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

    protected Binding getBinding() {
        return wsBinding;
    }
   
    private PolicySet getPolicySet(QName intentName){
        PolicySet returnPolicySet = null;
       
        if ( wsBinding instanceof PolicySetAttachPoint ) {
            PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding;
            for ( PolicySet policySet : policiedBinding.getPolicySets() ) {
                for (Intent intent : policySet.getProvidedIntents()){
View Full Code Here

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

            int event = reader.getEventType();
            switch (event) {
                case START_ELEMENT: {
                    Object artifact = staxProcessor.read(reader);
                    if ( artifact instanceof PolicySet ) {
                        PolicySet policySet = (PolicySet)artifact;
                        policySet.setName(new QName(namespace, policySet.getName().getLocalPart()));
                        policySetTable.put(policySet.getName(), policySet);
                    } else if ( artifact instanceof Intent ) {
                        Intent intent = (Intent)artifact;
                        intent.setName(new QName(namespace, intent.getName().getLocalPart()));
                        if ( intent instanceof QualifiedIntent ) {
                            ((QualifiedIntent)intent).getQualifiableIntent().
View Full Code Here

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

        QName confidentiality_transport = new QName(namespace, "confidentiality.transport");
        assertTrue(intentTable.get(confidentiality_transport) instanceof QualifiedIntent);
        QualifiedIntent qualifiedIntent = (QualifiedIntent)intentTable.get(new QName(namespace, "confidentiality.transport"));
        assertNull(qualifiedIntent.getQualifiableIntent().getDescription());
       
        PolicySet secureReliablePolicySet = policySetTable.get(secureReliablePolicy);
        PolicySet secureMessagingPolicySet = policySetTable.get(secureMessagingPolicies);
        PolicySet securityPolicySet = policySetTable.get(securityPolicy);
       
        assertEquals(secureReliablePolicySet.getProvidedIntents().get(1).getName(), integrity);
        assertNull(secureReliablePolicySet.getProvidedIntents().get(1).getDescription());
        assertTrue(secureMessagingPolicySet.isUnresolved());
        assertEquals(securityPolicySet.getMappedPolicies().size(), 5);
       
        //testing to ensure that inclusion of referred policy sets has not happened
        PolicySet basicAuthMsgProtSecurityPolicySet = policySetTable.get(basicAuthMsgProtSecurity);
        assertTrue(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
        assertTrue(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().isEmpty());
       
        IntentAttachPointType wsBindingType = bindingTypesTable.get(wsBinding);
        assertNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
        assertNull(wsBindingType.getMayProvideIntents().get(0).getDescription());
       
        IntentAttachPointType javaImplType = implTypesTable.get(javaImpl);
        assertNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
        assertNull(javaImplType.getMayProvideIntents().get(0).getDescription());
       
        for ( Intent intent : intentTable.values() ) {
            staxProcessor.resolve(intent, resolver);
        }
       
        for ( PolicySet policySet : policySetTable.values() ) {
            staxProcessor.resolve(policySet, resolver);
        }
       
        for IntentAttachPointType bindingType : bindingTypesTable.values() ) {
            staxProcessor.resolve(bindingType, resolver);
        }
       
        for ( IntentAttachPointType implType : implTypesTable.values() ) {
            staxProcessor.resolve(implType, resolver);
        }
       
       
       
        //testing if policy intents have been linked have property been linked up
        assertNotNull(profileIntent.getRequiredIntents().get(0).getDescription());
        assertNotNull(qualifiedIntent.getQualifiableIntent().getDescription());
        assertEquals(secureReliablePolicySet.getProvidedIntents().get(1).getName(), integrity);
        assertNotNull(secureReliablePolicySet.getProvidedIntents().get(1).getDescription());
       
        //testing if policysets have been properly linked up with intents
        assertFalse(secureMessagingPolicySet.isUnresolved());
        assertNotNull(secureMessagingPolicySet.getMappedPolicies().get(intentTable.get(confidentiality)));
        assertNotNull(secureMessagingPolicySet.getMappedPolicies().get(intentTable.get(confidentiality_transport)));
       
        //testing if intent maps have been properly mapped to policies
        assertFalse(securityPolicySet.isUnresolved());
        assertNotNull(securityPolicySet.getMappedPolicies().get(intentTable.get(confidentiality)));
        assertNotNull(securityPolicySet.getMappedPolicies().get(intentTable.get(confidentiality_message)));
       
        //testing for inclusion of referred policysets
        assertFalse(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
        assertFalse(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().isEmpty());
        assertNotNull(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().get(intentTable.get(confidentiality_transport)));
       
        assertNotNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
        assertNotNull(wsBindingType.getMayProvideIntents().get(0).getDescription());
       
        assertNotNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
View Full Code Here

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

                                                              qualifiedIntent.getQualifiableIntent().getName().getLocalPart()));
                                }
                               
                                definitions.getPolicyIntents().add(intent);
                            } else if ( extension instanceof PolicySet ) {
                                PolicySet policySet = (PolicySet)extension;
                                policySet.setName(new QName(targetNamespace,
                                                            policySet.getName().getLocalPart()));
                                definitions.getPolicySets().add(policySet);
                            } else if ( extension instanceof IntentAttachPointType ) {
                                IntentAttachPointType type = (IntentAttachPointType)extension;
                                if ( type.getName().getLocalPart().startsWith(BINDING)) {
                                    definitions.getBindingTypes().add((IntentAttachPointType)extension);
View Full Code Here

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

            Intent intent = scaDefns.getPolicyIntents().get(count);
            extensionProcessor.resolve(intent, resolver);
        }
       
        for (int count = 0, size = scaDefns.getPolicySets().size(); count < size; count++) {
            PolicySet policySet = scaDefns.getPolicySets().get(count);
            extensionProcessor.resolve(policySet, resolver);
        }
       
        for (int count = 0, size = scaDefns.getBindingTypes().size(); count < size; count++) {
            IntentAttachPointType bindingType = scaDefns.getBindingTypes().get(count);
View Full Code Here

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

        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

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

                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, context);
                    resolvedPolicySets.add(resolvedPolicySet);
                }
                policySetAttachPoint.getPolicySets().clear();
View Full Code Here

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

                Intent intent = policyFactory.createIntent();
                intent.setName(qn);
                e.getRequiredIntents().add(intent);
            }
            for (QName qn : e.getPolicySetNames()) {
                PolicySet ps = policyFactory.createPolicySet();
                ps.setName(qn);
                e.getPolicySets().add(ps);
            }
        }

        for (SpringSCAServiceElement e : appCxtServices) {
            for (QName qn : e.getIntentNames()) {
                Intent intent = policyFactory.createIntent();
                intent.setName(qn);
                e.getRequiredIntents().add(intent);
            }
            for (QName qn : e.getPolicySetNames()) {
                PolicySet ps = policyFactory.createPolicySet();
                ps.setName(qn);
                e.getPolicySets().add(ps);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.