SearchControls searchControl = new SearchControls();
searchControl.setReturningObjFlag( false );
searchControl.setSearchScope( SearchControls.SUBTREE_SCOPE );
CoreSession adminSession = directoryService.getAdminSession();
PartitionNexus nexus = directoryService.getPartitionNexus();
for ( String suffix:suffixes )
{
// We will store each entry's DN into the Referral tree
DN suffixDn = new DN( suffix );
suffixDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, suffixDn, referralFilter, searchControl );
searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
EntryFilteringCursor cursor = nexus.search( searchOperationContext );
// Move to the first entry in the cursor
cursor.beforeFirst();
while ( cursor.next() )