Examples of PolicySet


Examples of com.sun.xacml.PolicySet

            log.info("No matching XACML policy found");
            return null;
        case 1:
            return ((AbstractPolicy) (list.get(0)));
        default:
            return new PolicySet(parentId, combiningAlg, target, list);
        }
    }
View Full Code Here

Examples of com.volantis.devrep.device.api.xml.policy.PolicySet

    private ResourceJiBXTester tester = new ResourceJiBXTester(
            PolicyTestCase.class);

    public void testUnmarshall() throws JiBXException, IOException {

        PolicySet policySet = (PolicySet) tester.unmarshall(PolicySet.class,
                "PolicyTest.xml");

        StringBuffer output = new StringBuffer();
        dumpPolicySet(policySet, output);

        Iterator i =policySet.entries();
          while (i.hasNext())
          {
             PolicyEntry test = (PolicyEntry)i.next();
             if ("testinherit".equals(test.getName())) {
                 assertNotNull(test.getInherit());
View Full Code Here

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

        String value = reader.getAttributeValue(null, "policySets");
        if (value != null) {
            List<PolicySet> policySets = attachPoint.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) {
                    //policySet.getOperations().add(operation);
                }
                policySets.add(policySet);
            }
View Full Code Here

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

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

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

     * @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) {
            resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
            resolvedPolicySets.add(resolvedPolicySet);
        }
        policySets.clear();
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

            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));
                    subject.getPolicySets().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

            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
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.