directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1427890 - in /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap: LdapServer.java replication/SyncReplConfiguration.java
Date Wed, 02 Jan 2013 18:21:40 GMT
Author: elecharny
Date: Wed Jan  2 18:21:39 2013
New Revision: 1427890

URL: http://svn.apache.org/viewvc?rev=1427890&view=rev
Log:
Minor formatting

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=1427890&r1=1427889&r2=1427890&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Wed Jan  2 18:21:39 2013
@@ -130,7 +130,7 @@ public class LdapServer extends Director
 
     /** logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( LdapServer.class.getName()
);
-    
+
     /** Logger for the replication consumer */
     private static final Logger CONSUMER_LOG = LoggerFactory.getLogger( "CONSUMER_LOG" );
 
@@ -213,7 +213,7 @@ public class LdapServer extends Director
     private LdapRequestHandler<ModifyDnRequest> modifyDnRequestHandler;
     private LdapRequestHandler<SearchRequest> searchRequestHandler;
     private LdapRequestHandler<UnbindRequest> unbindRequestHandler;
-    
+
     // MessageSent handlers
     private LdapResponseHandler<AddResponse> addResponseHandler;
     private LdapResponseHandler<BindResponse> bindResponseHandler;
@@ -242,6 +242,7 @@ public class LdapServer extends Director
      */
     private boolean confidentialityRequired;
 
+    /** The used Keystore */
     private KeyStore keyStore = null;
 
     private List<IoFilterChainBuilder> chainBuilders = new ArrayList<IoFilterChainBuilder>();
@@ -251,7 +252,8 @@ public class LdapServer extends Director
     private List<ReplicationConsumer> replConsumers;
 
     private KeyManagerFactory keyManagerFactory;
-    
+
+
     /**
      * Creates an LDAP protocol provider.
      */
@@ -294,7 +296,7 @@ public class LdapServer extends Director
         {
             BindRequestHandler bindRequestHandler = new BindRequestHandler();
             bindRequestHandler.setSaslMechanismHandlers( saslMechanismHandlers );
-            
+
             setBindHandlers( bindRequestHandler, new BindResponseHandler() );
         }
 
@@ -330,11 +332,10 @@ public class LdapServer extends Director
 
         if ( getSearchRequestHandler() == null )
         {
-            setSearchHandlers( new SearchRequestHandler(), 
+            setSearchHandlers( new SearchRequestHandler(),
                 new SearchResultEntryHandler(),
                 new SearchResultReferenceHandler(),
-                new SearchResultDoneHandler()
-                );
+                new SearchResultDoneHandler() );
         }
 
         if ( getUnbindRequestHandler() == null )
@@ -386,7 +387,7 @@ public class LdapServer extends Director
                 }
             }
         }
-        
+
         // Set up key manager factory to use our key store
         String algorithm = Security.getProperty( "ssl.KeyManagerFactory.algorithm" );
 
@@ -394,9 +395,9 @@ public class LdapServer extends Director
         {
             algorithm = KeyManagerFactory.getDefaultAlgorithm();
         }
-        
+
         keyManagerFactory = KeyManagerFactory.getInstance( algorithm );
-        
+
         if ( Strings.isEmpty( certificatePassword ) )
         {
             keyManagerFactory.init( keyStore, null );
@@ -431,7 +432,8 @@ public class LdapServer extends Director
             DefaultIoFilterChainBuilder dfcb = ( ( DefaultIoFilterChainBuilder ) chainBuilder
);
             if ( dfcb.contains( sslFilterName ) )
             {
-                DefaultIoFilterChainBuilder newChain = ( DefaultIoFilterChainBuilder ) LdapsInitializer.init(
keyManagerFactory );
+                DefaultIoFilterChainBuilder newChain = ( DefaultIoFilterChainBuilder ) LdapsInitializer
+                    .init( keyManagerFactory );
                 dfcb.replace( sslFilterName, newChain.get( sslFilterName ) );
                 newChain = null;
             }
@@ -459,7 +461,7 @@ public class LdapServer extends Director
         }
 
         loadKeyStore();
