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

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


    @Test
    public void testMaxValueCount() throws Exception
    {
        Collection<MaxValueCountItem> mvcItems = new ArrayList<MaxValueCountItem>();
        mvcItems.add( new MaxValueCountItem( "cn", 3 ) );
        Collection<ACITuple> tuples = getTuples( new ProtectedItem.MaxValueCount( mvcItems ) );

        // Test wrong scope
        assertEquals( 0, filterA.filter( null, tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
            "cn", null, null, null, null ).size() );
View Full Code Here


                }

                ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
                for ( Iterator<MaxValueCountItem> j = mvc.iterator(); j.hasNext(); )
                {
                    MaxValueCountItem mvcItem = j.next();
                   
                    if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName( mvcItem.getAttributeType() ) ) )
                    {
                        return true;
                    }
                }
            }
View Full Code Here

    private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, ServerEntry entryView ) throws NamingException
    {
        for ( Iterator<ProtectedItem.MaxValueCountItem> k = mvc.iterator(); k.hasNext(); )
        {
            MaxValueCountItem mvcItem = k.next();
            if ( attrId.equalsIgnoreCase( mvcItem.getAttributeType() ) )
            {
                EntryAttribute attr = entryView.get( attrId );
                int attrCount = attr == null ? 0 : attr.size();
               
                if ( attrCount > mvcItem.getMaxCount() )
                {
                    return true;
                }
            }
        }
View Full Code Here

    @Test
    public void testMaxValueCount() throws Exception
    {
        Collection<MaxValueCountItem> mvcItems = new ArrayList<MaxValueCountItem>();
        mvcItems.add( new MaxValueCountItem( "cn", 3 ) );
        Collection<ACITuple> tuples = getTuples( new ProtectedItem.MaxValueCount( mvcItems ) );

        // Test wrong scope
        assertEquals( 0, filterA.filter( null, tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
            "cn", null, null, null, null ).size() );
View Full Code Here

                }

                ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
                for ( Iterator<MaxValueCountItem> j = mvc.iterator(); j.hasNext(); )
                {
                    MaxValueCountItem mvcItem = j.next();
                   
                    if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName( mvcItem.getAttributeType() ) ) )
                    {
                        return true;
                    }
                }
            }
View Full Code Here

    private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, ServerEntry entryView ) throws NamingException
    {
        for ( Iterator<ProtectedItem.MaxValueCountItem> k = mvc.iterator(); k.hasNext(); )
        {
            MaxValueCountItem mvcItem = k.next();
            if ( attrId.equalsIgnoreCase( mvcItem.getAttributeType() ) )
            {
                EntryAttribute attr = entryView.get( attrId );
                int attrCount = attr == null ? 0 : attr.size();
               
                if ( attrCount > mvcItem.getMaxCount() )
                {
                    return true;
                }
            }
        }
View Full Code Here

                }

                ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
                for ( Iterator<MaxValueCountItem> j = mvc.iterator(); j.hasNext(); )
                {
                    MaxValueCountItem mvcItem = j.next();
                    if ( oid.equals( oidRegistry.getOid( mvcItem.getAttributeType() ) ) )
                    {
                        return true;
                    }
                }
            }
View Full Code Here

    private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, ServerEntry entryView ) throws NamingException
    {
        for ( Iterator<ProtectedItem.MaxValueCountItem> k = mvc.iterator(); k.hasNext(); )
        {
            MaxValueCountItem mvcItem = k.next();
            if ( attrId.equalsIgnoreCase( mvcItem.getAttributeType() ) )
            {
                EntryAttribute attr = entryView.get( attrId );
                int attrCount = attr == null ? 0 : attr.size();
               
                if ( attrCount > mvcItem.getMaxCount() )
                {
                    return true;
                }
            }
        }
View Full Code Here


    @Test public void testMaxValueCount() throws Exception
    {
        Collection<MaxValueCountItem> mvcItems = new ArrayList<MaxValueCountItem>();
        mvcItems.add( new MaxValueCountItem( "cn", 3 ) );
        Collection<ACITuple> tuples = getTuples( new ProtectedItem.MaxValueCount( mvcItems ) );

        // Test wrong scope
        assertEquals( 0, filterA.filter( null, tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
            "cn", null, null, null, null ).size() );
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

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.