Removes the attribute with the specified AttributeTypes.
The removed attribute are returned by this method.
If there is no attribute with the specified AttributeTypes, the return value is null.
null
275276277278279280281282283284285
case REMOVE_ATTRIBUTE: Attribute toBeRemoved = mod.getAttribute(); if ( toBeRemoved.size() == 0 ) { targetEntry.removeAttributes( id ); } else { Attribute existing = targetEntry.get( id );
216217218219220221222223224225226
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 ) {
321322323324325326327328329330331
if ( suffixEntry != null ) { Entry entry = master.get( suffixId ); // Don't write the EntryDN attribute entry.removeAttributes( ENTRY_DN_AT ); entry.setDn( suffixDn ); appendLdif( entry );
361362363364365366367368369370371
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++;
314315316317318319320321322323324
// Get the modified entry and store it in the context for post usage Entry modifiedEntry = fetch( id, modifyContext.getDn() ); modifyContext.setAlteredEntry( modifiedEntry ); // Remove the EntryDN modifiedEntry.removeAttributes( ENTRY_DN_AT ); // just overwrite the existing file Dn dn = modifyContext.getDn(); // And write it back on disk
33463347334833493350335133523353335433553356
Attribute attrSN = new DefaultAttribute( atSN, "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2 ); entry.put( attrOC, attrCN, attrSN, attrPWD ); entry.removeAttributes( atCN, atSN ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); }
33683369337033713372337333743375337633773378
Attribute attrSN = new DefaultAttribute( atSN, "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( atPwd, 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" );
33733374337533763377337833793380338133823383
entry.removeAttributes( "CN", "SN" ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( "l" ); entry.removeAttributes( ( String ) null ); }
33743375337633773378337933803381338233833384
assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( "l" ); entry.removeAttributes( ( String ) null ); } /**
33753376337733783379338033813382338333843385
assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( "l" ); entry.removeAttributes( ( String ) null ); } /** * Test method for remove( String, byte[]... )