directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235326 [27/28] - in /directory/apacheds/trunk: jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partitio...
Date Tue, 24 Jan 2012 16:15:29 GMT
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java Tue Jan 24 16:15:05 2012
@@ -129,14 +129,14 @@ public class ReplicationConsumerImpl imp
     /** attributes on which modification should be ignored */
     private static final String[] MOD_IGNORE_AT = new String[]
         {
-            SchemaConstants.ENTRY_UUID_AT, 
-            SchemaConstants.ENTRY_CSN_AT, 
+            SchemaConstants.ENTRY_UUID_AT,
+            SchemaConstants.ENTRY_CSN_AT,
             SchemaConstants.MODIFIERS_NAME_AT,
-            SchemaConstants.MODIFY_TIMESTAMP_AT, 
-            SchemaConstants.CREATE_TIMESTAMP_AT, 
-            SchemaConstants.CREATORS_NAME_AT, 
-            SchemaConstants.ENTRY_PARENT_ID_AT 
-        };
+            SchemaConstants.MODIFY_TIMESTAMP_AT,
+            SchemaConstants.CREATE_TIMESTAMP_AT,
+            SchemaConstants.CREATORS_NAME_AT,
+            SchemaConstants.ENTRY_PARENT_ID_AT
+    };
 
     /** A thread used to refresh in refreshOnly mode */
     private RefresherThread refreshThread;
@@ -179,7 +179,7 @@ public class ReplicationConsumerImpl imp
             File cookieDir = new File( directoryservice.getInstanceLayout().getRunDirectory(), "cookies" );
             if ( !cookieDir.mkdir() )
             {
-                throw new IOException(I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, cookieDir ) );
+                throw new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, cookieDir ) );
             }
 
             cookieFile = new File( cookieDir, String.valueOf( config.getReplicaId() ) );
