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 = directoryService.getDnFactory().create( suffix );
SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, suffixDn, referralFilter, searchControl );
searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
EntryFilteringCursor cursor = nexus.search( searchOperationContext );
try
{
// Move to the first entry in the cursor
cursor.beforeFirst();