Package org.apache.neethi

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


            } else if (policyElement.getFirstChildWithName(SP12Constants.REQUIRE_EXPLICIT_DERIVED_KEYS) != null) {
                x509Token.setExplicitDerivedKeys(true);
            }
           
            Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
            policy = (Policy) policy.normalize(false);

            for (Iterator iterator = policy.getAlternatives(); iterator
                    .hasNext();) {
                processAlternative((List) iterator.next(), x509Token);
               
View Full Code Here


        }
        if (getLayout() != null) {
            all.addPolicyComponent(getLayout());
        }
        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

            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

        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

                }
            } 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

            if (policyElement.getFirstChildWithName(SP11Constants.REQUIRE_DERIVED_KEYS) != null) {
                x509Token.setDerivedKeys(true);
            }
           
            Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
            policy = (Policy) policy.normalize(false);

            for (Iterator iterator = policy.getAlternatives(); iterator
                    .hasNext();) {
                processAlternative((List) iterator.next(), x509Token);
               
View Full Code Here

            } else if (policyElement.getFirstChildWithName(SP12Constants.REQUIRE_EXPLICIT_DERIVED_KEYS) != null) {
                x509Token.setExplicitDerivedKeys(true);
            }
           
            Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
            policy = (Policy) policy.normalize(false);

            for (Iterator iterator = policy.getAlternatives(); iterator
                    .hasNext();) {
                processAlternative((List) iterator.next(), x509Token);
               
View Full Code Here

                                                  SP11Constants.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

                foundRST = true;
                issuedToken.setRstTemplate(child);
            } else if (org.apache.neethi.Constants.ELEM_POLICY.equals(ln)) {
                foundPolicy = true;
                Policy policy = builder.getPolicy(child);
                policy = policy.normalize(builder.getPolicyRegistry(), false);

                for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator.hasNext();) {
                    processAlternative(iterator.next(), issuedToken);
                    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.