SearchResult sr = new SearchResult( currentSearchResultEntry.getObjectName().toString(), null,
AttributeUtils.toAttributes( currentSearchResultEntry.getEntry() ) );
sr.setNameInNamespace( currentSearchResultEntry.getObjectName().toString() );
// Converting the SearchResult to a StudioSearchResult
StudioSearchResult ssr = new StudioSearchResult( sr, connection, false, null );
return ssr;
}
// Are we following referrals manually?
if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW_MANUALLY )
{
// Checking the current referral's URLs list
if ( ( currentReferralUrlsList != null ) && ( currentReferralUrlsList.size() > 0 ) )
{
resultEntryCounter++;
// Building an LDAP URL from the the url
LdapUrl url = new LdapUrl( currentReferralUrlsList.remove( 0 ) );
// Building the search result
SearchResult searchResult = new SearchResult( url.getDn().getName(), null,
new BasicAttributes(),
false );
searchResult.setNameInNamespace( url.getDn().getName() );
return new StudioSearchResult( searchResult, null, false, url );
}
}
// Are we following referrals automatically?
else if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW )
{
resultEntryCounter++;
return new StudioSearchResult( cursorNamingEnumeration.next(), connection, true, null );
}
return null;
}
catch ( Exception e )