Package org.apache.neethi

Examples of org.apache.neethi.PolicyComponent


    private Assertion findCompatibleAssertion(Assertion assertion,
                                              Collection<? extends PolicyComponent> alt,
                                              boolean remove) {
        Iterator<? extends PolicyComponent> iterator = alt.iterator();
        while (iterator.hasNext()) {
            PolicyComponent a = iterator.next();
            if (a instanceof Assertion) {
                Assertion compatible = intersect(assertion, (Assertion)a);
                if (null != compatible) {
                    if (remove) {
                        iterator.remove();
View Full Code Here


        alt1 = new ArrayList<PolicyComponent>(alt1);
        alt2 = new ArrayList<PolicyComponent>(alt2);
       
        Iterator<? extends PolicyComponent> iterator = alt1.iterator();
        while (iterator.hasNext()) {
            PolicyComponent a1 = iterator.next();
            if (a1 instanceof Assertion) {
                Assertion assertion = findCompatibleAssertion((Assertion)a1, alt2, remove);
                if (assertion != null) {
                    if (remove) {
                        iterator.remove();
                    }
                    all.addPolicyComponent(assertion);
                } else if (!strict && ((Assertion)a1).isIgnorable()) {
                    all.addPolicyComponent(a1);
                } else if (strict || !((Assertion)a1).isIgnorable()) {
                    return null;
                }
            }
        }
        iterator = alt2.iterator();
        while (iterator.hasNext()) {
            PolicyComponent a2 = iterator.next();
            if (a2 instanceof Assertion) {
                Assertion assertion = findCompatibleAssertion((Assertion)a2, alt1, remove);
                if (assertion != null) {
                    all.addPolicyComponent(assertion);
                } else if (!strict && ((Assertion)a2).isIgnorable()) {
View Full Code Here

            PolicyOperator policyOperator = (PolicyOperator) policyComponent;
            List<PolicyComponent> policyComponents = policyOperator.getPolicyComponents();
            int alternative = 0;
            Iterator<PolicyComponent> policyComponentIterator = policyComponents.iterator();
            while (policyComponentIterator.hasNext()) {
                PolicyComponent curPolicyComponent = policyComponentIterator.next();
                if (policyOperator instanceof ExactlyOne) {
                    assertionStateMap.add(new HashMap<SecurityEventConstants.Event, Map<Assertion, List<Assertable>>>());
                    buildAssertionStateMap(curPolicyComponent, assertionStateMap, alternative++);
                } else {
                    buildAssertionStateMap(curPolicyComponent, assertionStateMap);
View Full Code Here

        if (policyComponent instanceof PolicyOperator) {
            PolicyOperator policyOperator = (PolicyOperator) policyComponent;
            List<PolicyComponent> policyComponents = policyOperator.getPolicyComponents();
            Iterator<PolicyComponent> policyComponentIterator = policyComponents.iterator();
            while (policyComponentIterator.hasNext()) {
                PolicyComponent curPolicyComponent = policyComponentIterator.next();
                buildAssertionStateMap(curPolicyComponent, assertionStateMap, alternative);
            }
        } else if (policyComponent instanceof AbstractSecurityAssertion) {
            AbstractSecurityAssertion abstractSecurityAssertion = (AbstractSecurityAssertion) policyComponent;
View Full Code Here

        if (arg1.size() != arg2.size()) {
            return false;
        }

        Iterator iterator = arg1.iterator();
        PolicyComponent assertion1;

        while (iterator.hasNext()) {
            assertion1 = (PolicyComponent) iterator.next();

            Iterator iterator2 = arg2.iterator();
            boolean match = false;
            PolicyComponent assertion2;

            while (iterator2.hasNext()) {
                assertion2 = (PolicyComponent) iterator2.next();
                if (compare(assertion1, assertion2)) {
                    match = true;
View Full Code Here

        if (arg1.size() != arg2.size()) {
            return false;
        }

        Iterator iterator = arg1.iterator();
        PolicyComponent assertion1;

        while (iterator.hasNext()) {
            assertion1 = (PolicyComponent) iterator.next();

            Iterator iterator2 = arg2.iterator();
            boolean match = false;
            PolicyComponent assertion2;

            while (iterator2.hasNext()) {
                assertion2 = (PolicyComponent) iterator2.next();
                if (compare(assertion1, assertion2)) {
                    match = true;
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

            buf.append(" (");
            buf.append((Assertion)pc);
            buf.append(")");
            nl(buf);
            if (pc instanceof NestedPrimitiveAssertion) {
                PolicyComponent nested = ((NestedPrimitiveAssertion)pc).getPolicy();
                level++;
                printPolicyComponent(nested, buf, level);
                level--;               
            }
        } else {
View Full Code Here

            buf.append(" (");
            buf.append((Assertion)pc);
            buf.append(")");
            nl(buf);
            if (pc instanceof PolicyContainingAssertion) {
                PolicyComponent nested = ((PolicyContainingAssertion)pc).getPolicy();
                level++;
                printPolicyComponent(nested, buf, level);
                level--;               
            }
        } else {
View Full Code Here

TOP

Related Classes of org.apache.neethi.PolicyComponent

Copyright © 2018 www.massapicom. 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.