// Sleep forever
//Thread.sleep( 3600000L );
// Now do a random search
SearchRequest searchRequest = new SearchRequestImpl();
searchRequest.setBase( new Dn( "dc=example,dc=com" ) );
searchRequest.setScope( SearchScope.SUBTREE );
searchRequest.addAttributes( "*" );
searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS );
long t0 = System.currentTimeMillis();
long t00 = 0L;
long tt0 = System.currentTimeMillis();
int nbIterations = 200000;
int count = 0;
Random random = new Random();
for ( int j = 0; j < nbIterations; j++ )
{
if ( j % 10000 == 0 )
{
long tt1 = System.currentTimeMillis();
System.out.println( j + ", " + ( tt1 - tt0 ) );
tt0 = tt1;
}
if ( j == 50000 )
{
t00 = System.currentTimeMillis();
}
searchRequest.setFilter( "(cn=user" + random.nextInt( 100000 ) + ")" );
SearchCursor cursor = connection.search( searchRequest );
while ( cursor.next() )
{