Package org.apache.directory.shared.ldap.aci.ProtectedItem

Examples of org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem


    @Test
    public void testMaxValueCount() throws Exception
    {
        Set<MaxValueCountElem> mvcItems = new HashSet<MaxValueCountElem>();
        mvcItems.add( new MaxValueCountElem( CN_AT, 3 ) );
        Collection<ACITuple> tuples = getTuples( new MaxValueCountItem( mvcItems ) );

        // Test wrong scope
        AciContext aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ENTRY, null ).size() );
        tuples = getTuples( new MaxValueCountItem( mvcItems ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE, null ).size() );

        tuples = getTuples( new MaxValueCountItem( mvcItems ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
View Full Code Here


        FULL_ENTRY.put( "cn", "1", "2", "3" );

        Set<MaxValueCountElem> mvcItems = new HashSet<MaxValueCountElem>();
        AttributeType cn = schemaManager.lookupAttributeTypeRegistry( "cn" );
        mvcItems.add( new MaxValueCountElem( cn, 2 ) );
        PROTECTED_ITEMS.add( new MaxValueCountItem( mvcItems ) );

        CN_AT = schemaManager.lookupAttributeTypeRegistry( "cn" );
    }
View Full Code Here

                if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
                {
                    continue;
                }

                MaxValueCountItem mvc = ( MaxValueCountItem ) item;

                for ( Iterator<MaxValueCountElem> j = mvc.iterator(); j.hasNext(); )
                {
                    MaxValueCountElem mvcItem = j.next();

                    if ( oid.equals( mvcItem.getAttributeType().getOid() ) )
                    {
View Full Code Here

            {
                ProtectedItem item = j.next();

                if ( item instanceof MaxValueCountItem )
                {
                    MaxValueCountItem mvc = ( MaxValueCountItem ) item;

                    if ( isRemovable( mvc, aciContext.getAttributeType(), aciContext.getEntryView() ) )
                    {
                        i.remove();
                        break;
View Full Code Here

        Set<MaxValueCountElem> colC = new HashSet<MaxValueCountElem>();
        colC.add( mvciB );
        colC.add( mvciC );
        colC.add( mvciD );

        maxValueCountA = new MaxValueCountItem( colA );
        maxValueCountACopy = new MaxValueCountItem( colA );
        maxValueCountB = new MaxValueCountItem( colB );
        maxValueCountC = new MaxValueCountItem( colC );
    }
View Full Code Here

    @Test
    public void testMaxValueCount() throws Exception
    {
        Set<MaxValueCountElem> mvcItems = new HashSet<MaxValueCountElem>();
        mvcItems.add( new MaxValueCountElem( CN_AT, 3 ) );
        Collection<ACITuple> tuples = getTuples( new MaxValueCountItem( mvcItems ) );

        // Test wrong scope
        AciContext aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
       
        assertEquals( 0, filterA.filter( aciContext, OperationScope.ENTRY, null ).size() );
        tuples = getTuples( new MaxValueCountItem( mvcItems ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
       
        assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE, null ).size() );

        tuples = getTuples( new MaxValueCountItem( mvcItems ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
View Full Code Here

        FULL_ENTRY.put( "cn", "1", "2", "3" );

        Set<MaxValueCountElem> mvcItems = new HashSet<MaxValueCountElem>();
        AttributeType cn = schemaManager.lookupAttributeTypeRegistry( "cn" );
        mvcItems.add( new MaxValueCountElem( cn, 2 ) );
        PROTECTED_ITEMS.add( new MaxValueCountItem( mvcItems ) );
       
        CN_AT = schemaManager.lookupAttributeTypeRegistry( "cn" );
    }
View Full Code Here

                if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
                {
                    continue;
                }

                MaxValueCountItem mvc = ( MaxValueCountItem ) item;
               
                for ( Iterator<MaxValueCountElem> j = mvc.iterator(); j.hasNext(); )
                {
                    MaxValueCountElem mvcItem = j.next();
                   
                    if ( oid.equals( mvcItem.getAttributeType().getOid() ) )
                    {
View Full Code Here

            {
                ProtectedItem item = j.next();
               
                if ( item instanceof MaxValueCountItem )
                {
                    MaxValueCountItem mvc = ( MaxValueCountItem ) item;
                   
                    if ( isRemovable( mvc, aciContext.getAttributeType(), aciContext.getEntryView() ) )
                    {
                        i.remove();
                        break;
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem

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.