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
99100101102103104105106107108109
case REMOVE_ATTRIBUTE: Attribute toBeRemoved = mod.getAttribute(); if ( toBeRemoved.size() == 0 ) { targetEntry.removeAttributes( id ); } else { existing = targetEntry.get( id );
765766767768769770771772773774775
{ updateRdnIdx( parentId, ADD_CHILD, 0 ); } // Remove the EntryDN attribute entry.removeAttributes( ENTRY_DN_AT ); // And finally add the entry into the master table master.put( id, entry ); } finally
12091210121112121213121412151216121712181219
} updateCsnIndex( entry, id ); // Remove the EntryDN entry.removeAttributes( ENTRY_DN_AT ); master.put( id, entry ); if ( isSyncOnWrite.get() ) {
33533354335533563357335833593360336133623363
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" ) ); }
33753376337733783379338033813382338333843385
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" );
33803381338233833384338533863387338833893390
entry.removeAttributes( "CN", "SN" ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( "l" ); entry.removeAttributes( ( String ) null ); }
33813382338333843385338633873388338933903391
assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( "l" ); entry.removeAttributes( ( String ) null ); } /**
33823383338433853386338733883389339033913392
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[]... )
25362537253825392540254125422543254425452546
assertEquals( 1, entry.size() ); assertNotNull( entry.get( "domainComponent" ) ); assertEquals( 1, entry.get( "domainComponent" ).size() ); assertNotNull( entry.get( "domainComponent" ).get() ); assertNull( entry.get( "domainComponent" ).get().getValue() ); entry.removeAttributes( "dc" ); replaced = entry.put( "DC", strValue3 ); assertNull( replaced ); assertEquals( 1, entry.size() ); assertNotNull( entry.get( "dc" ) );