Package org.apache.directory.api.ldap.model.entry

Examples of org.apache.directory.api.ldap.model.entry.Entry.containsAttribute()


        Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, ( byte[] ) null, BYTES2 );

        entry.put( attrPWD );
        assertTrue( entry.remove( atPwd, ( byte[] ) null ) );
        assertTrue( entry.remove( atPwd, BYTES1, BYTES2 ) );
        assertFalse( entry.containsAttribute( atPwd ) );

        entry.add( atPwd, BYTES1, ( byte[] ) null, BYTES2 );
        assertTrue( entry.remove( atPwd, ( byte[] ) null ) );
        assertEquals( 2, entry.get( atPwd ).size() );
        assertFalse( entry.contains( atPwd, ( byte[] ) null ) );
View Full Code Here


        Attribute attrCN = new DefaultAttribute( atEMail, "test1", ( String ) null, "test2" );

        entry.put( attrCN );
        assertTrue( entry.remove( atEMail, ( String ) null ) );
        assertTrue( entry.remove( atEMail, "test1", "test2" ) );
        assertFalse( entry.containsAttribute( atEMail ) );

        entry.add( atEMail, "test1", ( String ) null, "test2" );
        assertTrue( entry.remove( atEMail, ( String ) null ) );
        assertEquals( 2, entry.get( atEMail ).size() );
        assertFalse( entry.contains( atEMail, ( String ) null ) );
View Full Code Here

            }

            entryCsnIdx.add( entryCsn.getString(), id );

            // Update the AdministrativeRole index, if needed
            if ( entry.containsAttribute( ADMINISTRATIVE_ROLE_AT ) )
            {
                // We may have more than one role
                Attribute adminRoles = entry.get( ADMINISTRATIVE_ROLE_AT );

                for ( Value<?> value : adminRoles )
View Full Code Here

            // Update the rdn, oneLevel, subLevel, and entryCsn indexes
            entryCsnIdx.drop( entry.get( ENTRY_CSN_AT ).getString(), id );

            // Update the AdministrativeRole index, if needed
            if ( entry.containsAttribute( ADMINISTRATIVE_ROLE_AT ) )
            {
                // We may have more than one role
                Attribute adminRoles = entry.get( ADMINISTRATIVE_ROLE_AT );

                for ( Value<?> value : adminRoles )
View Full Code Here

                // always store original entry in the cache
                addToCache( id, entry );

                entry = new ClonedServerEntry( entry );

                if ( !entry.containsAttribute( ENTRY_DN_AT ) )
                {
                    entry.add( ENTRY_DN_AT, dn.getName() );
                }

                return entry;
View Full Code Here

            }

            entryCsnIdx.add( entryCsn.getString(), id );

            // Update the AdministrativeRole index, if needed
            if ( entry.containsAttribute( ADMINISTRATIVE_ROLE_AT ) )
            {
                // We may have more than one role
                Attribute adminRoles = entry.get( ADMINISTRATIVE_ROLE_AT );

                for ( Value<?> value : adminRoles )
View Full Code Here

            // Update the rdn, oneLevel, subLevel, and entryCsn indexes
            entryCsnIdx.drop( entry.get( ENTRY_CSN_AT ).getString(), id );

            // Update the AdministrativeRole index, if needed
            if ( entry.containsAttribute( ADMINISTRATIVE_ROLE_AT ) )
            {
                // We may have more than one role
                Attribute adminRoles = entry.get( ADMINISTRATIVE_ROLE_AT );

                for ( Value<?> value : adminRoles )
View Full Code Here

            Entry entry = lookupCache( id );

            if ( entry != null )
            {
                // Replace the entry's DN with the provided one
                if ( entry.containsAttribute( ENTRY_DN_AT ) )
                {
                    entry.removeAttributes( ENTRY_DN_AT );
                }

                entry.add( ENTRY_DN_AT, dn.getName() );
View Full Code Here

            if ( entry != null )
            {
                // We have to store the DN in this entry
                entry.setDn( dn );

                if ( !entry.containsAttribute( ENTRY_DN_AT ) )
                {
                    entry.add( ENTRY_DN_AT, dn.getName() );
                }

                addToCache( id, entry );
View Full Code Here

        Entry entry = connection.lookup( "uid=admin,ou=system", "name" );
        assertNotNull( entry );

        assertEquals( 2, entry.size() );
        assertTrue( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.contains( "cn", "system administrator" ) );
        assertTrue( entry.contains( "sn", "administrator" ) );

        connection.close();
    }
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.