*/
private void doInitialRefresh( LdapSession session, SearchRequest request ) throws Exception
{
PROVIDER_LOG.debug( "Starting an initial refresh" );
SortRequest ctrl = ( SortRequest ) request.getControl( SortRequest.OID );
if ( ctrl != null )
{
PROVIDER_LOG
.warn( "Removing the received sort control from the syncrepl search request during initial refresh" );
request.removeControl( ctrl );
}
PROVIDER_LOG
.debug( "Adding sort control to sort the entries by entryDn attribute to preserve order of insertion" );
SortKey sk = new SortKey( SchemaConstants.ENTRY_DN_AT );
// matchingrule for "entryDn"
sk.setMatchingRuleId( "2.5.13.1" );
sk.setReverseOrder( true );
ctrl = new SortRequestControlImpl();
ctrl.addSortKey( sk );
request.addControl( ctrl );
String originalFilter = request.getFilter().toString();
InetSocketAddress address = ( InetSocketAddress ) session.getIoSession().getRemoteAddress();