Examples of WSPolicy


Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

        XMLDocumentStreamReader doc = new XMLDocumentStreamReader(reader);
        StAXOMBuilder builder = new StAXOMBuilder(doc);
        OMElement element = builder.getDocumentElement();
        neethiPolicy = PolicyEngine.getPolicy(element);
       
        WSPolicy wsPolicy = new WSPolicy();
        wsPolicy.setNeethiPolicy(neethiPolicy);
       
        // normalize the neethi tree so we can easily identify
        // the policy alternatives
        neethiPolicy.normalize(true);
       
        // top-level children of ExactlyOne are policy alternatives so
        // for each child create a policy model list and pull the
        // policies out
        for(Object alternative : neethiPolicy.getPolicyComponents()) {
            List<Object> assertions = new ArrayList<Object>();
            readPolicyAssertions(assertions, (PolicyComponent)alternative, context);
            wsPolicy.getPolicyAssertions().add(assertions);
        }
              
       
        return wsPolicy;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

        XMLDocumentStreamReader doc = new XMLDocumentStreamReader(reader);
        StAXOMBuilder builder = new StAXOMBuilder(doc);
        OMElement element = builder.getDocumentElement();
        neethiPolicy = PolicyEngine.getPolicy(element);
       
        WSPolicy wsPolicy = new WSPolicy();
        wsPolicy.setNeethiPolicy(neethiPolicy);
       
        // normalize the neethi tree so we can easily identify
        // the policy alternatives
/*  Messes up the hierarchy if rampart config policies included     
        try {
            neethiPolicy.normalize(true);
        } catch (UnsupportedOperationException ex){
            // RampartConfig policies don't support this yet
        }
*/       
       
        // top-level children of ExactlyOne are policy alternatives so
        // for each child create a policy model list and pull the
        // policies out
        for(Object alternative : neethiPolicy.getPolicyComponents()) {
            List<Object> assertions = new ArrayList<Object>();
            readPolicyAssertions(assertions, (PolicyComponent)alternative, context);
            wsPolicy.getPolicyAssertions().add(assertions);
        }
              
       
        return wsPolicy;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

                break;
            }
        }
        assertNotNull(artifact);
        Assert.assertTrue(artifact instanceof WSPolicy);
        WSPolicy policy = (WSPolicy) artifact;
        Assert.assertTrue(policy.getNeethiPolicy().getAlternatives().hasNext());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

    public void configureBinding(Object context) {
        ConfigurationContext configContext = ((Axis2BaseBindingProvider)context).getAxisConfigurationContext();
       
        for ( Object policy : findPolicies() ) {
            if ( policy instanceof WSPolicy ) {
                WSPolicy wsPolicy = (WSPolicy)policy;
                try {
                    configContext.getAxisConfiguration().applyPolicy(wsPolicy.getNeethiPolicy());
                    configContext.getAxisConfiguration().engageModule("rampart");
                   
                    // TUSCANY-2824
                    // hack to make service side pick up rampart policies
                    // "rampartPolicy" comes from RampartMessageData.KEY_RAMPART_POLICY
                    // but I'm avoiding adding an explicit dependency just yet.
                    // There must be a proper way of getting rampart to recognize
                    // these policies
                    configContext.setProperty("rampartPolicy", wsPolicy.getNeethiPolicy());
                   
                } catch ( AxisFault e ) {
                    throw new RuntimeException(e);
                }
            }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

        XMLDocumentStreamReader doc = new XMLDocumentStreamReader(reader);
        StAXOMBuilder builder = new StAXOMBuilder(doc);
        OMElement element = builder.getDocumentElement();
        neethiPolicy = PolicyEngine.getPolicy(element);
       
        WSPolicy wsPolicy = new WSPolicy();
        wsPolicy.setNeethiPolicy(neethiPolicy);
       
        // normalize the neethi tree so we can easily identify
        // the policy alternatives
        neethiPolicy.normalize(true);
       
        // top-level children of ExactlyOne are policy alternatives so
        // for each child create a policy model list and pull the
        // policies out
        for(Object alternative : neethiPolicy.getPolicyComponents()) {
            List<Object> assertions = new ArrayList<Object>();
            readPolicyAssertions(assertions, (PolicyComponent)alternative, context);
            wsPolicy.getPolicyAssertions().add(assertions);
        }
              
       
        return wsPolicy;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

                break;
            }
        }
        assertNotNull(artifact);
        Assert.assertTrue(artifact instanceof WSPolicy);
        WSPolicy policy = (WSPolicy) artifact;
        Assert.assertTrue(policy.getNeethiPolicy().getAlternatives().hasNext());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

        XMLDocumentStreamReader doc = new XMLDocumentStreamReader(reader);
        StAXOMBuilder builder = new StAXOMBuilder(doc);
        OMElement element = builder.getDocumentElement();
        neethiPolicy = PolicyEngine.getPolicy(element);
       
        WSPolicy wsPolicy = new WSPolicy();
        wsPolicy.setNeethiPolicy(neethiPolicy);
       
        // normalize the neethi tree so we can easily identify
        // the policy alternatives
        neethiPolicy.normalize(true);
       
        // top-level children of ExactlyOne are policy alternatives so
        // for each child create a policy model list and pull the
        // policies out
        for(Object alternative : neethiPolicy.getPolicyComponents()) {
            List<Object> assertions = new ArrayList<Object>();
            readPolicyAssertions(assertions, (PolicyComponent)alternative, context);
            wsPolicy.getPolicyAssertions().add(assertions);
        }
              
       
        return wsPolicy;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

                break;
            }
        }
        assertNotNull(artifact);
        Assert.assertTrue(artifact instanceof WSPolicy);
        WSPolicy policy = (WSPolicy) artifact;
        Assert.assertTrue(policy.getNeethiPolicy().getAlternatives().hasNext());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.wspolicy.WSPolicy

        XMLDocumentStreamReader doc = new XMLDocumentStreamReader(reader);
        StAXOMBuilder builder = new StAXOMBuilder(doc);
        OMElement element = builder.getDocumentElement();
        neethiPolicy = PolicyEngine.getPolicy(element);
       
        WSPolicy wsPolicy = new WSPolicy();
        wsPolicy.setNeethiPolicy(neethiPolicy);
       
        // normalize the neethi tree so we can easily identify
        // the policy alternatives
/*  Messes up the hierarchy if rampart config policies included     
        try {
            neethiPolicy.normalize(true);
        } catch (UnsupportedOperationException ex){
            // RampartConfig policies don't support this yet
        }
*/       
       
        // top-level children of ExactlyOne are policy alternatives so
        // for each child create a policy model list and pull the
        // policies out
        for(Object alternative : neethiPolicy.getPolicyComponents()) {
            List<Object> assertions = new ArrayList<Object>();
            readPolicyAssertions(assertions, (PolicyComponent)alternative, context);
            wsPolicy.getPolicyAssertions().add(assertions);
        }
              
       
        return wsPolicy;
    }
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.