subParam.setAliasesDereferencingMethod( IBrowserConnection.DEREFERENCE_ALIASES_NEVER );
subParam.setReferralsHandlingMethod( IBrowserConnection.HANDLE_REFERRALS_IGNORE );
subParam.setReturningAttributes( new String[]
{ IAttribute.OBJECTCLASS_ATTRIBUTE, IAttribute.REFERRAL_ATTRIBUTE } );
subParam.setCountLimit( 100 );
ISearch search = new Search( entry.getBrowserConnection(), subParam );
entry.getBrowserConnection().search( search, monitor );
ISearchResult[] srs = search.getSearchResults();
for ( int i = 0; !monitor.isCanceled() && srs != null && i < srs.length; i++ )
{
IEntry childEntry = srs[i].getEntry();
numberOfDeletedEntries = this.deleteEntryRecursive( childEntry, true, numberOfDeletedEntries,
monitor );
numberInBatch++;
}
}
while ( numberInBatch > 0 && !monitor.isCanceled() && !monitor.errorsReported() );
if ( !monitor.isCanceled() && !monitor.errorsReported() )
{
// check for referrals
if ( !refInitialized )
{
SearchParameter param = new SearchParameter();
param.setSearchBase( entry.getDn() );
param.setFilter( ISearch.FILTER_TRUE );
param.setScope( ISearch.SCOPE_OBJECT );
param.setAliasesDereferencingMethod( IBrowserConnection.DEREFERENCE_ALIASES_NEVER );
param.setReferralsHandlingMethod( IBrowserConnection.HANDLE_REFERRALS_IGNORE );
param.setReturningAttributes( new String[]
{ IAttribute.OBJECTCLASS_ATTRIBUTE, IAttribute.REFERRAL_ATTRIBUTE } );
ISearch search = new Search( entry.getBrowserConnection(), param );
entry.getBrowserConnection().search( search, monitor );
ISearchResult[] srs = search.getSearchResults();
if ( !monitor.isCanceled() && srs != null && srs.length == 1 )
{
entry = srs[0].getEntry();
}
}