directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <elecha...@gmail.com>
Subject doSyncSearch recursive code
Date Mon, 03 Dec 2012 00:00:07 GMT
Hi !

I wonder why we do something like :

private void doSyncSearch( SynchronizationModeEnum syncType, boolean
reloadHint ) throws Exception
{
    ...
    SearchFuture sf = connection.searchAsync( searchRequest );
    ...
    while ( !( resp instanceof SearchResultDone ) && !sf.isCancelled()
&& !disconnected )
    {
        ...
    }

    ...
    if ( resultCode == ResultCodeEnum.E_SYNC_REFRESH_REQUIRED )
    {
        ...
        doSyncSearch( syncType, true );
    }
}

I understand that if we get a E_SYNC_REFRESH_REQUIRED result, then we
must void the cookie, delete all the entries we locally have under the
baseDN and redo a sync search, but here, we are at risk of calling the
method over and over...

Can't we use an encapsulating while() ?

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com 


Mime
View raw message