Package org.apache.neethi

Examples of org.apache.neethi.Policy.normalize()


                    SP12Constants.INSTANCE,
                    builder);
        }

        Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
        policy = policy.normalize(builder.getPolicyRegistry(), false);

        for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator.hasNext();) {
            processAlternative(iterator.next(), supportingToken);
            /*
             * for the moment we will say there should be only one alternative
View Full Code Here


    public Assertion build(OMElement element, AssertionBuilderFactory factory)
            throws IllegalArgumentException {
        Wss11 wss11 = new Wss11(SPConstants.SP_V12);

        Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
        policy = (Policy) policy.normalize(false);

        for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
            processAlternative((List) iterator.next(), wss11);
            /*
             * since there should be only one alternative
View Full Code Here

    public Assertion build(OMElement element, AssertionBuilderFactory factory)
            throws IllegalArgumentException {
        Wss11 wss11 = new Wss11(SPConstants.SP_V11);

        Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
        policy = (Policy) policy.normalize(false);

        for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
            processAlternative((List) iterator.next(), wss11);
            /*
             * since there should be only one alternative
View Full Code Here

        EasyMock.expect(engine.getAggregatedServicePolicy(si)).andReturn(sp);
        Policy ep = control.createMock(Policy.class);
        EasyMock.expect(engine.getAggregatedEndpointPolicy(ei)).andReturn(ep);
        Policy merged = control.createMock(Policy.class);
        EasyMock.expect(sp.merge(ep)).andReturn(merged);
        EasyMock.expect(merged.normalize(true)).andReturn(merged);
       
        control.replay();
        EndpointPolicyImpl epi = new EndpointPolicyImpl();
        epi.initialisePolicy(ei, engine);
        assertSame(merged, epi.getPolicy());
View Full Code Here

        Policy p = p1.merge(p2);
        System.out.println("p1 merged with p2:");
        PolicyUtils.printPolicyComponent(p);
       
        System.out.println("normalised merge result:");
        PolicyUtils.printPolicyComponent(p.normalize(true));
       
        p = p1.merge(p3);
        System.out.println("p1 merged with p3:");
        PolicyUtils.printPolicyComponent(p);
       
View Full Code Here

        p = p1.merge(p3);
        System.out.println("p1 merged with p3:");
        PolicyUtils.printPolicyComponent(p);
       
        System.out.println("normalised merge result:");
        PolicyUtils.printPolicyComponent(p.normalize(true));   
    }
   
    @Test
    @Ignore
    public void testNormalisePrimitives() {
View Full Code Here

        Policy p = p1.merge(p2);
        System.out.println("p1 merge p2:");
        PolicyUtils.printPolicyComponent(p);
        System.out.println();
        System.out.println("normalised merge:");
        PolicyUtils.printPolicyComponent(p.normalize(true));
        System.out.println();
    }
   
    Policy getOneAssertion() {
        String uri = "http://www.w3.org/2007/01/addressing/metadata";
View Full Code Here

   

        RecipientToken recipientToken = new RecipientToken(consts, builder);

        Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
        policy = (Policy)policy.normalize(builder.getPolicyRegistry(), false);

        for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator.hasNext();) {
            processAlternative(iterator.next(), recipientToken);

            /*
 
View Full Code Here

        InitiatorEncryptionToken initiatorToken = new InitiatorEncryptionToken(consts, builder);
        initiatorToken.setOptional(PolicyConstants.isOptional(element));
        initiatorToken.setIgnorable(PolicyConstants.isIgnorable(element));

        Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
        policy = (Policy)policy.normalize(builder.getPolicyRegistry(), false);

        for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator.hasNext();) {
            processAlternative(iterator.next(), initiatorToken);
            break; // TODO process all the token that must be set ..
        }
View Full Code Here

       
        TransportToken transportToken = new TransportToken(consts, builder);

        Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
        policy = (Policy)policy.normalize(builder.getPolicyRegistry(), false);

        for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator.hasNext();) {
            transportToken.setToken((Token)((iterator.next()).get(0)));
            break; // since there should be only one alternative
        }
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.