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

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


                    else
                    {
                        if ( attribute.size() == 0 )
                        {
                            // Remove the attribute from the entry
                            tempEntry.removeAttributes( attributeType );
                        }
                        else
                        {
                            // Replace the existing values with the new values
                            // This is done by removing the Attribute
View Full Code Here


                        }
                        else
                        {
                            // Replace the existing values with the new values
                            // This is done by removing the Attribute
                            tempEntry.removeAttributes( attributeType );

                            // Create the new Attribute
                            Attribute newAttribute = createNewAttribute( attribute );

                            tempEntry.put( newAttribute );
View Full Code Here

                Entry modifiedEntry = super.modify( modifyContext.getDn(),
                    modifyContext.getModItems().toArray( new Modification[]
                        {} ) );
               
                // Remove the EntryDN
                modifiedEntry.removeAttributes( ENTRY_DN_AT );

                modifyContext.setAlteredEntry( modifiedEntry );
            }
            catch ( Exception e )
            {
View Full Code Here

                if ( suffixEntry != null )
                {
                    Entry entry = master.get( suffixId );
                   
                    // Don't write the EntryDN attribute
                    entry.removeAttributes( ENTRY_DN_AT );
                   
                    entry.setDn( suffixDn );

                    appendLdif( entry );
View Full Code Here

            IndexEntry<ParentIdAndRdn, String> element = cursor.get();
            String childId = element.getId();
            Entry entry = fetch( childId );
           
            // Remove the EntryDn
            entry.removeAttributes( SchemaConstants.ENTRY_DN_AT );

            appendLdif( entry );

            countChildren++;
View Full Code Here

        // Now remove the ObjectClass attribute if it has not been requested
        if ( ( lookupContext.getReturningAttributes() != null ) && ( lookupContext.getReturningAttributes().size() != 0 ) &&
            ( ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ) != null )
            && ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ).size() == 0 ) ) )
        {
            serverEntry.removeAttributes( SchemaConstants.OBJECT_CLASS_AT );
        }

        return serverEntry;
    }
View Full Code Here

        Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" );
        Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 );

        entry.put( attrOC, attrCN, attrSN, attrPWD );

        entry.removeAttributes( "CN", "SN" );

        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );

        entry.removeAttributes( "badId" );
View Full Code Here

        entry.removeAttributes( "CN", "SN" );

        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );

        entry.removeAttributes( "badId" );

        entry.removeAttributes( ( String ) null );
    }

View Full Code Here

        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );

        entry.removeAttributes( "badId" );

        entry.removeAttributes( ( String ) null );
    }


    /**
     * Test method for remove( EntryAttribute... )
View Full Code Here

        entry.add( "userCertificate;binary", Strings.getBytesUtf8( "secret" ) );
        assertTrue( entry.containsAttribute( "userCertificate;binary" ) );
        assertTrue( entry.containsAttribute( "userCertificate" ) );

        entry.removeAttributes( "userCertificate;binary" );
        assertFalse( entry.containsAttribute( "userCertificate;binary" ) );
        assertFalse( entry.containsAttribute( "userCertificate" ) );

        entry.add( "userCertificate", Strings.getBytesUtf8( "secret" ) );
        assertTrue( entry.containsAttribute( "userCertificate;binary" ) );
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.