@@ -215,19 +215,19 @@ public class ReplicationConsumerImpl imp
         {
             String providerHost = config.getRemoteHost();
             int port = config.getRemotePort();
-            
+
             // Create a connection
             if ( connection == null )
             {
                 connection = new LdapNetworkConnection( providerHost, port );
                 connection.setTimeOut( -1L );
-                
-                if( config.isUseTls() )
+
+                if ( config.isUseTls() )
                 {
                     connection.getConfig().setTrustManagers( config.getTrustManager() );
                     connection.startTls();
                 }
-                
+
                 connection.addConnectionClosedEventListener( this );
             }
 
@@ -277,7 +277,7 @@ public class ReplicationConsumerImpl imp
 
         if ( !config.isChaseReferrals() )
         {
-            searchRequest.addControl( new ManageDsaITDecorator( directoryService.getLdapCodecService(), 
+            searchRequest.addControl( new ManageDsaITDecorator( directoryService.getLdapCodecService(),
                 new ManageDsaITImpl() ) );
         }
     }
@@ -287,12 +287,12 @@ public class ReplicationConsumerImpl imp
     {
         LOG.debug( "///////////////// handleSearchDone //////////////////" );
 
-        SyncDoneValue ctrl = (SyncDoneValue)searchDone.getControls().get( SyncDoneValue.OID );
+        SyncDoneValue ctrl = ( SyncDoneValue ) searchDone.getControls().get( SyncDoneValue.OID );
 
         if ( ( ctrl != null ) && ( ctrl.getCookie() != null ) )
         {
             syncCookie = ctrl.getCookie();
-            LOG.debug( "assigning cookie from sync done value control: " + Strings.utf8ToString(syncCookie) );
+            LOG.debug( "assigning cookie from sync done value control: " + Strings.utf8ToString( syncCookie ) );
             storeCookie();
         }
 
@@ -324,7 +324,7 @@ public class ReplicationConsumerImpl imp
             {
                 syncCookie = syncStateCtrl.getCookie();
                 LOG.debug( "assigning the cookie from sync state value control: "
-                    + Strings.utf8ToString(syncCookie) );
+                    + Strings.utf8ToString( syncCookie ) );
             }
 
             SyncStateTypeEnum state = syncStateCtrl.getSyncStateType();
@@ -334,14 +334,14 @@ public class ReplicationConsumerImpl imp
             // check to avoid conversion of UUID from byte[] to String
             if ( LOG.isDebugEnabled() )
             {
-                LOG.debug( "entryUUID = {}", Strings.uuidToString(syncStateCtrl.getEntryUUID()) );
+                LOG.debug( "entryUUID = {}", Strings.uuidToString( syncStateCtrl.getEntryUUID() ) );
             }
 
             switch ( state )
             {
                 case ADD:
                     Dn remoteDn = directoryService.getDnFactory().create( remoteEntry.getDn().getName() );
-                    
+
                     if ( !session.exists( remoteDn ) )
                     {
                         LOG.debug( "adding entry with dn {}", remoteDn );
@@ -359,13 +359,13 @@ public class ReplicationConsumerImpl imp
                 case MODIFY:
                     LOG.debug( "modifying entry with dn {}", remoteEntry.getDn().getName() );
                     modify( remoteEntry );
-                    
+
                     break;
 
                 case MODDN:
                     String entryUuid = Strings.uuidToString( syncStateCtrl.getEntryUUID() ).toString();
                     applyModDnOperation( remoteEntry, entryUuid );
-                    
+
                     break;
 
                 case DELETE:
@@ -374,7 +374,7 @@ public class ReplicationConsumerImpl imp
                     // ApacheDS replication provider sends a single delete event on the Dn of the moved branch
                     // so the branch needs to be recursively deleted here
                     deleteRecursive( remoteEntry.getDn(), null );
-                    
+
                     break;
 
                 case PRESENT:
@@ -412,7 +412,7 @@ public class ReplicationConsumerImpl imp
             {
                 return;
             }
-            
+
             SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( directoryService.getLdapCodecService() );
             SyncInfoValue syncInfoValue = ( SyncInfoValue ) decorator.decode( syncInfoBytes );
 
@@ -420,15 +420,15 @@ public class ReplicationConsumerImpl imp
 
             if ( cookie != null )
             {
-                LOG.debug( "setting the cookie from the sync info: " + Strings.utf8ToString(cookie) );
-                CONSUMER_LOG.debug( "setting the cookie from the sync info: " + Strings.utf8ToString(cookie) );
+                LOG.debug( "setting the cookie from the sync info: " + Strings.utf8ToString( cookie ) );
+                CONSUMER_LOG.debug( "setting the cookie from the sync info: " + Strings.utf8ToString( cookie ) );
                 syncCookie = cookie;
             }
 
             LOG.info( "refreshDeletes: " + syncInfoValue.isRefreshDeletes() );
 
             List<byte[]> uuidList = syncInfoValue.getSyncUUIDs();
-            
+
             // if refreshDeletes set to true then delete all the entries with entryUUID
             // present in the syncIdSet
             if ( syncInfoValue.isRefreshDeletes() )
@@ -491,12 +491,11 @@ public class ReplicationConsumerImpl imp
     public void startSync()
     {
         CONSUMER_LOG.debug( "Starting the SyncRepl process" );
-        
+
         // read the cookie if persisted
         readCookie();
-        
-        CONSUMER_LOG.debug( "Cookie read : '{}'", syncCookie );
 
+        CONSUMER_LOG.debug( "Cookie read : '{}'", syncCookie );
 
         if ( config.isRefreshNPersist() )
         {
@@ -532,19 +531,20 @@ public class ReplicationConsumerImpl imp
      */
     public void start()
     {
-        while ( ! connect() )
+        while ( !connect() )
         {
             try
             {
                 // try to establish a connection for every 5 seconds
                 Thread.sleep( 5000 );
             }
-            catch( InterruptedException e )
+            catch ( InterruptedException e )
             {
-                LOG.warn( "Interrupted while trying to reconnect to the provider {} with user DN", config.getRemoteHost(), config.getReplUserDn() );
+                LOG.warn( "Interrupted while trying to reconnect to the provider {} with user DN",
+                    config.getRemoteHost(), config.getReplUserDn() );
             }
         }
-        
+
         startSync();
     }
 
@@ -557,7 +557,7 @@ public class ReplicationConsumerImpl imp
         disconnect();
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -565,8 +565,8 @@ public class ReplicationConsumerImpl imp
     {
         return String.valueOf( getConfig().getReplicaId() );
     }
-    
-    
+
+
     /**
      * Performs a search on connection with updated syncRequest control. The provider
      * will initiate an UpdateContant or an initContent depending on the current consumer
@@ -588,7 +588,7 @@ public class ReplicationConsumerImpl imp
         syncReq.setMode( syncType );
         syncReq.setReloadHint( reloadHint );
 
-         // If we have a persisted cookie, send it.
+        // If we have a persisted cookie, send it.
         if ( syncCookie != null )
         {
             LOG.debug( "searching with searchRequest, cookie '{}'", Strings.utf8ToString( syncCookie ) );
@@ -605,7 +605,7 @@ public class ReplicationConsumerImpl imp
         SearchFuture sf = connection.searchAsync( searchRequest );
 
         Response resp = sf.get();
-        
+
         // Now, process the responses. We loop until we have a connection termination or
         // a SearchResultDone (RefreshOnly mode)
         while ( !( resp instanceof SearchResultDone ) && !sf.isCancelled() && !disconnected )
@@ -623,7 +623,7 @@ public class ReplicationConsumerImpl imp
             }
             else if ( resp instanceof IntermediateResponse )
             {
-                handleSyncInfo( (IntermediateResponse) resp );
+                handleSyncInfo( ( IntermediateResponse ) resp );
             }
 
             // Next entry
@@ -633,12 +633,12 @@ public class ReplicationConsumerImpl imp
         ResultCodeEnum resultCode = handleSearchDone( ( SearchResultDone ) resp );
 
         LOG.debug( "sync operation returned result code {}", resultCode );
-        
+
         if ( resultCode == ResultCodeEnum.NO_SUCH_OBJECT )
         {
             // log the error and handle it appropriately
             LOG.warn( "given replication base Dn {} is not found on provider", config.getBaseDn() );
-            
+
             if ( syncType == SynchronizationModeEnum.REFRESH_AND_PERSIST )
             {
                 LOG.warn( "disconnecting the consumer running in refreshAndPersist mode from the provider" );
@@ -648,7 +648,7 @@ public class ReplicationConsumerImpl imp
         else if ( resultCode == ResultCodeEnum.E_SYNC_REFRESH_REQUIRED )
         {
             LOG.info( "unable to perform the content synchronization cause E_SYNC_REFRESH_REQUIRED" );
-            
+
             try
             {
                 deleteRecursive( new Dn( config.getBaseDn() ), null );
@@ -707,7 +707,7 @@ public class ReplicationConsumerImpl imp
     private void storeCookie()
     {
         CONSUMER_LOG.debug( "Storing the cookie '{}'", Strings.utf8ToString( syncCookie ) );
-        
+
         if ( syncCookie == null )
         {
             return;
@@ -735,11 +735,11 @@ public class ReplicationConsumerImpl imp
                 attr.add( syncCookie );
 
                 CONSUMER_LOG.debug( "Storing the cookie in the DIT : {}", config.getConfigEntryDn() );
-                
+
                 session.modify( config.getConfigEntryDn(), cookieMod );
-                
+
                 Entry entry = session.lookup( config.getConfigEntryDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY );
-                
+
                 CONSUMER_LOG.debug( "stored entry : {}", entry );
             }
 
@@ -765,7 +765,7 @@ public class ReplicationConsumerImpl imp
             if ( config.isStoreCookieInFile() )
             {
                 CONSUMER_LOG.debug( "The cookie is stored in a file : {}", cookieFile );
-                
+
                 if ( cookieFile.exists() && ( cookieFile.length() > 0 ) )
                 {
                     FileInputStream fin = new FileInputStream( cookieFile );
@@ -776,7 +776,7 @@ public class ReplicationConsumerImpl imp
                     lastSavedCookie = new byte[syncCookie.length];
                     System.arraycopy( syncCookie, 0, lastSavedCookie, 0, syncCookie.length );
 
-                    LOG.debug( "read the cookie from file: " + Strings.utf8ToString(syncCookie) );
+                    LOG.debug( "read the cookie from file: " + Strings.utf8ToString( syncCookie ) );
                 }
             }
             else
@@ -784,13 +784,13 @@ public class ReplicationConsumerImpl imp
                 try
                 {
                     Entry entry = session.lookup( config.getConfigEntryDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY );
-                    
+
                     CONSUMER_LOG.debug( "The cookie is stored in the DIT : {}", entry );
 
                     if ( entry != null )
                     {
                         Attribute attr = entry.get( COOKIE_AT_TYPE );
-                        
+
                         if ( attr != null )
                         {
                             syncCookie = attr.getBytes();
@@ -854,10 +854,10 @@ public class ReplicationConsumerImpl imp
     private void applyModDnOperation( Entry remoteEntry, String entryUuid ) throws Exception
     {
         LOG.debug( "MODDN for entry {}, new entry : {}", entryUuid, remoteEntry );
-        
+
         // First, compute the MODDN type
         SyncModifyDnType modDnType = null;
-        
+
         try
         {
             // Retrieve locally the moved or renamed entry
@@ -910,7 +910,7 @@ public class ReplicationConsumerImpl imp
                 case MOVE:
                     LOG.debug( "moving {} to the new parent {}", localDn, remoteParentDn );
                     session.move( localDn, remoteParentDn );
-                    
+
                     break;
 
                 case RENAME:
@@ -918,17 +918,21 @@ public class ReplicationConsumerImpl imp
                         { localDn.getName(), remoteRdn.getName(), String.valueOf( deleteOldRdn ) } );
 
                     session.rename( localDn, remoteRdn, deleteOldRdn );
-                    
+
                     break;
 
                 case MOVE_AND_RENAME:
                     LOG.debug(
                         "moveAndRename on the Dn {} with new newParent Dn {}, new Rdn {} and deleteOldRdn flag set to {}",
                         new String[]
-                            { localDn.getName(), remoteParentDn.getName(), remoteRdn.getName(), String.valueOf( deleteOldRdn ) } );
+                            {
+                                localDn.getName(),
+                                remoteParentDn.getName(),
+                                remoteRdn.getName(),
+                                String.valueOf( deleteOldRdn ) } );
 
                     session.moveAndRename( localDn, remoteParentDn, remoteRdn, deleteOldRdn );
-                    
+
                     break;
             }
         }
@@ -971,7 +975,7 @@ public class ReplicationConsumerImpl imp
         if ( remoteEntry.size() > 0 )
         {
             itr = remoteEntry.iterator();
-            
+
             while ( itr.hasNext() )
             {
                 mods.add( new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, itr.next() ) );
@@ -997,7 +1001,7 @@ public class ReplicationConsumerImpl imp
 
         for ( byte[] uuid : uuidList )
         {
-            LOG.info( "uuid: {}", Strings.uuidToString(uuid) );
+            LOG.info( "uuid: {}", Strings.uuidToString( uuid ) );
         }
 
         // if it is refreshPresent list then send all the UUIDs for
@@ -1046,7 +1050,7 @@ public class ReplicationConsumerImpl imp
         int size = limitedUuidList.size();
         if ( size == 1 )
         {
-            String uuid = Strings.uuidToString(limitedUuidList.get(0));
+            String uuid = Strings.uuidToString( limitedUuidList.get( 0 ) );
             filter = new EqualityNode<String>( SchemaConstants.ENTRY_UUID_AT,
                 new org.apache.directory.shared.ldap.model.entry.StringValue( uuid ) );
             if ( isRefreshPresent )
@@ -1067,18 +1071,18 @@ public class ReplicationConsumerImpl imp
 
             for ( int i = 0; i < size; i++ )
             {
-                String uuid = Strings.uuidToString(limitedUuidList.get(i));
+                String uuid = Strings.uuidToString( limitedUuidList.get( i ) );
                 ExprNode uuidEqNode = new EqualityNode<String>( SchemaConstants.ENTRY_UUID_AT,
                     new org.apache.directory.shared.ldap.model.entry.StringValue( uuid ) );
 
                 if ( isRefreshPresent )
                 {
                     uuidEqNode = new NotNode( uuidEqNode );
-                    ( (AndNode) filter ).addNode( uuidEqNode );
+                    ( ( AndNode ) filter ).addNode( uuidEqNode );
                 }
                 else
                 {
-                    ( (OrNode) filter ).addNode( uuidEqNode );
+                    ( ( OrNode ) filter ).addNode( uuidEqNode );
                 }
             }
         }
@@ -1106,10 +1110,11 @@ public class ReplicationConsumerImpl imp
     {
         /** A field used to tell the thread it should stop */
         private volatile boolean stop = false;
-        
+
         /** A mutex used to make the thread sleeping for a moment */
         private final Object mutex = new Object();
 
+
         public RefresherThread()
         {
             setDaemon( true );
@@ -1146,7 +1151,7 @@ public class ReplicationConsumerImpl imp
         public void stopRefreshing()
         {
             stop = true;
-            
+
             // just in case if it is sleeping, wake up the thread
             mutex.notify();
         }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java Tue Jan 24 16:15:05 2012
@@ -65,7 +65,7 @@ public class ReplConsumerManager
 {
     /** Logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( ReplConsumerManager.class );
-    
+
     /** A logger for the replication provider */
     private static final Logger PROVIDER_LOG = LoggerFactory.getLogger( "PROVIDER_LOG" );
 
@@ -81,13 +81,13 @@ public class ReplConsumerManager
     /** The replication factory DN */
     private static final String REPL_CONSUMER_DN_STR = "ou=consumers,ou=system";
     private static Dn REPL_CONSUMER_DN;
-    
+
     /** The consumers' ou value */
-    private static final String CONSUMERS = "consumers"; 
+    private static final String CONSUMERS = "consumers";
 
     /** An ObjectClass AT instance */
     private static AttributeType OBJECT_CLASS_AT;
-    
+
     /** An AdsReplLastSentCsn AT instance */
     private static AttributeType ADS_REPL_LAST_SENT_CSN_AT;
 
@@ -109,7 +109,7 @@ public class ReplConsumerManager
         REPL_CONSUMER_DN = directoryService.getDnFactory().create( REPL_CONSUMER_DN_STR );
         OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
         ADS_REPL_LAST_SENT_CSN_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ADS_REPL_LAST_SENT_CSN );
-        
+
         PROVIDER_LOG.debug( "Starting the replication consumer manager" );
         createConsumersBranch();
     }
@@ -123,9 +123,10 @@ public class ReplConsumerManager
         if ( !adminSession.exists( REPL_CONSUMER_DN ) )
         {
             LOG.debug( "creating the entry for storing replication consumers' details" );
-            PROVIDER_LOG.debug( "Creating the entry for storing replication consumers' details in {}", REPL_CONSUMER_DN );
+            PROVIDER_LOG
+                .debug( "Creating the entry for storing replication consumers' details in {}", REPL_CONSUMER_DN );
 
-            Entry entry = new DefaultEntry( schemaManager , REPL_CONSUMER_DN,
+            Entry entry = new DefaultEntry( schemaManager, REPL_CONSUMER_DN,
                 SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.ORGANIZATIONAL_UNIT_OC,
                 SchemaConstants.OU_AT, CONSUMERS );
 
@@ -147,12 +148,13 @@ public class ReplConsumerManager
             // No consumer ? Get out...
             return;
         }
-        
+
         PROVIDER_LOG.debug( "Adding a consumer for replica {}", replica.toString() );
 
         // Check that we don't already have an entry for this consumer
-        Dn consumerDn = directoryService.getDnFactory().create( SchemaConstants.ADS_DS_REPLICA_ID + "=" + replica.getId() + "," + REPL_CONSUMER_DN );
-        
+        Dn consumerDn = directoryService.getDnFactory().create(
+            SchemaConstants.ADS_DS_REPLICA_ID + "=" + replica.getId() + "," + REPL_CONSUMER_DN );
+
         if ( adminSession.exists( consumerDn ) )
         {
             // Error...
@@ -174,9 +176,9 @@ public class ReplConsumerManager
             SchemaConstants.ADS_REPL_SEARCH_FILTER, replica.getSearchFilter() );
 
         adminSession.add( entry );
-        
+
         // Last, create a 
-        
+
         LOG.debug( "stored replication consumer entry {}", consumerDn );
     }
 
@@ -194,10 +196,11 @@ public class ReplConsumerManager
             // No consumer ? Get out...
             return;
         }
-        
+
         // Check that we have an entry for this consumer
-        Dn consumerDn = directoryService.getDnFactory().create( SchemaConstants.ADS_DS_REPLICA_ID + "=" + replica.getId() + "," + REPL_CONSUMER_DN );
-        
+        Dn consumerDn = directoryService.getDnFactory().create(
+            SchemaConstants.ADS_DS_REPLICA_ID + "=" + replica.getId() + "," + REPL_CONSUMER_DN );
+
         PROVIDER_LOG.debug( "Deleting the {} consumer", consumerDn );
 
         if ( !adminSession.exists( consumerDn ) )
@@ -211,7 +214,7 @@ public class ReplConsumerManager
 
         // Delete the consumer entry
         adminSession.delete( consumerDn );
-        
+
         LOG.debug( "Deleted replication consumer entry {}", consumerDn );
     }
 
@@ -226,13 +229,13 @@ public class ReplConsumerManager
     {
         Modification mod = modMap.get( replica.getId() );
         Attribute lastSentCsnAt = null;
-        
+
         if ( mod == null )
         {
             lastSentCsnAt = new DefaultAttribute( ADS_REPL_LAST_SENT_CSN_AT, replica.getLastSentCsn() );
 
             mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, lastSentCsnAt );
-            
+
             modMap.put( replica.getId(), mod );
         }
         else
@@ -242,9 +245,10 @@ public class ReplConsumerManager
             lastSentCsnAt.add( replica.getLastSentCsn() );
         }
 
-        Dn dn = directoryService.getDnFactory().create( SchemaConstants.ADS_DS_REPLICA_ID + "=" + replica.getId() + "," + REPL_CONSUMER_DN );
+        Dn dn = directoryService.getDnFactory().create(
+            SchemaConstants.ADS_DS_REPLICA_ID + "=" + replica.getId() + "," + REPL_CONSUMER_DN );
         adminSession.modify( dn, mod );
-        
+
         LOG.debug( "updated last sent CSN of consumer entry {}", dn );
         PROVIDER_LOG.debug( "updated the LastSentCSN of consumer entry {}", dn );
     }
@@ -261,13 +265,14 @@ public class ReplConsumerManager
         List<ReplicaEventLog> replicas = new ArrayList<ReplicaEventLog>();
 
         // Search for all the consumers
-        ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue( SchemaConstants.ADS_REPL_EVENT_LOG ) );
+        ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
+            SchemaConstants.ADS_REPL_EVENT_LOG ) );
         SearchRequest searchRequest = new SearchRequestImpl();
         searchRequest.setBase( REPL_CONSUMER_DN );
         searchRequest.setScope( SearchScope.ONELEVEL );
         searchRequest.setFilter( filter );
         searchRequest.addAttributes( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES );
