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
460461462463464465466467468469470
aciContext.setAttributeType( CN_AT ); aciContext.setEntry( entry ); assertEquals( 1, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null ).size() ); entry.removeAttributes( "cn" ); aciContext = new AciContext( null, null ); aciContext.setAciTuples( tuples ); aciContext.setUserDn( USER_NAME ); aciContext.setAttributeType( CN_AT );
11601161116211631164116511661167116811691170
return; } } remoteEntry.removeAttributes( MOD_IGNORE_AT ); localEntry.removeAttributes( MOD_IGNORE_AT ); List<Modification> mods = new ArrayList<Modification>(); Iterator<Attribute> itr = localEntry.iterator(); while ( itr.hasNext() )
779780781782783784785786787788789
// We may have to remove the attribute or only some values if ( attribute.size() == 0 ) { // No value : we have to remove the entire attribute tempEntry.removeAttributes( attributeType ); } else { currentAttribute = tempEntry.get( attributeType );
805806807808809810811812813814815
// If the current attribute is empty, we have to remove // it from the entry if ( currentAttribute.size() == 0 ) { tempEntry.removeAttributes( attributeType ); } } break;
835836837838839840841842843844845
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
841842843844845846847848849850851
} 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 );
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 ); } /**