Package org.apache.neethi

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


                issuedToken.setIssuerMex(issuerMex);
            } else if (SPConstants.REQUEST_SECURITY_TOKEN_TEMPLATE.equals(ln)) {
                issuedToken.setRstTemplate(child);
            } else if (org.apache.neethi.Constants.ELEM_POLICY.equals(ln)) {
                Policy policy = builder.getPolicy(child);
                policy = (Policy)policy.normalize(builder.getPolicyRegistry(), false);

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


            ExactlyOne ea = new ExactlyOne();
            p.addPolicyComponent(ea);
            All all = new All();
            all.addPolicyComponent(token);
            ea.addPolicyComponent(all);
            PolicyComponent pc = p.normalize(builder.getPolicyRegistry(), true);
            if (pc instanceof Policy) {
                return (Policy)pc;
            } else {
                p = new Policy();
                p.addPolicyComponent(pc);
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 iterator = policy.getAlternatives(); iterator.hasNext();) {
            transportToken.setToken((Token)(((List)iterator.next()).get(0)));
            break; // since there should be only one alternative
        }
View Full Code Here

        RecipientSignatureToken recipientSignatureToken = new RecipientSignatureToken(consts, builder);
        recipientSignatureToken.setOptional(PolicyConstants.isOptional(element));
        recipientSignatureToken.setIgnorable(PolicyConstants.isIgnorable(element));

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

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

        InitiatorToken initiatorToken = new InitiatorToken(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 iterator = policy.getAlternatives(); iterator.hasNext();) {
            processAlternative((List)iterator.next(), initiatorToken);
            break; // TODO process all the token that must be set ..
        }
View Full Code Here

       
       
        ProtectionToken protectionToken = new ProtectionToken(consts, builder);

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

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

        RecipientEncryptionToken recipientEncryptionToken = new RecipientEncryptionToken(consts, builder);
        recipientEncryptionToken.setOptional(PolicyConstants.isOptional(element));
        recipientEncryptionToken.setIgnorable(PolicyConstants.isIgnorable(element));

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

        for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
            processAlternative((List)iterator.next(), recipientEncryptionToken);
            break; // TODO process all the token that must be set ..
        }
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(null, true)).andReturn(merged);
       
        control.replay();
        EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, engine, true, null);
        epi.initializePolicy();
        assertSame(merged, epi.getPolicy());
View Full Code Here

        p1.addAssertion(mockAssertion(aqn1, 5, true));
       
        EndpointPolicyImpl epi = new TestEndpointPolicy();
        control.replay();
       
        epi.setPolicy((Policy)p1.normalize(true));
               
        Policy ep = epi.updatePolicy(emptyPolicy).getPolicy();
       
        List<ExactlyOne> pops =
            CastUtils.cast(ep.getPolicyComponents(), ExactlyOne.class);
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 iterator = policy.getAlternatives(); iterator.hasNext();) {
            processAlternative((List)iterator.next(), recipientToken);

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