-        
+
         EntryFilteringCursor cursor = adminSession.search( searchRequest );
 
         // Now loop on each consumer configuration
@@ -277,7 +282,7 @@ public class ReplConsumerManager
             ReplicaEventLog replica = convertEntryToReplica( entry );
             replicas.add( replica );
         }
-        
+
         cursor.close();
 
         // Now, we can return the list of replicas
@@ -302,7 +307,7 @@ public class ReplConsumerManager
         searchCriteria.setBase( new Dn( schemaManager, baseDn ) );
 
         Attribute lastSentCsnAt = entry.get( SchemaConstants.ADS_REPL_LAST_SENT_CSN );
-        
+
         if ( lastSentCsnAt != null )
         {
             replica.setLastSentCsn( lastSentCsnAt.getString() );
@@ -316,8 +321,9 @@ public class ReplConsumerManager
         searchCriteria.setFilter( filter );
         replica.setSearchFilter( filter );
 
-        replica.setRefreshNPersist( Boolean.parseBoolean( entry.get( SchemaConstants.ADS_REPL_REFRESH_N_PERSIST ).getString() ) );
-        
+        replica.setRefreshNPersist( Boolean.parseBoolean( entry.get( SchemaConstants.ADS_REPL_REFRESH_N_PERSIST )
+            .getString() ) );
+
         searchCriteria.setEventMask( EventType.ALL_EVENT_TYPES_MASK );
         replica.setSearchCriteria( searchCriteria );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java Tue Jan 24 16:15:05 2012
@@ -61,7 +61,7 @@ public class ReplicaEventLog implements 
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( ReplicaEventLog.class );
-    
+
     /** A logger for the replication provider */
     private static final Logger PROVIDER_LOG = LoggerFactory.getLogger( "PROVIDER_LOG" );
 
@@ -117,10 +117,11 @@ public class ReplicaEventLog implements 
         journalFile = new File( logDir, "journalRepl." + replicaId );
         recman = new BaseRecordManager( journalFile.getAbsolutePath() );
 
-        SerializableComparator<String> comparator = new SerializableComparator<String>( SchemaConstants.CSN_ORDERING_MATCH_MR_OID );
+        SerializableComparator<String> comparator = new SerializableComparator<String>(
+            SchemaConstants.CSN_ORDERING_MATCH_MR_OID );
         comparator.setSchemaManager( schemaManager );
-        
-        journal = new JdbmTable<String, ReplicaEventMessage>( schemaManager, "replication", recman, comparator, 
+
+        journal = new JdbmTable<String, ReplicaEventMessage>( schemaManager, "replication", recman, comparator,
             new StringSerializer(), new ReplicaEventMessageSerializer( schemaManager ) );
     }
 
@@ -134,8 +135,10 @@ public class ReplicaEventLog implements 
     {
         try
         {
-            LOG.debug( "logging entry with Dn {} with the event {}", message.getEntry().getDn(), message.getChangeType() );
-            PROVIDER_LOG.debug( "logging entry with Dn {} with the event {}", message.getEntry().getDn(), message.getChangeType() );
+            LOG.debug( "logging entry with Dn {} with the event {}", message.getEntry().getDn(),
+                message.getChangeType() );
+            PROVIDER_LOG.debug( "logging entry with Dn {} with the event {}", message.getEntry().getDn(),
+                message.getChangeType() );
 
             String entryCsn = message.getEntry().get( SchemaConstants.ENTRY_CSN_AT ).getString();
             journal.put( entryCsn, message );
@@ -178,7 +181,7 @@ public class ReplicaEventLog implements 
     public void stop() throws Exception
     {
         PROVIDER_LOG.debug( "Stopping the EventLog for replicaId {}", replicaId );
-        
+
         // Close the producer and session, DO NOT close connection 
         if ( journal != null )
         {
@@ -227,7 +230,7 @@ public class ReplicaEventLog implements 
         int result = 17;
         result = 31 * result + searchFilter.hashCode();
         result = 31 * result + hostName.hashCode();
-        
+
         return result;
     }
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java Tue Jan 24 16:15:05 2012
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.ldap.replication.provider;
 
+
 import java.util.Iterator;
 
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable;
@@ -31,6 +32,7 @@ import org.apache.directory.shared.ldap.
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * Define a cursor on top of a replication journal.
  *
@@ -40,10 +42,10 @@ public class ReplicaJournalCursor extend
 {
     /** Logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( ReplicaJournalCursor.class );
-    
+
     /** the underlying journal's cursor */
     private Cursor<Tuple<String, ReplicaEventMessage>> tupleCursor;
-    
+
     /** the event log journal */
     private JdbmTable<String, ReplicaEventMessage> journal;
 
@@ -51,7 +53,8 @@ public class ReplicaJournalCursor extend
     private String consumerCsn;
 
     private ReplicaEventMessage qualifiedEvtMsg;
-    
+
+
     /**
      * Creates a cursor on top of the given journal
      * @param journal the log journal
@@ -127,7 +130,7 @@ public class ReplicaJournalCursor extend
         return qualifiedEvtMsg;
     }
 
-    
+
     /**
      * selects the current queue entry if qualified for sending to the consumer
      * 
@@ -136,33 +139,33 @@ public class ReplicaJournalCursor extend
     private void selectQualified() throws Exception
     {
         Tuple<String, ReplicaEventMessage> t = tupleCursor.get();
-        
+
         qualifiedEvtMsg = t.getValue();
-        
+
         LOG.debug( "ReplicaEventMessage: {}", qualifiedEvtMsg );
-        
+
         if ( qualifiedEvtMsg.isEventOlderThan( consumerCsn ) )
         {
-            if( LOG.isDebugEnabled() )
+            if ( LOG.isDebugEnabled() )
             {
                 String evt = "MODDN"; // take this as default cause the event type for MODDN is null
-                
+
                 ChangeType changeType = qualifiedEvtMsg.getChangeType();
-                
+
                 if ( changeType != null )
                 {
                     evt = changeType.name();
                 }
-                
+
                 LOG.debug( "event {} for dn {} is not qualified for sending", evt, qualifiedEvtMsg.getEntry().getDn() );
             }
-            
+
             // TODO need to be checked if this causes issues in JDBM
             journal.remove( t.getKey() );
             qualifiedEvtMsg = null;
         }
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -178,18 +181,18 @@ public class ReplicaJournalCursor extend
      */
     public boolean next() throws Exception
     {
-        while( tupleCursor.next() )
+        while ( tupleCursor.next() )
         {
             selectQualified();
-            
+
             if ( qualifiedEvtMsg != null )
             {
                 return true;
             }
         }
-        
+
         qualifiedEvtMsg = null;
-        
+
         return false;
     }
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicationRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicationRequestHandler.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicationRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicationRequestHandler.java Tue Jan 24 16:15:05 2012
@@ -20,11 +20,13 @@
 
 package org.apache.directory.server.ldap.replication.provider;
 
+
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
 
+
 /**
  * Interface of a replication request handler in a provider/master.
  *
@@ -39,13 +41,13 @@ public interface ReplicationRequestHandl
      */
     void start( LdapServer server );
 
-    
+
     /**
      * stops the replication provider
      */
     void stop();
 
-    
+
     /**
      * A method to be used by any RFC 4533 compatible provider implementation 
      *

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java Tue Jan 24 16:15:05 2012
@@ -145,7 +145,7 @@ public class SyncReplRequestHandler impl
             PROVIDER_LOG.warn( "syncrepl provider was already initialized" );
             return;
         }
-        
+
         try
         {
             LOG.info( "initializing the syncrepl provider" );
@@ -159,12 +159,12 @@ public class SyncReplRequestHandler impl
 
             File workDir = dirService.getInstanceLayout().getLogDirectory();
             syncReplData = new File( workDir, "syncrepl-data" );
-            
+
             if ( !syncReplData.exists() )
             {
                 if ( !syncReplData.mkdirs() )
                 {
-                    throw new IOException(I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, syncReplData ) );
+                    throw new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, syncReplData ) );
                 }
             }
 
@@ -203,14 +203,14 @@ public class SyncReplRequestHandler impl
                 PROVIDER_LOG.debug( "Stopping the logging for replica ", log.getId() );
                 log.stop();
             }
-            catch( Exception e )
+            catch ( Exception e )
             {
                 LOG.warn( "Failed to close the event log {}", log.getId() );
                 LOG.warn( "", e );
                 PROVIDER_LOG.error( "Failed to close the event log {}", log.getId(), e );
             }
         }
-        
+
         initialized = false;
     }
 
@@ -242,25 +242,27 @@ public class SyncReplRequestHandler impl
             else
             {
                 String cookieString = Strings.utf8ToString( cookieBytes );
-                
+
                 PROVIDER_LOG.debug( "Received a replication request {} with a cookie '{}'", request, cookieString );
                 LOG.debug( "search request received with the cookie {}", cookieString );
-                
+
                 if ( !LdapProtocolUtils.isValidCookie( cookieString ) )
                 {
                     LOG.error( "received a invalid cookie {} from the consumer with session {}", cookieString, session );
-                    PROVIDER_LOG.debug( "received a invalid cookie {} from the consumer with session {}", cookieString, session );
+                    PROVIDER_LOG.debug( "received a invalid cookie {} from the consumer with session {}", cookieString,
+                        session );
                     sendESyncRefreshRequired( session, request );
                 }
                 else
                 {
                     ReplicaEventLog clientMsgLog = getReplicaEventLog( cookieString );
-                    
+
                     if ( clientMsgLog == null )
                     {
                         LOG.warn( "received a valid cookie {} but there is no event log associated with this replica",
                             cookieString );
-                        PROVIDER_LOG.debug( "received a valid cookie {} but there is no event log associated with this replica",
+                        PROVIDER_LOG.debug(
+                            "received a valid cookie {} but there is no event log associated with this replica",
                             cookieString );
                         sendESyncRefreshRequired( session, request );
                     }
@@ -288,14 +290,15 @@ public class SyncReplRequestHandler impl
     /**
      * Send all the stored modifications to the consumer
      */
-    private String sendContentFromLog( LdapSession session, SearchRequest req, ReplicaEventLog clientMsgLog, String consumerCsn )
+    private String sendContentFromLog( LdapSession session, SearchRequest req, ReplicaEventLog clientMsgLog,
+        String consumerCsn )
         throws Exception
     {
         // do the search from the log
         String lastSentCsn = clientMsgLog.getLastSentCsn();
 
         ReplicaJournalCursor cursor = clientMsgLog.getCursor( consumerCsn );
-        
+
         PROVIDER_LOG.debug( "Processing the log for replica {}", clientMsgLog.getId() );
 
         while ( cursor.next() )
@@ -304,7 +307,7 @@ public class SyncReplRequestHandler impl
             Entry entry = replicaEventMessage.getEntry();
             LOG.debug( "Read message from the queue {}", entry );
             PROVIDER_LOG.debug( "Read message from the queue {}", entry );
-            
+
             lastSentCsn = entry.get( SchemaConstants.ENTRY_CSN_AT ).getString();
 
             ChangeType event = replicaEventMessage.getChangeType();
@@ -317,15 +320,15 @@ public class SyncReplRequestHandler impl
             else
             {
                 SyncStateTypeEnum syncStateType = null;
-                
+
                 switch ( event )
                 {
-                    case ADD :
-                    case MODIFY :
+                    case ADD:
+                    case MODIFY:
                         syncStateType = SyncStateTypeEnum.ADD;
                         break;
-                        
-                    case DELETE :
+
+                    case DELETE:
                         syncStateType = SyncStateTypeEnum.DELETE;
                         break;
                 }
@@ -333,7 +336,7 @@ public class SyncReplRequestHandler impl
                 sendSearchResultEntry( session, req, entry, syncStateType );
             }
         }
-        
+
         PROVIDER_LOG.debug( "All pending modifciations for replica {} processed", clientMsgLog.getId() );
         cursor.close();
 
@@ -362,7 +365,8 @@ public class SyncReplRequestHandler impl
 
         String lastSentCsn = sendContentFromLog( session, req, replicaLog, consumerCsn );
 
-        PROVIDER_LOG.debug( "The latest entry sent to the consumer {} has this CSN : {}", replicaLog.getId(), lastSentCsn );
+        PROVIDER_LOG.debug( "The latest entry sent to the consumer {} has this CSN : {}", replicaLog.getId(),
+            lastSentCsn );
         byte[] cookie = LdapProtocolUtils.createCookie( replicaLog.getId(), lastSentCsn );
 
         if ( refreshNPersist )
@@ -374,9 +378,10 @@ public class SyncReplRequestHandler impl
                 .getLdapCodecService(),
                 SynchronizationInfoEnum.NEW_COOKIE );
             syncInfo.setCookie( cookie );
-            intermResp.setResponseValue( ((SyncInfoValueDecorator)syncInfo).getValue() );
+            intermResp.setResponseValue( ( ( SyncInfoValueDecorator ) syncInfo ).getValue() );
 
-            PROVIDER_LOG.debug( "Sent the intermediate response to the {} consumer, {}", replicaLog.getId(), intermResp );
+            PROVIDER_LOG
+                .debug( "Sent the intermediate response to the {} consumer, {}", replicaLog.getId(), intermResp );
             session.getIoSession().write( intermResp );
 
             replicaLog.getPersistentListener().setPushInRealTime( refreshNPersist );
@@ -385,12 +390,13 @@ public class SyncReplRequestHandler impl
         {
             SearchResultDone searchDoneResp = ( SearchResultDone ) req.getResultResponse();
             searchDoneResp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
-            SyncDoneValue syncDone = new SyncDoneValueDecorator( 
+            SyncDoneValue syncDone = new SyncDoneValueDecorator(
                 ldapServer.getDirectoryService().getLdapCodecService() );
             syncDone.setCookie( cookie );
             searchDoneResp.addControl( syncDone );
 
-            PROVIDER_LOG.debug( "Send a SearchResultDone response to the {} consumer", replicaLog.getId(), searchDoneResp );
+            PROVIDER_LOG.debug( "Send a SearchResultDone response to the {} consumer", replicaLog.getId(),
+                searchDoneResp );
 
             session.getIoSession().write( searchDoneResp );
         }
@@ -468,15 +474,15 @@ public class SyncReplRequestHandler impl
             if ( refreshNPersist ) // refreshAndPersist mode
             {
                 contextCsn = sendContentFromLog( session, request, replicaLog, contextCsn );
-                cookie = LdapProtocolUtils.createCookie(replicaLog.getId(), contextCsn);
+                cookie = LdapProtocolUtils.createCookie( replicaLog.getId(), contextCsn );
 
                 IntermediateResponse intermResp = new IntermediateResponseImpl( request.getMessageId() );
                 intermResp.setResponseName( SyncInfoValue.OID );
 
-                SyncInfoValue syncInfo = new SyncInfoValueDecorator( 
+                SyncInfoValue syncInfo = new SyncInfoValueDecorator(
                     ldapServer.getDirectoryService().getLdapCodecService(), SynchronizationInfoEnum.NEW_COOKIE );
                 syncInfo.setCookie( cookie );
-                intermResp.setResponseValue( ((SyncInfoValueDecorator)syncInfo).getValue() );
+                intermResp.setResponseValue( ( ( SyncInfoValueDecorator ) syncInfo ).getValue() );
 
                 PROVIDER_LOG.info( "Sending the intermediate response to consumer {}, {}", replicaLog, syncInfo );
 
@@ -492,7 +498,8 @@ public class SyncReplRequestHandler impl
                     ldapServer.getDirectoryService().getLdapCodecService() );
                 syncDone.setCookie( cookie );
                 searchDoneResp.addControl( syncDone );
-                PROVIDER_LOG.info( "Sending the searchResultDone response to consumer {}, {}", replicaLog, searchDoneResp );
+                PROVIDER_LOG.info( "Sending the searchResultDone response to consumer {}, {}", replicaLog,
+                    searchDoneResp );
 
                 session.getIoSession().write( searchDoneResp );
             }
@@ -514,7 +521,7 @@ public class SyncReplRequestHandler impl
         }
 
         // if all is well then store the consumer information
-        replicaUtil.addConsumerEntry(replicaLog );
+        replicaUtil.addConsumerEntry( replicaLog );
 
         // add to the map only after storing in the DIT, else the Replica update thread barfs
         replicaLogMap.put( replicaLog.getId(), replicaLog );
@@ -584,7 +591,6 @@ public class SyncReplRequestHandler impl
     {
         long count = 0;
 
-        
         while ( ( count < sizeLimit ) && cursor.next() )
         {
             // Handle closed session
@@ -592,7 +598,8 @@ public class SyncReplRequestHandler impl
             {
                 // The client has closed the connection
                 LOG.debug( "Request terminated for message {}, the client has closed the session", req.getMessageId() );
-                PROVIDER_LOG.debug( "Request terminated for message {}, the client has closed the session", req.getMessageId() );
+                PROVIDER_LOG.debug( "Request terminated for message {}, the client has closed the session",
+                    req.getMessageId() );
                 break;
             }
 
@@ -634,7 +641,7 @@ public class SyncReplRequestHandler impl
         SyncStateTypeEnum syncStateType ) throws Exception
     {
         Attribute uuid = entry.get( SchemaConstants.ENTRY_UUID_AT );
-        
+
         // Create the SyncState control
         SyncStateValue syncStateControl = new SyncStateValueDecorator(
             ldapServer.getDirectoryService().getLdapCodecService() );
@@ -682,7 +689,7 @@ public class SyncReplRequestHandler impl
                 }
 
                 LdapUrl ldapUrl = null;
-                
+
                 try
                 {
                     ldapUrl = new LdapUrl( url );
@@ -816,14 +823,14 @@ public class SyncReplRequestHandler impl
          *  (| (objectClass=referral)(objectClass=*)) == (objectClass=*)
          */
         boolean isOcPresenceFilter = false;
-        
+
         if ( req.getFilter() instanceof PresenceNode )
         {
             PresenceNode presenceNode = ( PresenceNode ) req.getFilter();
 
             AttributeType at = session.getCoreSession().getDirectoryService().getSchemaManager()
                 .lookupAttributeTypeRegistry( presenceNode.getAttribute() );
-            
+
             if ( at.getOid().equals( SchemaConstants.OBJECT_CLASS_AT_OID ) )
             {
                 isOcPresenceFilter = true;
@@ -831,7 +838,7 @@ public class SyncReplRequestHandler impl
         }
 
         ExprNode filter = req.getFilter();
-        
+
         if ( !req.hasControl( ManageDsaIT.OID ) && !isOcPresenceFilter )
         {
             filter = new OrNode( req.getFilter(), newIsReferralEqualityNode( session ) );
@@ -861,7 +868,7 @@ public class SyncReplRequestHandler impl
             for ( Map.Entry<Integer, ReplicaEventLog> e : replicaLogMap.entrySet() )
             {
                 ReplicaEventLog replica = e.getValue();
-                
+
                 if ( replica.isDirty() )
                 {
                     LOG.debug( "updating the details of replica {}", replica );
@@ -887,7 +894,7 @@ public class SyncReplRequestHandler impl
         try
         {
             List<ReplicaEventLog> eventLogs = replicaUtil.getReplicaEventLogs();
-            
+
             if ( !eventLogs.isEmpty() )
             {
                 for ( ReplicaEventLog replica : eventLogs )
@@ -939,8 +946,9 @@ public class SyncReplRequestHandler impl
             {
                 LOG.warn( "invalid peristent search criteria {} for the replica {}", log.getSearchCriteria(), log
                     .getId() );
-                PROVIDER_LOG.warn( "invalid peristent search criteria {} for the replica {}", log.getSearchCriteria(), log
-                    .getId() );
+                PROVIDER_LOG.warn( "invalid peristent search criteria {} for the replica {}", log.getSearchCriteria(),
+                    log
+                        .getId() );
             }
         }
     }
@@ -958,7 +966,7 @@ public class SyncReplRequestHandler impl
                 while ( true )
                 {
                     storeReplicaInfo();
-                    
+
                     try
                     {
                         Thread.sleep( 10000 );
@@ -1031,7 +1039,7 @@ public class SyncReplRequestHandler impl
     private boolean isRefreshNPersist( SearchRequest req )
     {
         SyncRequestValue control = ( SyncRequestValue ) req.getControls().get( SyncRequestValue.OID );
-        
+
         return control.getMode() == SynchronizationModeEnum.REFRESH_AND_PERSIST;
     }
 }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java Tue Jan 24 16:15:05 2012
@@ -67,7 +67,7 @@ public class SyncReplSearchListener impl
 
     /** The ldap session */
     private LdapSession session;
-    
+
     /** The search request we are processing */
     private SearchRequest searchRequest;
 
@@ -76,7 +76,7 @@ public class SyncReplSearchListener impl
 
     /** The consumer configuration */
     private final ReplicaEventLog consumerMsgLog;
-    
+
 
     /**
      * Create a new instance of a consumer listener
@@ -114,7 +114,7 @@ public class SyncReplSearchListener impl
     public void setSearchRequest( SearchRequest searchRequest )
     {
         this.searchRequest = searchRequest;
-        
+
         if ( searchRequest != null )
         {
             searchRequest.addAbandonListener( this );
@@ -156,11 +156,11 @@ public class SyncReplSearchListener impl
         }
     }
 
-    
+
     /**
      * Create the SyncStateValue control
      */
-    private SyncStateValue createControl( DirectoryService directoryService, SyncStateTypeEnum operation, Entry entry ) 
+    private SyncStateValue createControl( DirectoryService directoryService, SyncStateTypeEnum operation, Entry entry )
         throws LdapInvalidAttributeValueException
     {
         SyncStateValue syncStateValue = new SyncStateValueDecorator( directoryService.getLdapCodecService() );
@@ -169,15 +169,15 @@ public class SyncReplSearchListener impl
         String uuidStr = entry.get( SchemaConstants.ENTRY_UUID_AT ).getString();
         syncStateValue.setEntryUUID( Strings.uuidToBytes( uuidStr ) );
         syncStateValue.setCookie( getCookie( entry ) );
-        
+
         return syncStateValue;
     }
-    
-    
+
+
     /**
      * Send the result to the consumer. If the consumer has disconnected, we fail back to the queue.
      */
-    private void sendResult( SearchResultEntry searchResultEntry, Entry entry, EventType eventType, 
+    private void sendResult( SearchResultEntry searchResultEntry, Entry entry, EventType eventType,
         SyncStateValue syncStateValue )
     {
         searchResultEntry.addControl( syncStateValue );
@@ -188,7 +188,7 @@ public class SyncReplSearchListener impl
         // Now, send the entry to the consumer
         handleWriteFuture( future, entry, eventType );
     }
-    
+
 
     /**
      * Process a ADD operation. The added entry is pushed to the consumer if it's connected,
@@ -204,7 +204,8 @@ public class SyncReplSearchListener impl
         {
             //System.out.println( "ADD Listener : log " + entry.getDn() );
             // we log it first
-            consumerMsgLog.log( new ReplicaEventMessage( ChangeType.ADD, ((ClonedServerEntry)entry).getClonedEntry() ) );
+            consumerMsgLog.log( new ReplicaEventMessage( ChangeType.ADD, ( ( ClonedServerEntry ) entry )
+                .getClonedEntry() ) );
 
             // We send the added entry directly to the consumer if it's connected
             if ( pushInRealTime )
@@ -215,11 +216,12 @@ public class SyncReplSearchListener impl
                 resultEntry.setEntry( entry );
 
                 // Create the control which will be added to the response.
-                SyncStateValue syncAdd = createControl( session.getCoreSession().getDirectoryService(), SyncStateTypeEnum.ADD, entry );
-                
+                SyncStateValue syncAdd = createControl( session.getCoreSession().getDirectoryService(),
+                    SyncStateTypeEnum.ADD, entry );
+
                 sendResult( resultEntry, entry, EventType.ADD, syncAdd );
             }
-            
+
         }
         catch ( LdapInvalidAttributeValueException e )
         {
@@ -240,7 +242,7 @@ public class SyncReplSearchListener impl
         Entry entry = deleteContext.getEntry();
         sendDeletedEntry( entry );
     }
-    
+
 
     /**
      * A helper method, as the delete opertaionis used by the ModDN operations.
@@ -251,14 +253,15 @@ public class SyncReplSearchListener impl
         {
             //System.out.println( "DELETE Listener : log " + entry.getDn() );
             consumerMsgLog.log( new ReplicaEventMessage( ChangeType.DELETE, entry ) );
-            
+
             if ( pushInRealTime )
             {
                 SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                 resultEntry.setObjectName( entry.getDn() );
                 resultEntry.setEntry( entry );
 
-                SyncStateValue syncDelete = createControl( session.getCoreSession().getDirectoryService(), SyncStateTypeEnum.DELETE, entry );
+                SyncStateValue syncDelete = createControl( session.getCoreSession().getDirectoryService(),
+                    SyncStateTypeEnum.DELETE, entry );
 
                 sendResult( resultEntry, entry, EventType.DELETE, syncDelete );
             }
@@ -285,7 +288,7 @@ public class SyncReplSearchListener impl
         {
             //System.out.println( "MODIFY Listener : log " + alteredEntry.getDn() );
             consumerMsgLog.log( new ReplicaEventMessage( ChangeType.MODIFY, alteredEntry ) );
-            
+
             if ( pushInRealTime )
             {
 
@@ -293,7 +296,8 @@ public class SyncReplSearchListener impl
                 resultEntry.setObjectName( modifyContext.getDn() );
                 resultEntry.setEntry( alteredEntry );
 
-                SyncStateValue syncModify = createControl( session.getCoreSession().getDirectoryService(), SyncStateTypeEnum.MODIFY, alteredEntry );
+                SyncStateValue syncModify = createControl( session.getCoreSession().getDirectoryService(),
+                    SyncStateTypeEnum.MODIFY, alteredEntry );
 
                 sendResult( resultEntry, alteredEntry, EventType.MODIFY, syncModify );
             }
@@ -326,14 +330,15 @@ public class SyncReplSearchListener impl
 
             //System.out.println( "MOVE Listener : log " + moveContext.getDn() + " moved to " + moveContext.getNewSuperior() );
             consumerMsgLog.log( new ReplicaEventMessage( ChangeType.MODDN, entry ) );
-            
+
             if ( pushInRealTime )
             {
                 SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                 resultEntry.setObjectName( moveContext.getDn() );
                 resultEntry.setEntry( entry );
 
-                SyncStateValue syncModify = createControl( session.getCoreSession().getDirectoryService(), SyncStateTypeEnum.MODDN, entry );
+                SyncStateValue syncModify = createControl( session.getCoreSession().getDirectoryService(),
+                    SyncStateTypeEnum.MODDN, entry );
 
                 sendResult( resultEntry, entry, null, syncModify );
             }
@@ -367,14 +372,15 @@ public class SyncReplSearchListener impl
             //System.out.println( "MOVE AND RENAME Listener : log " + moveAndRenameContext.getDn() + 
             //    " moved to " + moveAndRenameContext.getNewSuperiorDn() + " renamed to " + moveAndRenameContext.getNewRdn() );
             consumerMsgLog.log( new ReplicaEventMessage( ChangeType.MODDN, entry ) );
-            
+
             if ( pushInRealTime )
             {
                 SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                 resultEntry.setObjectName( entry.getDn() );
                 resultEntry.setEntry( entry );
 
-                SyncStateValue syncModify = createControl( session.getCoreSession().getDirectoryService(), SyncStateTypeEnum.MODDN, entry );
+                SyncStateValue syncModify = createControl( session.getCoreSession().getDirectoryService(),
+                    SyncStateTypeEnum.MODDN, entry );
 
                 sendResult( resultEntry, entry, null, syncModify );
             }
@@ -402,15 +408,16 @@ public class SyncReplSearchListener impl
             // should always send the original entry cause the consumer perform the modDn operation there
             //System.out.println( "RENAME Listener : log " + renameContext.getDn() + " renamed to " + renameContext.getNewRdn() );
             consumerMsgLog.log( new ReplicaEventMessage( ChangeType.MODDN, entry ) );
-            
+
             if ( pushInRealTime )
             {
                 SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                 resultEntry.setObjectName( entry.getDn() );
                 resultEntry.setEntry( entry );
 
-                SyncStateValue syncModify = createControl( session.getCoreSession().getDirectoryService(), SyncStateTypeEnum.MODDN, entry );
-                
+                SyncStateValue syncModify = createControl( session.getCoreSession().getDirectoryService(),
+                    SyncStateTypeEnum.MODDN, entry );
+
                 // In this case, the cookie is different
                 syncModify.setCookie( getCookie( entry ) );
 
@@ -462,11 +469,12 @@ public class SyncReplSearchListener impl
         // Let the operation be executed.
         // Note : we wait 10 seconds max
         future.awaitUninterruptibly( 10000L );
-        
+
         if ( !future.isWritten() )
         {
-            LOG.error( "Failed to write to the consumer {} during the event {} on entry {}", new Object[] { 
-                           consumerMsgLog.getId(), event, entry.getDn() } );
+            LOG.error( "Failed to write to the consumer {} during the event {} on entry {}", new Object[]
+                {
+                    consumerMsgLog.getId(), event, entry.getDn() } );
             LOG.error( "", future.getException() );
 
             // set realtime push to false, will be set back to true when the client
@@ -474,21 +482,21 @@ public class SyncReplSearchListener impl
             pushInRealTime = false;
         }
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( "SyncReplSearchListener : \n" );
         sb.append( '\'' ).append( searchRequest ).append( "', " );
         sb.append( '\'' ).append( pushInRealTime ).append( "', \n" );
         sb.append( consumerMsgLog );
         sb.append( '\n' );
-        
+
         return sb.toString();
     }
 }

Modified: directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/JournalTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/JournalTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/JournalTest.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/JournalTest.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.ldap;
 
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
@@ -52,6 +53,7 @@ import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
+
 /**
  * A test to check that we can correctly create a Journal to store the ReplicaEventMessages.
  * 
@@ -64,19 +66,20 @@ public class JournalTest
 
     /** the underlying file  */
     private File dbFile;
-    
+
     /** The record manager*/
     private RecordManager recman;
-    
+
     /** The SchemaManager instance */
     private static SchemaManager schemaManager;
 
     /** The Journal */
     private JdbmTable<String, ReplicaEventMessage> journal;
-    
+
     /** The CsnFactory */
     private static CsnFactory csnFactory;
 
+
     /**
      * Load the SchemaManager
      * @throws Exception
@@ -103,13 +106,13 @@ public class JournalTest
 
         if ( !loaded )
         {
-            fail( "Schema load failed : " + Exceptions.printErrors(schemaManager.getErrors()) );
+            fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
 
         csnFactory = new CsnFactory( 0 );
     }
 
-    
+
     /**
      * Create the JdbmTable
      */
@@ -118,7 +121,7 @@ public class JournalTest
     {
         destroyTable();
         File tmpDir = null;
-        
+
         if ( System.getProperty( TEST_OUTPUT_PATH, null ) != null )
         {
             tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
@@ -126,16 +129,18 @@ public class JournalTest
 
         dbFile = File.createTempFile( getClass().getSimpleName(), "db", tmpDir );
         recman = new BaseRecordManager( dbFile.getAbsolutePath() );
-        ((BaseRecordManager)recman).disableTransactions();
+        ( ( BaseRecordManager ) recman ).disableTransactions();
 
-        SerializableComparator<String> comparator = new SerializableComparator<String>( SchemaConstants.CSN_ORDERING_MATCH_MR_OID );
+        SerializableComparator<String> comparator = new SerializableComparator<String>(
+            SchemaConstants.CSN_ORDERING_MATCH_MR_OID );
         comparator.setSchemaManager( schemaManager );
-        
-        journal = new JdbmTable<String, ReplicaEventMessage>( schemaManager, "test", recman, comparator, 
+
+        journal = new JdbmTable<String, ReplicaEventMessage>( schemaManager, "test", recman, comparator,
             new StringSerializer(), new ReplicaEventMessageSerializer( schemaManager ) );
-        
+
     }
 
+
     /**
      * Delete the files on disk
      */
@@ -164,10 +169,10 @@ public class JournalTest
 
             dbFile.delete();
         }
-        
+
         dbFile = null;
     }
-    
+
 
     /**
      * test that we can write 1000 ReplicaEventMessages, and read them back in the right order 
@@ -177,7 +182,7 @@ public class JournalTest
     public void testJournalWriting() throws Exception
     {
         Csn entryCsn = csnFactory.newInstance();
-        Csn firstCsn = entryCsn; 
+        Csn firstCsn = entryCsn;
         Csn csn100 = null;
 
         for ( int i = 0; i < 1000; i++ )
@@ -186,39 +191,39 @@ public class JournalTest
             {
                 csn100 = entryCsn;
             }
-            
-            Entry entry = new DefaultEntry( schemaManager, "ou=test" + i + ",ou=system", 
+
+            Entry entry = new DefaultEntry( schemaManager, "ou=test" + i + ",ou=system",
                 "ObjectClass: top",
                 "ObjectClass: organizationalUnit",
                 "ou", "test" + i,
                 "entryCsn", entryCsn.toString()
                 );
-            
+
             ReplicaEventMessage replicaEventMessage = new ReplicaEventMessage( ChangeType.ADD, entry );
             journal.put( entryCsn.toString(), replicaEventMessage );
             journal.sync();
 
             entryCsn = csnFactory.newInstance();
         }
-        
+
         // Now check that the ReplicaEventMessages has been written
         ReplicaEventMessage firstMessage = journal.get( firstCsn.toString() );
-        
-        assertEquals( ChangeType.ADD, firstMessage.getChangeType());
+
+        assertEquals( ChangeType.ADD, firstMessage.getChangeType() );
         assertEquals( "test0", firstMessage.getEntry().get( "ou" ).getString() );
-        
+
         // Read entry from the 100th element
         Cursor<Tuple<String, ReplicaEventMessage>> cursor = journal.cursor( csn100.toString() );
         int pos = 100;
-        
+
         while ( cursor.next() )
         {
             Tuple<String, ReplicaEventMessage> tuple = cursor.get();
             ReplicaEventMessage replicaEventMessage = tuple.getValue();
-            
-            assertEquals( ChangeType.ADD, replicaEventMessage.getChangeType());
+
+            assertEquals( ChangeType.ADD, replicaEventMessage.getChangeType() );
             assertEquals( "test" + pos, replicaEventMessage.getEntry().get( "ou" ).getString() );
-            
+
             pos++;
         }
     }
@@ -235,20 +240,20 @@ public class JournalTest
 
         for ( int i = 0; i < 1000; i++ )
         {
-            Entry entry = new DefaultEntry( schemaManager, "ou=test" + i + ",ou=system", 
+            Entry entry = new DefaultEntry( schemaManager, "ou=test" + i + ",ou=system",
                 "ObjectClass: top",
                 "ObjectClass: organizationalUnit",
                 "ou", "test" + i,
                 "entryCsn", entryCsn.toString()
                 );
-            
+
             ReplicaEventMessage replicaEventMessage = new ReplicaEventMessage( ChangeType.ADD, entry );
             journal.put( entryCsn.toString(), replicaEventMessage );
             journal.sync();
 
             entryCsn = csnFactory.newInstance();
         }
-        
+
         // Remove the first 500 ReplicaEventMessages
         Cursor<Tuple<String, ReplicaEventMessage>> deleteCursor = journal.cursor();
         int deleted = 0;
@@ -257,20 +262,20 @@ public class JournalTest
         {
             Tuple<String, ReplicaEventMessage> tuple = deleteCursor.get();
             ReplicaEventMessage replicaEventMessage = tuple.getValue();
-            
+
             assertEquals( ChangeType.ADD, replicaEventMessage.getChangeType() );
             assertEquals( "test" + deleted, replicaEventMessage.getEntry().get( "ou" ).getString() );
-            
+
             journal.remove( replicaEventMessage.getEntry().get( "entryCsn" ).getString() );
             journal.sync();
             deleted++;
         }
-        
+
         // Now check that the first mod is the 501th
         assertEquals( 500, journal.count() );
-        
+
         Cursor<Tuple<String, ReplicaEventMessage>> cursor = journal.cursor();
-        
+
         cursor.next();
 
         Tuple<String, ReplicaEventMessage> tuple = cursor.get();
@@ -291,7 +296,7 @@ public class JournalTest
      * 
      */
     @Test
-    @Ignore( "Performance test" )
+    @Ignore("Performance test")
     public void testJournalPerf() throws Exception
     {
         Csn entryCsn = csnFactory.newInstance();
@@ -301,13 +306,13 @@ public class JournalTest
 
         for ( int i = 0; i < 100000; i++ )
         {
-            Entry entry = new DefaultEntry( schemaManager, "ou=test" + i + ",ou=system", 
+            Entry entry = new DefaultEntry( schemaManager, "ou=test" + i + ",ou=system",
                 "ObjectClass: top",
                 "ObjectClass: organizationalUnit",
                 "ou", "test" + i,
                 "entryCsn", entryCsn.toString()
                 );
-            
+
             ReplicaEventMessage replicaEventMessage = new ReplicaEventMessage( ChangeType.ADD, entry );
             journal.put( entryCsn.toString(), replicaEventMessage );
             journal.sync();
@@ -315,36 +320,36 @@ public class JournalTest
 
             entryCsn = csnFactory.newInstance();
         }
-        
+
         long t1 = System.currentTimeMillis();
-        
+
         System.out.println( "Time to write 100 000 ReplicaEventMessages : " + ( t1 - t0 ) );
-        
+
         // The read perf
         long t2 = System.currentTimeMillis();
-        
+
         Cursor<Tuple<String, ReplicaEventMessage>> readCursor = journal.cursor();
 
         int pos = 0;
-        
+
         while ( readCursor.next() )
         {
             Tuple<String, ReplicaEventMessage> tuple = readCursor.get();
             ReplicaEventMessage replicaEventMessage = tuple.getValue();
-            
-            assertEquals( ChangeType.ADD, replicaEventMessage.getChangeType());
+
+            assertEquals( ChangeType.ADD, replicaEventMessage.getChangeType() );
             assertEquals( "test" + pos, replicaEventMessage.getEntry().get( "ou" ).getString() );
-            
+
             pos++;
         }
-        
+
         long t3 = System.currentTimeMillis();
-        
+
         System.out.println( "Time to read 100 000 ReplicaEventMessages : " + ( t3 - t2 ) );
 
         // The delete perf
         long t4 = System.currentTimeMillis();
-        
+
         Cursor<Tuple<String, ReplicaEventMessage>> deleteCursor = journal.cursor();
         int deleted = 0;
 
@@ -352,10 +357,10 @@ public class JournalTest
         {
             Tuple<String, ReplicaEventMessage> tuple = deleteCursor.get();
             ReplicaEventMessage replicaEventMessage = tuple.getValue();
-            
-            assertEquals( ChangeType.ADD, replicaEventMessage.getChangeType());
+
+            assertEquals( ChangeType.ADD, replicaEventMessage.getChangeType() );
             assertEquals( "test" + deleted, replicaEventMessage.getEntry().get( "ou" ).getString() );
-            
+
             journal.remove( replicaEventMessage.getEntry().get( "entryCsn" ).getString() );
             journal.sync();
             recman.commit();

Modified: directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java Tue Jan 24 16:15:05 2012
@@ -79,7 +79,7 @@ public class LdapServerSettingsTest
     public void testSetSaslMechanismHandlers()
     {
         LdapServer server = new LdapServer();
-        Map<String, MechanismHandler> handlers = new HashMap<String,MechanismHandler>();
+        Map<String, MechanismHandler> handlers = new HashMap<String, MechanismHandler>();
         MechanismHandler handler = new PlainMechanismHandler();
         handlers.put( SupportedSaslMechanisms.PLAIN, handler );
         server.setSaslMechanismHandlers( handlers );

Modified: directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java Tue Jan 24 16:15:05 2012
@@ -44,6 +44,7 @@ import org.apache.mina.core.session.IoSe
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * This test is simply used to test that handlers can be set properly.
  *
@@ -61,7 +62,7 @@ public class SettingAlternativeHandlersT
      * provider
      */
     @Test
-    public void testDefaultOperation() 
+    public void testDefaultOperation()
     {
         LdapServer ldapServer = new LdapServer();
         assertEquals( ldapServer.getName(), LdapServer.SERVICE_NAME );
@@ -89,19 +90,18 @@ public class SettingAlternativeHandlersT
         ldapServer.setSearchHandler( new BogusSearchHandler() );
         ldapServer.setUnbindHandler( new BogusUnbindHandler() );
 
-        assertEquals( ldapServer.getAbandonHandler().getClass(), BogusAbandonHandler.class  );
-        assertEquals( ldapServer.getAddHandler().getClass(), BogusAddHandler.class  );
-        assertEquals( ldapServer.getBindHandler().getClass(), BogusBindHandler.class  );
-        assertEquals( ldapServer.getCompareHandler().getClass(), BogusCompareHandler.class  );
-        assertEquals( ldapServer.getDeleteHandler().getClass(), BogusDeleteHandler.class  );
-        assertEquals( ldapServer.getModifyDnHandler().getClass(), BogusModifyDnHandler.class  );
-        assertEquals( ldapServer.getModifyHandler().getClass(), BogusModifyHandler.class  );
-        assertEquals( ldapServer.getSearchHandler().getClass(), BogusSearchHandler.class  );
-        assertEquals( ldapServer.getUnbindHandler().getClass(), BogusUnbindHandler.class  );
+        assertEquals( ldapServer.getAbandonHandler().getClass(), BogusAbandonHandler.class );
+        assertEquals( ldapServer.getAddHandler().getClass(), BogusAddHandler.class );
+        assertEquals( ldapServer.getBindHandler().getClass(), BogusBindHandler.class );
+        assertEquals( ldapServer.getCompareHandler().getClass(), BogusCompareHandler.class );
+        assertEquals( ldapServer.getDeleteHandler().getClass(), BogusDeleteHandler.class );
+        assertEquals( ldapServer.getModifyDnHandler().getClass(), BogusModifyDnHandler.class );
+        assertEquals( ldapServer.getModifyHandler().getClass(), BogusModifyHandler.class );
+        assertEquals( ldapServer.getSearchHandler().getClass(), BogusSearchHandler.class );
+        assertEquals( ldapServer.getUnbindHandler().getClass(), BogusUnbindHandler.class );
         assertEquals( ldapServer.getName(), LdapServer.SERVICE_NAME );
     }
 
-    
     public static class BogusAbandonHandler extends AbandonHandler
     {
         public void abandonMessageReceived( IoSession session, AbandonRequest request )
@@ -110,7 +110,6 @@ public class SettingAlternativeHandlersT
         }
     }
 
-    
     public static class BogusUnbindHandler extends UnbindHandler
     {
         public void unbindMessageReceived( IoSession session, UnbindRequest request )
@@ -148,7 +147,7 @@ public class SettingAlternativeHandlersT
         }
     }
 
-    public static class BogusDeleteHandler extends  DeleteHandler
+    public static class BogusDeleteHandler extends DeleteHandler
     {
         public void deleteMessageReceived( IoSession session, DeleteRequest request )
         {
@@ -156,7 +155,7 @@ public class SettingAlternativeHandlersT
         }
     }
 
-    public static class BogusModifyDnHandler extends  ModifyDnHandler
+    public static class BogusModifyDnHandler extends ModifyDnHandler
     {
         public void modifyDnMessageReceived( IoSession session, ModifyDnRequest request )
         {

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpException.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpException.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpException.java Tue Jan 24 16:15:05 2012
@@ -46,7 +46,7 @@ public class NtpException extends Except
      * @param message the message
      * @param cause the cause
      */
-    public NtpException(String message, Throwable cause)
+    public NtpException( String message, Throwable cause )
     {
         super( message, cause );
     }
@@ -57,7 +57,7 @@ public class NtpException extends Except
      * 
      * @param message the message
      */
-    public NtpException(String message)
+    public NtpException( String message )
     {
         super( message );
     }
@@ -66,7 +66,7 @@ public class NtpException extends Except
     /**
      * @param cause the cause
      */
-    public NtpException(Throwable cause)
+    public NtpException( Throwable cause )
     {
         super( cause );
     }

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java Tue Jan 24 16:15:05 2012
@@ -47,7 +47,7 @@ public class NtpServer extends AbstractP
 {
     /** logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( NtpServer.class.getName() );
-    
+
     /**
      * The default IP port.
      */
@@ -69,7 +69,7 @@ public class NtpServer extends AbstractP
         super.setServiceName( SERVICE_NAME_DEFAULT );
     }
 
-    
+
     /**
      * Start the NTPServer. We initialize the Datagram and Socket, if necessary.
      * 
@@ -80,79 +80,79 @@ public class NtpServer extends AbstractP
     public void start() throws IOException
     {
         IoHandler ntpProtocolHandler = new NtpProtocolHandler();
-        
+
         // Create the chain for the NTP server
         DefaultIoFilterChainBuilder ntpChain = new DefaultIoFilterChainBuilder();
         ntpChain.addLast( "codec", new ProtocolCodecFilter( NtpProtocolCodecFactory.getInstance() ) );
-        
+
         if ( ( transports == null ) || ( transports.size() == 0 ) )
         {
             // Default to UDP with port 123
             // We have to create a DatagramAcceptor
             UdpTransport transport = new UdpTransport( IP_PORT_DEFAULT );
             setTransports( transport );
-            
-            DatagramAcceptor acceptor = (DatagramAcceptor)transport.getAcceptor();
+
+            DatagramAcceptor acceptor = ( DatagramAcceptor ) transport.getAcceptor();
 
             // Set the handler
             acceptor.setHandler( ntpProtocolHandler );
-    
+
             // Allow the port to be reused even if the socket is in TIME_WAIT state
-            ((DatagramSessionConfig)acceptor.getSessionConfig()).setReuseAddress( true );
-    
+            ( ( DatagramSessionConfig ) acceptor.getSessionConfig() ).setReuseAddress( true );
+
             // Inject the chain
             acceptor.setFilterChainBuilder( ntpChain );
-            
+
             // Start the listener
             acceptor.bind();
         }
         else
         {
-            for ( Transport transport:transports )
+            for ( Transport transport : transports )
             {
                 IoAcceptor acceptor = transport.getAcceptor();
 
                 // Set the handler
                 acceptor.setHandler( ntpProtocolHandler );
-                
+
                 if ( transport instanceof UdpTransport )
                 {
                     // Allow the port to be reused even if the socket is in TIME_WAIT state
-                    ((DatagramSessionConfig)acceptor.getSessionConfig()).setReuseAddress( true );
+                    ( ( DatagramSessionConfig ) acceptor.getSessionConfig() ).setReuseAddress( true );
                 }
                 else
                 {
                     // Disable the disconnection of the clients on unbind
                     acceptor.setCloseOnDeactivation( false );
-                    
+
                     // Allow the port to be reused even if the socket is in TIME_WAIT state
-                    ((SocketAcceptor)acceptor).setReuseAddress( true );
-                    
+                    ( ( SocketAcceptor ) acceptor ).setReuseAddress( true );
+
                     // No Nagle's algorithm
-                    ((SocketAcceptor)acceptor).getSessionConfig().setTcpNoDelay( true );
+                    ( ( SocketAcceptor ) acceptor ).getSessionConfig().setTcpNoDelay( true );
                 }
-                
+
                 // Inject the chain
                 acceptor.setFilterChainBuilder( ntpChain );
-    
+
                 // Start the listener
                 acceptor.bind();
             }
         }
-        
+
         LOG.info( "NTP server started." );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
     public void stop()
     {
-        for ( Transport transport :getTransports() )
+        for ( Transport transport : getTransports() )
         {
             IoAcceptor acceptor = transport.getAcceptor();
-            
+
             if ( acceptor != null )
             {
                 acceptor.dispose();
@@ -161,25 +161,25 @@ public class NtpServer extends AbstractP
 
         LOG.info( "NTP Server stopped." );
     }
-    
-    
+
+
     /**
      * @see Object#toString()
      */
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( "NTPServer[" ).append( getServiceName() ).append( "], listening on :" ).append( '\n' );
-        
+
         if ( getTransports() != null )
         {
-            for ( Transport transport:getTransports() )
+            for ( Transport transport : getTransports() )
             {
                 sb.append( "    " ).append( transport ).append( '\n' );
             }
         }
-        
+
         return sb.toString();
     }
 }

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/package-info.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.ntp.io;
+
+

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java Tue Jan 24 16:15:05 2012
@@ -145,7 +145,7 @@ public class NtpTimeStamp
         int hash = 37;
         hash = hash * 17 + Long.valueOf( seconds ).hashCode();
         hash = hash * 17 + Long.valueOf( fraction ).hashCode();
-        
+
         return hash;
     }
 

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java Tue Jan 24 16:15:05 2012
@@ -248,8 +248,8 @@ public class ReferenceIdentifier impleme
     {
         return ordinal - that.ordinal;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -257,8 +257,8 @@ public class ReferenceIdentifier impleme
     {
         return ordinal;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -268,14 +268,14 @@ public class ReferenceIdentifier impleme
         {
             return true;
         }
-        
-        if ( ! ( that instanceof ReferenceIdentifier ) )
+
+        if ( !( that instanceof ReferenceIdentifier ) )
         {
             return false;
         }
-        
-        ReferenceIdentifier thatRef = (ReferenceIdentifier)that;
-        
+
+        ReferenceIdentifier thatRef = ( ReferenceIdentifier ) that;
+
         return ordinal == thatRef.ordinal;
     }
 

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/package-info.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.ntp.messages;
+
+

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/package-info.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/package-info.java Tue Jan 24 16:15:05 2012
@@ -28,3 +28,5 @@
  */
 
 package org.apache.directory.server.ntp;
+
+

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/package-info.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/package-info.java Tue Jan 24 16:15:05 2012
@@ -27,3 +27,5 @@
  */
 
 package org.apache.directory.server.ntp.protocol;
+
+

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/service/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/service/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/service/package-info.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/service/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.ntp.service;
+
+



Mime
View raw message