// Let's instanciate the bean we need. The upper ObjectClass's name
// will be used to do that
Attribute objectClassAttr = entry.get( SchemaConstants.OBJECT_CLASS_AT );
ObjectClass objectClass = findObjectClass( objectClassAttr );
AdsBaseBean bean = createBean( objectClass );
// Now, read the AttributeTypes and store the values into the bean fields
// The MAY
Set<AttributeType> mays = getAllMays( objectClass );
LOG.debug( "Fetching the following MAY attributes : {}", dumpATs( mays ) );
readFields( bean, entry, mays, OPTIONNAL );
// The MUST
Set<AttributeType> musts = getAllMusts( objectClass );
LOG.debug( "Fetching the following MAY attributes : {}", dumpATs( musts ) );
readFields( bean, entry, musts, MANDATORY );
bean.setDn( entry.getDn() );
// Done, we can add the bean into the list
beans.add( bean );
}
while ( cursor.next() );