Package org.apache.ldap.common.aci

Examples of org.apache.ldap.common.aci.ACITuple


            return tuples;
        }

        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            if( !tuple.isGrant() )
            {
                continue;
            }

            for( Iterator j = tuple.getProtectedItems().iterator(); j.hasNext(); )
            {
                ProtectedItem item = ( ProtectedItem ) j.next();
                if( item instanceof ProtectedItem.MaxValueCount )
                {
                    ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
View Full Code Here


        int immSubCount = -1;

        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            if( !tuple.isGrant() )
            {
                continue;
            }

            for( Iterator j = tuple.getProtectedItems().iterator(); j.hasNext(); )
            {
                ProtectedItem item = ( ProtectedItem ) j.next();
                if( item instanceof ProtectedItem.MaxImmSub )
                {
                    if( immSubCount < 0 )
View Full Code Here

        // If there are any tuples matching the requestor with UserClasses
        // element name or thisEntry, discard all other tuples.
        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
            {
                UserClass userClass = ( UserClass ) j.next();
                if( userClass instanceof UserClass.Name ||
                    userClass instanceof UserClass.ThisEntry )
                {
                    filteredTuples.add( tuple );
                    break;
                }
            }
        }

        if( filteredTuples.size() > 0 )
        {
            return filteredTuples;
        }

        // Otherwise if there are any tuples matching UserGroup,
        // discard all other tuples.
        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
            {
                UserClass userClass = ( UserClass ) j.next();
                if( userClass instanceof UserClass.UserGroup )
                {
                    filteredTuples.add( tuple );
                    break;
                }
            }
        }

        if( filteredTuples.size() > 0 )
        {
            return filteredTuples;
        }

        // Otherwise if there are any tuples matching subtree,
        // discard all other tuples.
        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
            {
                UserClass userClass = ( UserClass ) j.next();
                if( userClass instanceof UserClass.Subtree )
                {
                    filteredTuples.add( tuple );
View Full Code Here

        // If the protected item is an attribute and there are tuples that
        // specify the attribute type explicitly, discard all other tuples.
        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            for( Iterator j = tuple.getProtectedItems().iterator(); j.hasNext(); )
            {
                ProtectedItem item = ( ProtectedItem ) j.next();
                if( item instanceof ProtectedItem.AttributeType ||
                    item instanceof ProtectedItem.AllAttributeValues ||
                    item instanceof ProtectedItem.SelfValue ||
                    item instanceof ProtectedItem.AttributeValue )
                {
                    filteredTuples.add( tuple );
                    break;
                }
            }
        }

        if( filteredTuples.size() > 0 )
        {
            return filteredTuples;
        }

        // If the protected item is an attribute value, and there are tuples
        // that specify the attribute value explicitly, discard all other tuples.
        // A protected item which is a rangeOfValues is to be treated as
        // specifying an attribute value explicitly.
        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            for( Iterator j = tuple.getProtectedItems().iterator(); j.hasNext(); )
            {
                ProtectedItem item = ( ProtectedItem ) j.next();
                if( item instanceof ProtectedItem.RangeOfValues )
                {
                    filteredTuples.add( tuple );
View Full Code Here

        int maxPrecedence = -1;

        // Find the maximum precedence for all tuples.
        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            if( tuple.getPrecedence() > maxPrecedence )
            {
                maxPrecedence = tuple.getPrecedence();
            }
        }

        // Remove all tuples whose precedences are not the maximum one.
        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            if( tuple.getPrecedence() != maxPrecedence )
            {
                i.remove();
            }
        }
View Full Code Here

            return tuples;
        }

        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            if( !tuple.isGrant() )
            {
                continue;
            }

            if( isRemovable( tuple, attrId, attrValue, entry ) )
View Full Code Here

            return tuples;
        }

        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            if( tuple.isGrant() )
            {
                if( !isRelated( userGroupNames, userName, userEntry, entryName, tuple.getUserClasses() ) ||
                        authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) < 0 )
                {
                    i.remove();
                }
            }
            else // Denials
            {
                if( !isRelated( userGroupNames, userName, userEntry, entryName, tuple.getUserClasses() ) &&
                        authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) >= 0 )
                {
                    i.remove();
                }
            }
        }
View Full Code Here

            return tuples;
        }

        for( Iterator i = tuples.iterator(); i.hasNext(); )
        {
            ACITuple tuple = ( ACITuple ) i.next();
            if( !isRelated( tuple, scope, userName, entryName, attrId, attrValue, entry ) )
            {
                i.remove();
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.ldap.common.aci.ACITuple

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.