-        
+
         for ( Transport transport : transports )
         {
             if ( !( transport instanceof TcpTransport ) )
@@ -469,7 +471,7 @@ public class LdapServer extends Director
             }
 
             IoFilterChainBuilder chain;
-            
+
             if ( transport.isSSLEnabled() )
             {
                 chain = LdapsInitializer.init( keyManagerFactory );
@@ -693,7 +695,7 @@ public class LdapServer extends Director
         {
             final PingerThread pingerThread = new PingerThread();
             pingerThread.start();
-            
+
             for ( final ReplicationConsumer consumer : replConsumers )
             {
                 consumer.init( getDirectoryService() );
@@ -710,22 +712,24 @@ public class LdapServer extends Director
                                 {
                                     MDC.put( "Replica", consumer.getId() );
                                 }
-                                
+
                                 LOG.info( "starting the replication consumer with {}", consumer
);
                                 CONSUMER_LOG.info( "starting the replication consumer with
{}", consumer );
                                 boolean isConnected = consumer.connect( ReplicationConsumer.NOW
);
-                                
+
                                 if ( isConnected )
                                 {
                                     pingerThread.addConsumer( consumer );
 
                                     // We are now connected, start the replication
                                     ReplicationStatusEnum status = null;
-                                    
-                                    do {
+
+                                    do
+                                    {
                                         status = consumer.startSync();
-                                    } while ( status == ReplicationStatusEnum.REFRESH_REQUIRED
);
-                                    
+                                    }
+                                    while ( status == ReplicationStatusEnum.REFRESH_REQUIRED
);
+
                                     if ( status == ReplicationStatusEnum.STOPPED )
                                     {
                                         // Exit the loop
@@ -1099,7 +1103,7 @@ public class LdapServer extends Director
     {
         super.setDirectoryService( directoryService );
         Iterator<String> itr = directoryService.getLdapCodecService().registeredControls();
-        while( itr.hasNext() )
+        while ( itr.hasNext() )
         {
             supportedControls.add( itr.next() );
         }
@@ -1159,14 +1163,14 @@ public class LdapServer extends Director
      * @param addRequestHandler The AddRequest message received handler
      * @param addResponseHandler The AddResponse message sent handler
      */
-    public void setAddHandlers( LdapRequestHandler<AddRequest> addRequestHandler, 
+    public void setAddHandlers( LdapRequestHandler<AddRequest> addRequestHandler,
         LdapResponseHandler<AddResponse> addResponseHandler )
     {
         this.handler.removeReceivedMessageHandler( AddRequest.class );
         this.addRequestHandler = addRequestHandler;
         this.addRequestHandler.setLdapServer( this );
         this.handler.addReceivedMessageHandler( AddRequest.class, this.addRequestHandler
);
-        
+
         this.handler.removeSentMessageHandler( AddResponse.class );
         this.addResponseHandler = addResponseHandler;
         this.addResponseHandler.setLdapServer( this );
@@ -1199,13 +1203,13 @@ public class LdapServer extends Director
      * @param bindResponseHandler The BindResponse message sent handler
      */
     public void setBindHandlers( LdapRequestHandler<BindRequest> bindRequestHandler,
-        LdapResponseHandler<BindResponse> bindResponseHandler)
+        LdapResponseHandler<BindResponse> bindResponseHandler )
     {
         handler.removeReceivedMessageHandler( BindRequest.class );
         this.bindRequestHandler = bindRequestHandler;
         this.bindRequestHandler.setLdapServer( this );
         handler.addReceivedMessageHandler( BindRequest.class, this.bindRequestHandler );
-        
+
         handler.removeSentMessageHandler( BindResponse.class );
         this.bindResponseHandler = bindResponseHandler;
         this.bindResponseHandler.setLdapServer( this );
@@ -1238,7 +1242,7 @@ public class LdapServer extends Director
      * @param compareResponseHandler The CompareResponse message sent handler
      */
     public void setCompareHandlers( LdapRequestHandler<CompareRequest> compareRequestHandler,
-        LdapResponseHandler<CompareResponse> compareResponseHandler)
+        LdapResponseHandler<CompareResponse> compareResponseHandler )
     {
         handler.removeReceivedMessageHandler( CompareRequest.class );
         this.compareRequestHandler = compareRequestHandler;
@@ -1277,7 +1281,7 @@ public class LdapServer extends Director
      * @param deleteResponseHandler The DeleteResponse message sent handler
      */
     public void setDeleteHandlers( LdapRequestHandler<DeleteRequest> deleteRequestHandler,
-        LdapResponseHandler<DeleteResponse> deleteResponseHandler)
+        LdapResponseHandler<DeleteResponse> deleteResponseHandler )
     {
         handler.removeReceivedMessageHandler( DeleteRequest.class );
         this.deleteRequestHandler = deleteRequestHandler;
@@ -1298,8 +1302,8 @@ public class LdapServer extends Director
     {
         return extendedRequestHandler;
     }
-    
-    
+
+
     /**
      * @return The MessageSent handler for the ExtendedResponse
      */
@@ -1323,12 +1327,13 @@ public class LdapServer extends Director
         handler.removeReceivedMessageHandler( ExtendedRequest.class );
         this.extendedRequestHandler = extendedRequestHandler;
         this.extendedRequestHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( ExtendedRequest.class, ( LdapRequestHandler
) this.extendedRequestHandler );
+        this.handler.addReceivedMessageHandler( ExtendedRequest.class,
+            ( LdapRequestHandler ) this.extendedRequestHandler );
 
         handler.removeSentMessageHandler( ExtendedResponse.class );
         this.extendedResponseHandler = extendedResponseHandler;
         this.extendedResponseHandler.setLdapServer( this );
-        this.handler.addSentMessageHandler( ExtendedResponse.class, ( LdapResponseHandler
) this.extendedResponseHandler );
+        this.handler.addSentMessageHandler( ExtendedResponse.class, this.extendedResponseHandler
);
     }
 
 
@@ -1346,7 +1351,7 @@ public class LdapServer extends Director
      * 
      * @param intermediateResponseHandler The IntermediateResponse message sent handler
      */
-    public void setIntermediateHandler( LdapResponseHandler<IntermediateResponse> intermediateResponseHandler)
+    public void setIntermediateHandler( LdapResponseHandler<IntermediateResponse> intermediateResponseHandler
)
     {
         handler.removeSentMessageHandler( IntermediateResponse.class );
         this.intermediateResponseHandler = intermediateResponseHandler;
@@ -1380,7 +1385,7 @@ public class LdapServer extends Director
      * @param modifyResponseHandler The ModifyResponse message sent handler
      */
     public void setModifyHandlers( LdapRequestHandler<ModifyRequest> modifyRequestHandler,
-        LdapResponseHandler<ModifyResponse> modifyResponseHandler)
+        LdapResponseHandler<ModifyResponse> modifyResponseHandler )
     {
         handler.removeReceivedMessageHandler( ModifyRequest.class );
         this.modifyRequestHandler = modifyRequestHandler;
@@ -1419,13 +1424,13 @@ public class LdapServer extends Director
      * @param modifyDnResponseHandler The ModifyDnResponse message sent handler
      */
     public void setModifyDnHandlers( LdapRequestHandler<ModifyDnRequest> modifyDnRequestHandler,
-        LdapResponseHandler<ModifyDnResponse> modifyDnResponseHandler)
+        LdapResponseHandler<ModifyDnResponse> modifyDnResponseHandler )
     {
         handler.removeReceivedMessageHandler( ModifyDnRequest.class );
         this.modifyDnRequestHandler = modifyDnRequestHandler;
         this.modifyDnRequestHandler.setLdapServer( this );
         this.handler.addReceivedMessageHandler( ModifyDnRequest.class, this.modifyDnRequestHandler
);
-        
+
         handler.removeSentMessageHandler( ModifyDnResponse.class );
         this.modifyDnResponseHandler = modifyDnResponseHandler;
         this.modifyDnResponseHandler.setLdapServer( this );
@@ -1655,8 +1660,8 @@ public class LdapServer extends Director
     {
         return keyManagerFactory;
     }
-    
-    
+
+
     /**
      * @return The maximum allowed size for an incoming PDU
      */
@@ -1681,7 +1686,7 @@ public class LdapServer extends Director
         this.maxPDUSize = maxPDUSize;
     }
 
-    
+
     /**
      * @see Object#toString()
      */

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java?rev=1427890&r1=1427889&r2=1427890&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java
Wed Jan  2 18:21:39 2013
@@ -160,8 +160,8 @@ public class SyncReplConfiguration imple
         this.remoteHost = remoteHost;
         producer = remoteHost + ":" + remotePort;
     }
-    
-    
+
+
     /**
      * A convenient method that concatenates the host and port of the producer
      * @return The <host>:<port> the consumer is connected to
@@ -319,7 +319,7 @@ public class SyncReplConfiguration imple
     public void setAttributes( String[] attrs )
     {
         attributes.clear();
-        
+
         for ( String attr : attrs )
         {
             attributes.add( attr );
@@ -571,25 +571,25 @@ public class SyncReplConfiguration imple
         this.mmrMode = mmrMode;
     }
 
-    
+
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( "[" );
-        sb.append( "rid:" ).append( replicaId ).append( ", " ); 
-        sb.append( "base:'" ).append( baseDn ).append( "', " ); 
+        sb.append( "rid:" ).append( replicaId ).append( ", " );
+        sb.append( "base:'" ).append( baseDn ).append( "', " );
         sb.append( "filter:" ).append( filter ).append( ", " );
-        sb.append( "scope:" ).append( searchScope ).append( ", " ); 
-        sb.append( "alias:" ).append( aliasDerefMode ).append( ", " ); 
-        sb.append( "chase referrals:" ).append( chaseReferrals ).append( ", " ); 
+        sb.append( "scope:" ).append( searchScope ).append( ", " );
+        sb.append( "alias:" ).append( aliasDerefMode ).append( ", " );
+        sb.append( "chase referrals:" ).append( chaseReferrals ).append( ", " );
 
         boolean isFirst = true;
-        
+
         if ( attributes != null )
         {
             sb.append( "attributes:{" );
-            
+
             for ( String attribute : attributes )
             {
                 if ( isFirst )
@@ -600,22 +600,22 @@ public class SyncReplConfiguration imple
                 {
                     sb.append( "/" );
                 }
-                
+
                 sb.append( attribute );
             }
-            
+
             sb.append( "}, " );
         }
-        
+
         if ( refreshNPersist )
         {
-            sb.append( "refresh:" ).append( refreshInterval ).append( ", " ); 
+            sb.append( "refresh:" ).append( refreshInterval ).append( ", " );
         }
         else
         {
-            sb.append( "refreshOnly, ");
+            sb.append( "refreshOnly, " );
         }
-        
+
         if ( mmrMode )
         {
             sb.append( "MMR, " );
@@ -624,17 +624,16 @@ public class SyncReplConfiguration imple
         {
             sb.append( "MS, " );
         }
-        
-        sb.append( "provider:" ).append( producer ).append( ", " ); 
-        sb.append( "user:'" ).append( replUserDn ).append( "', " ); 
-        
+
+        sb.append( "provider:" ).append( producer ).append( ", " );
+        sb.append( "user:'" ).append( replUserDn ).append( "', " );
+
         if ( strictCertVerification )
         {
             sb.append( "strict" ).append( ", " );
         }
 
         sb.append( "TLS:" ).append( useTls ).append( "]" );
-        
 
         return sb.toString();
     }



Mime
View raw message