Examples of OperationsConfigurator


Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                        addInheritedPolicySets(contract.getApplicablePolicySets(), policiedBinding.getApplicablePolicySets());
                        PolicyValidationUtils.validatePolicySets(policiedBinding);
                    }
                   
                    if (binding instanceof OperationsConfigurator) {
                        OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
                        for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
                            resolveIntents(confOp.getRequiredIntents(), resolver);
                            PolicyValidationUtils.validateIntents(confOp, ((PolicySetAttachPoint)binding).getType());
                           
                            resolvePolicySets(confOp.getPolicySets(), resolver);
                            resolvePolicySets(confOp.getApplicablePolicySets(), resolver);
                            //inherit the applicable policysets from parent binding as whatever applies to that
                            //applies to the binding as well
                            addInheritedPolicySets(((PolicySetAttachPoint)binding).getApplicablePolicySets(),
                                                   confOp.getApplicablePolicySets());
                            PolicyValidationUtils.validatePolicySets(confOp, ((PolicySetAttachPoint)binding).getType());
                           
                            addInheritedIntents(((PolicySetAttachPoint)binding).getRequiredIntents(),
                                                confOp.getRequiredIntents());
                            addInheritedPolicySets(((PolicySetAttachPoint)binding).getPolicySets(),
                                                confOp.getPolicySets());
                        }
                    }
                }
   
                // Resolve callback bindings
                if (contract.getCallback() != null) {
                    resolveIntents(contract.getCallback().getRequiredIntents(), resolver);
                    resolvePolicySets(contract.getCallback().getPolicySets(), resolver);
                    resolvePolicySets(contract.getCallback().getApplicablePolicySets(), resolver);
                    //inherit the contract's policy intents and policysets
                    addInheritedIntents(contract.getRequiredIntents(), contract.getCallback().getRequiredIntents());
                    addInheritedPolicySets(contract.getPolicySets(), contract.getCallback().getPolicySets());
                    addInheritedPolicySets(contract.getApplicablePolicySets(), contract.getCallback().getApplicablePolicySets());
                   
                    for (int i = 0, n = contract.getCallback().getBindings().size(); i < n; i++) {
                        Binding binding = contract.getCallback().getBindings().get(i);
                        extensionProcessor.resolve(binding, resolver);
   
                        if (binding instanceof IntentAttachPoint) {
                            IntentAttachPoint policiedBinding = (IntentAttachPoint)binding;
                            resolveIntents(policiedBinding.getRequiredIntents(), resolver);
                            PolicyValidationUtils.validateIntents(policiedBinding, policiedBinding.getType());
                        }
                       
                        if (binding instanceof PolicySetAttachPoint) {
                            PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
                            resolvePolicySets(policiedBinding.getPolicySets(), resolver);
                            //validate if attached policysets apply to the binding
                            resolvePolicySets(policiedBinding.getApplicablePolicySets(), resolver);
                            //inherit the applicable policysets from parent contract as whatever applies to that
                            //applies to the binding as well
                            addInheritedPolicySets(contract.getApplicablePolicySets(), policiedBinding.getApplicablePolicySets());
                            PolicyValidationUtils.validatePolicySets(policiedBinding);
                        }
                       
                        if (binding instanceof OperationsConfigurator) {
                            OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
                            for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
                                resolveIntents(confOp.getRequiredIntents(), resolver);
                                PolicyValidationUtils.validateIntents(confOp, ((PolicySetAttachPoint)binding).getType());
                               
                                resolvePolicySets(confOp.getPolicySets(), resolver);
                                resolvePolicySets(confOp.getApplicablePolicySets(), resolver);
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

    private List<JaasAuthenticationPolicy> findPolicies(Operation op) {
        List<JaasAuthenticationPolicy> polices = new ArrayList<JaasAuthenticationPolicy>();
        // FIXME: How do we get a list of effective policySets for a given operation?
        if (implementation instanceof OperationsConfigurator) {
            OperationsConfigurator operationsConfigurator = (OperationsConfigurator)implementation;
            for (ConfiguredOperation cop : operationsConfigurator.getConfiguredOperations()) {
                if (cop.getName().equals(op.getName())) {
                    cop.getPolicySets();
                }
            }
        }
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                            policyProcessor.readPolicies(operation, reader);
                        } else {
                            policyProcessor.readPolicies(operation, reader);
                        }
                       
                        OperationsConfigurator opConfigurator = null;
                        if ( compositeService != null ) {
                            opConfigurator = compositeService;
                        } else if ( componentService != null ) {
                            opConfigurator = componentService;
                        } else if ( compositeReference != null ) {
                            opConfigurator = compositeReference;
                        } else if ( componentReference != null ) {
                            opConfigurator = componentReference;
                        }
                       
                        opConfigurator.getConfiguredOperations().add(operation);
                    } else if (IMPLEMENTATION_COMPOSITE_QNAME.equals(name)) {

                        // Read an implementation.composite
                        Composite implementation = assemblyFactory.createComposite();
                        implementation.setName(getQName(reader, NAME));
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                fail();
            }
        }

        //test for proper aggregation of policy intents and policysets on operations of implementation
        OperationsConfigurator opConf = (OperationsConfigurator)composite.getComponents().get(5);
        assertEquals(opConf.getConfiguredOperations().get(0).getRequiredIntents().size(), 4);
        for ( Intent intent :  opConf.getConfiguredOperations().get(0).getRequiredIntents()) {
            String intentName = intent.getName().getLocalPart();
            if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
                intentName.equals("tuscanyIntent_5") || intentName.equals("tuscanyIntent_6") ) ) {
                fail();
            }
        }
       
        opConf = (OperationsConfigurator)composite.getComponents().get(6);
        assertEquals(opConf.getConfiguredOperations().get(0).getRequiredIntents().size(), 3);
        for ( Intent intent :  opConf.getConfiguredOperations().get(0).getRequiredIntents()) {
            String intentName = intent.getName().getLocalPart();
            if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
                intentName.equals("tuscanyIntent_6.qualified2") ) ) {
                fail();
            }
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                fail();
            }
        }

        //test for computation of policysets on operations of implementation
        OperationsConfigurator opConf = (OperationsConfigurator)composite.getComponents().get(5);
        assertEquals(opConf.getConfiguredOperations().get(0).getPolicySets().size(), 3);
        for ( PolicySet policySet : opConf.getConfiguredOperations().get(0).getPolicySets() ) {
            String policySetName = policySet.getName().getLocalPart();
            if ( !(policySetName.equals("tuscanyPolicySet_1") || policySetName.equals("tuscanyPolicySet_2")
                    || policySetName.equals("tuscanyPolicySet_3")) ) {
                fail();
            }
        }
       
        opConf = (OperationsConfigurator)composite.getComponents().get(6);
        assertEquals(opConf.getConfiguredOperations().get(0).getPolicySets().size(), 4);
        for ( PolicySet policySet : opConf.getConfiguredOperations().get(0).getPolicySets() ) {
            String policySetName = policySet.getName().getLocalPart();
            if ( !(policySetName.equals("tuscanyPolicySet_1") || policySetName.equals("tuscanyPolicySet_2")
                    || policySetName.equals("tuscanyPolicySet_3")
                    || policySetName.equals("tuscanyPolicySet_4")) ) {
                fail();
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

            PolicySetAttachPoint policiedImplementation = (PolicySetAttachPoint)component.getImplementation();
          
            //trim intents specified in operations.  First check for policysets specified on the operation
            //and then in the parent implementation
            if ( component instanceof OperationsConfigurator ) {
                OperationsConfigurator opConfigurator = (OperationsConfigurator)component;
               
                for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
                    intentsCopy = new ArrayList<Intent>(confOp.getRequiredIntents());
                    trimInherentlyProvidedIntents(policiedImplementation.getType(),
                                                  confOp.getRequiredIntents());
                    trimProvidedIntents(confOp.getRequiredIntents(), confOp.getPolicySets());
                    trimProvidedIntents(confOp.getRequiredIntents(), component.getPolicySets());
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                }
               
                //trim intents specified in operations.  First check for policysets specified on the operation
                //and then in the parent implementation
                if ( aBinding instanceof OperationsConfigurator ) {
                    OperationsConfigurator opConfigurator = (OperationsConfigurator)aBinding;
                   
                    for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
                        List<Intent> opsIntentsCopy = new ArrayList<Intent>(confOp.getRequiredIntents());
                       
                        trimInherentlyProvidedIntents(policiedBinding.getType(),
                                                      confOp.getRequiredIntents());
                        trimProvidedIntents(confOp.getRequiredIntents(), confOp.getPolicySets());
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                interfaceContract.setInterface(wsdlInterface);
                model.setBindingInterfaceContract(interfaceContract);
            }
        }
        policyProcessor.resolvePolicies(model, resolver);
        OperationsConfigurator opCongigurator = (OperationsConfigurator)model;
        for (ConfiguredOperation confOp : opCongigurator.getConfiguredOperations()) {
            policyProcessor.resolvePolicies(confOp, resolver);
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                interfaceContract.setInterface(wsdlInterface);
                model.setBindingInterfaceContract(interfaceContract);
            }
        }
        policyProcessor.resolvePolicies(model, resolver);
        OperationsConfigurator opCongigurator = (OperationsConfigurator)model;
        for (ConfiguredOperation confOp : opCongigurator.getConfiguredOperations()) {
            policyProcessor.resolvePolicies(confOp, resolver);
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                fail();
            }
        }

        //test for proper aggregation of policy intents and policysets on operations of implementation
        OperationsConfigurator opConf = (OperationsConfigurator)composite.getComponents().get(5);
        assertEquals(opConf.getConfiguredOperations().get(0).getRequiredIntents().size(), 4);
        for ( Intent intent :  opConf.getConfiguredOperations().get(0).getRequiredIntents()) {
            String intentName = intent.getName().getLocalPart();
            if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
                intentName.equals("tuscanyIntent_5") || intentName.equals("tuscanyIntent_6") ) ) {
                fail();
            }
        }
       
        opConf = (OperationsConfigurator)composite.getComponents().get(6);
        assertEquals(opConf.getConfiguredOperations().get(0).getRequiredIntents().size(), 3);
        for ( Intent intent :  opConf.getConfiguredOperations().get(0).getRequiredIntents()) {
            String intentName = intent.getName().getLocalPart();
            if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
                intentName.equals("tuscanyIntent_6.qualified2") ) ) {
                fail();
            }
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.