Examples of addPolicyRequirement()


Examples of org.switchyard.component.bean.config.model.v1.V1BeanComponentImplementationModel.addPolicyRequirement()

            if (requires != null) {
                for (SecurityPolicy secPolicy : requires.security()) {
                    if (secPolicy == SecurityPolicy.AUTHORIZATION) {
                        // authorization supports both interaction and implementation,
                        // and we want to add it as implementation to be more correct.
                        beanModel.addPolicyRequirement(secPolicy.getQName());
                    } else if (secPolicy.supports(PolicyType.INTERACTION)) {
                        serviceModel.addPolicyRequirement(secPolicy.getQName());
                    } else if (secPolicy.supports(PolicyType.IMPLEMENTATION)) {
                        beanModel.addPolicyRequirement(secPolicy.getQName());
                    } else {
View Full Code Here

Examples of org.switchyard.component.bean.config.model.v1.V1BeanComponentImplementationModel.addPolicyRequirement()

                        // and we want to add it as implementation to be more correct.
                        beanModel.addPolicyRequirement(secPolicy.getQName());
                    } else if (secPolicy.supports(PolicyType.INTERACTION)) {
                        serviceModel.addPolicyRequirement(secPolicy.getQName());
                    } else if (secPolicy.supports(PolicyType.IMPLEMENTATION)) {
                        beanModel.addPolicyRequirement(secPolicy.getQName());
                    } else {
                        throw BeanMessages.MESSAGES.unknownPolicy(secPolicy.toString());
                    }
                }
                for (TransactionPolicy txPolicy : requires.transaction()) {
View Full Code Here

Examples of org.switchyard.component.bean.config.model.v1.V1BeanComponentImplementationModel.addPolicyRequirement()

                }
                for (TransactionPolicy txPolicy : requires.transaction()) {
                    if (txPolicy.supports(PolicyType.INTERACTION)) {
                        serviceModel.addPolicyRequirement(txPolicy.getQName());
                    } else if (txPolicy.supports(PolicyType.IMPLEMENTATION)) {
                        beanModel.addPolicyRequirement(txPolicy.getQName());
                    } else {
                        throw BeanMessages.MESSAGES.unknownPolicy(txPolicy.toString());
                    }
                }
                // Make sure we don't have conflicting policies
View Full Code Here

Examples of org.switchyard.config.model.composite.ComponentReferenceModel.addPolicyRequirement()

            if (refRequires != null) {
                for (SecurityPolicy secPolicy : refRequires.security()) {
                    if (!secPolicy.supports(PolicyType.INTERACTION)) {
                        throw BeanMessages.MESSAGES.referenceOnlyCouldBeMarkedWithInteractionPolicyButIsNotTheOne(secPolicy.toString());
                    }
                    referenceModel.addPolicyRequirement(secPolicy.getQName());
                }
                for (TransactionPolicy txPolicy : refRequires.transaction()) {
                    if (!txPolicy.supports(PolicyType.INTERACTION)) {
                        throw BeanMessages.MESSAGES.referenceOnlyCouldBeMarkedWithInteractionPolicyButIsNotTheOne(txPolicy.toString());
                    }
View Full Code Here

Examples of org.switchyard.config.model.composite.ComponentReferenceModel.addPolicyRequirement()

                }
                for (TransactionPolicy txPolicy : refRequires.transaction()) {
                    if (!txPolicy.supports(PolicyType.INTERACTION)) {
                        throw BeanMessages.MESSAGES.referenceOnlyCouldBeMarkedWithInteractionPolicyButIsNotTheOne(txPolicy.toString());
                    }
                    referenceModel.addPolicyRequirement(txPolicy.getQName());
                }
                // Make sure we don't have conflicting policies
                QName ptx = TransactionPolicy.PROPAGATES_TRANSACTION.getQName();
                QName stx = TransactionPolicy.SUSPENDS_TRANSACTION.getQName();
                if (referenceModel.hasPolicyRequirement(ptx) && referenceModel.hasPolicyRequirement(stx)) {
View Full Code Here

Examples of org.switchyard.config.model.composite.ComponentReferenceModel.addPolicyRequirement()

        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_FOO));
        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_BAR));

        // Test reference policy
        ComponentReferenceModel ref = new V1ComponentReferenceModel(SwitchYardNamespace.DEFAULT.uri());
        ref.addPolicyRequirement(POLICY_BAR);
        Assert.assertTrue(ref.hasPolicyRequirement(POLICY_BAR));
        Assert.assertFalse(ref.hasPolicyRequirement(POLICY_FOO));
        svc.addPolicyRequirement(POLICY_FOO);
        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_FOO));
    }
View Full Code Here

Examples of org.switchyard.config.model.composite.ComponentServiceModel.addPolicyRequirement()

                    if (secPolicy == SecurityPolicy.AUTHORIZATION) {
                        // authorization supports both interaction and implementation,
                        // and we want to add it as implementation to be more correct.
                        beanModel.addPolicyRequirement(secPolicy.getQName());
                    } else if (secPolicy.supports(PolicyType.INTERACTION)) {
                        serviceModel.addPolicyRequirement(secPolicy.getQName());
                    } else if (secPolicy.supports(PolicyType.IMPLEMENTATION)) {
                        beanModel.addPolicyRequirement(secPolicy.getQName());
                    } else {
                        throw BeanMessages.MESSAGES.unknownPolicy(secPolicy.toString());
                    }
View Full Code Here

Examples of org.switchyard.config.model.composite.ComponentServiceModel.addPolicyRequirement()

                        throw BeanMessages.MESSAGES.unknownPolicy(secPolicy.toString());
                    }
                }
                for (TransactionPolicy txPolicy : requires.transaction()) {
                    if (txPolicy.supports(PolicyType.INTERACTION)) {
                        serviceModel.addPolicyRequirement(txPolicy.getQName());
                    } else if (txPolicy.supports(PolicyType.IMPLEMENTATION)) {
                        beanModel.addPolicyRequirement(txPolicy.getQName());
                    } else {
                        throw BeanMessages.MESSAGES.unknownPolicy(txPolicy.toString());
                    }
View Full Code Here

Examples of org.switchyard.config.model.composite.ComponentServiceModel.addPolicyRequirement()

    @Test
    public void buildPolicyConfig() throws Exception {
        // Test service policy
        ComponentServiceModel svc = new V1ComponentServiceModel(SwitchYardNamespace.DEFAULT.uri());
        svc.addPolicyRequirement(POLICY_FOO);
        svc.addPolicyRequirement(POLICY_BAR);
        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_FOO));
        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_BAR));

        // Test reference policy
View Full Code Here

Examples of org.switchyard.config.model.composite.ComponentServiceModel.addPolicyRequirement()

    @Test
    public void buildPolicyConfig() throws Exception {
        // Test service policy
        ComponentServiceModel svc = new V1ComponentServiceModel(SwitchYardNamespace.DEFAULT.uri());
        svc.addPolicyRequirement(POLICY_FOO);
        svc.addPolicyRequirement(POLICY_BAR);
        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_FOO));
        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_BAR));

        // Test reference policy
        ComponentReferenceModel ref = new V1ComponentReferenceModel(SwitchYardNamespace.DEFAULT.uri());
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.