private ReplicaEventLog convertEntryToReplica( Entry entry ) throws Exception
{
String id = entry.get( SchemaConstants.ADS_DS_REPLICA_ID ).getString();
ReplicaEventLog replica = new ReplicaEventLog( directoryService, Integer.parseInt( id ) );
NotificationCriteria searchCriteria = new NotificationCriteria();
String aliasMode = entry.get( SchemaConstants.ADS_REPL_ALIAS_DEREF_MODE ).getString();
searchCriteria.setAliasDerefMode( AliasDerefMode.getDerefMode( aliasMode ) );
String baseDn = entry.get( SchemaConstants.ADS_SEARCH_BASE_DN ).getString();
searchCriteria.setBase( new Dn( schemaManager, baseDn ) );
Attribute lastSentCsnAt = entry.get( SchemaConstants.ADS_REPL_LAST_SENT_CSN );
if ( lastSentCsnAt != null )
{
replica.setLastSentCsn( lastSentCsnAt.getString() );
}
String scope = entry.get( SchemaConstants.ADS_REPL_SEARCH_SCOPE ).getString();
int scopeIntVal = SearchScope.getSearchScope( scope );
searchCriteria.setScope( SearchScope.getSearchScope( scopeIntVal ) );
String filter = entry.get( SchemaConstants.ADS_REPL_SEARCH_FILTER ).getString();
searchCriteria.setFilter( filter );
replica.setSearchFilter( filter );
replica.setRefreshNPersist( Boolean.parseBoolean( entry.get( SchemaConstants.ADS_REPL_REFRESH_N_PERSIST ).getString() ) );
searchCriteria.setEventMask( EventType.ALL_EVENT_TYPES_MASK );
replica.setSearchCriteria( searchCriteria );
// explicitly mark the replica as not-dirty, cause we just loaded it from
// the store, this prevents updating the replica info immediately after loading
replica.setDirty( false );