directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1447061 - in /directory/shared/trunk/ldap: client/api/src/main/java/org/apache/directory/ldap/client/api/ model/src/main/java/org/apache/directory/api/ldap/model/constants/ model/src/main/java/org/apache/directory/api/ldap/model/cursor/
Date Sun, 17 Feb 2013 19:31:38 GMT
Author: elecharny
Date: Sun Feb 17 19:31:38 2013
New Revision: 1447061

URL: http://svn.apache.org/r1447061
Log:
o Used the Loggers class instead of declaring a string for logs
o Added some new dedicated loggers in the Loggers class

Modified:
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/Loggers.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/EmptyCursor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/ListCursor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SingletonCursor.java

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java?rev=1447061&r1=1447060&r2=1447061&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
Sun Feb 17 19:31:38 2013
@@ -24,6 +24,7 @@ package org.apache.directory.ldap.client
 import java.io.IOException;
 
 import org.apache.directory.api.i18n.I18n;
+import org.apache.directory.api.ldap.model.constants.Loggers;
 import org.apache.directory.api.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
 import org.apache.directory.api.ldap.model.cursor.CursorLdapReferralException;
@@ -51,7 +52,7 @@ import org.slf4j.LoggerFactory;
 public class EntryCursorImpl extends AbstractCursor<Entry> implements EntryCursor
 {
     /** A dedicated log for cursors */
-    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( Loggers.CURSOR_LOG.getName()
);
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java?rev=1447061&r1=1447060&r2=1447061&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
Sun Feb 17 19:31:38 2013
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.directory.api.i18n.I18n;
+import org.apache.directory.api.ldap.model.constants.Loggers;
 import org.apache.directory.api.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
 import org.apache.directory.api.ldap.model.cursor.InvalidCursorPositionException;
@@ -52,7 +53,7 @@ import org.slf4j.LoggerFactory;
 public class SearchCursorImpl extends AbstractCursor<Response> implements SearchCursor
 {
     /** A dedicated log for cursors */
-    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( Loggers.CURSOR_LOG.getName()
);
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
@@ -89,7 +90,7 @@ public class SearchCursorImpl extends Ab
         {
             LOG_CURSOR.debug( "Creating SearchCursorImpl {}", this );
         }
-        
+
         this.future = future;
         this.timeout = timeout;
         this.timeUnit = timeUnit;
@@ -194,7 +195,7 @@ public class SearchCursorImpl extends Ab
         {
             LOG_CURSOR.debug( "Closing SearchCursorImpl {}", this );
         }
-        
+
         close( null );
     }
 
@@ -209,7 +210,7 @@ public class SearchCursorImpl extends Ab
         {
             LOG_CURSOR.debug( "Closing SearchCursorImpl {}", this );
         }
-        
+
         if ( done )
         {
             super.close();

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/Loggers.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/Loggers.java?rev=1447061&r1=1447060&r2=1447061&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/Loggers.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/Loggers.java
Sun Feb 17 19:31:38 2013
@@ -31,7 +31,25 @@ package org.apache.directory.api.ldap.mo
 public enum Loggers
 {
     /** The dedicated logger for ACIs */
-    ACI_LOG("aci-logger");
+    ACI_LOG("org.apache.directory.server.ACI_LOG"),
+
+    /** The dedicated logs for the replication consumer */
+    CONSUMER_LOG("org.apache.directory.server.CONSUMER_LOG"),
+
+    /** The dedicated logs for the cursors */
+    CURSOR_LOG("org.apache.directory.CURSOR_LOG"),
+
+    /** The dedicated logs for the replication provider */
+    PROVIDER_LOG("org.apache.directory.server.PROVIDER_LOG"),
+
+    /** The dedicated logs for operation statistics */
+    OPERATION_STAT("org.apache.directory.server.OPERATION_STAT"),
+
+    /** The dedicated logs for operation execution time */
+    OPERATION_TIME("org.apache.directory.server.OPERATION_TIME"),
+
+    /** The dedicated logger for KERBEROS */
+    KERBEROS_LOG("org.apache.directory.server.KERBEROS_LOG");
 
     /** The associated name */
     private String name;

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/EmptyCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/EmptyCursor.java?rev=1447061&r1=1447060&r2=1447061&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/EmptyCursor.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/EmptyCursor.java
Sun Feb 17 19:31:38 2013
@@ -22,6 +22,7 @@ package org.apache.directory.api.ldap.mo
 import java.io.IOException;
 
 import org.apache.directory.api.i18n.I18n;
+import org.apache.directory.api.ldap.model.constants.Loggers;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -36,11 +37,12 @@ import org.slf4j.LoggerFactory;
 public class EmptyCursor<E> extends AbstractCursor<E>
 {
     /** A dedicated log for cursors */
-    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( Loggers.CURSOR_LOG.getName()
);
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
 
+
     public EmptyCursor()
     {
         if ( IS_DEBUG )
@@ -48,7 +50,8 @@ public class EmptyCursor<E> extends Abst
             LOG_CURSOR.debug( "Creating EmptyCursor : {}", this );
         }
     }
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -154,7 +157,7 @@ public class EmptyCursor<E> extends Abst
         {
             LOG_CURSOR.debug( "Closing EmptyCursor {}", this );
         }
-        
+
         super.close();
     }
 
@@ -169,7 +172,7 @@ public class EmptyCursor<E> extends Abst
         {
             LOG_CURSOR.debug( "Closing EmptyCursor {}", this );
         }
-        
+
         super.close( cause );
     }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/ListCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/ListCursor.java?rev=1447061&r1=1447060&r2=1447061&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/ListCursor.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/ListCursor.java
Sun Feb 17 19:31:38 2013
@@ -25,6 +25,7 @@ import java.util.Comparator;
 import java.util.List;
 
 import org.apache.directory.api.i18n.I18n;
+import org.apache.directory.api.ldap.model.constants.Loggers;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,7 +41,7 @@ import org.slf4j.LoggerFactory;
 public class ListCursor<E> extends AbstractCursor<E>
 {
     /** A dedicated log for cursors */
-    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( Loggers.CURSOR_LOG.getName()
);
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
@@ -57,7 +58,7 @@ public class ListCursor<E> extends Abstr
     /** The ending position for the cursor in the list. It can be < List.size() */
     private final int end;
     /** The current position in the list */
-    
+
     private int index = -1;
 
 
@@ -102,7 +103,7 @@ public class ListCursor<E> extends Abstr
         {
             LOG_CURSOR.debug( "Creating ListCursor {}", this );
         }
-        
+
         this.comparator = comparator;
         this.list = list;
         this.start = start;
@@ -509,7 +510,7 @@ public class ListCursor<E> extends Abstr
         {
             LOG_CURSOR.debug( "Closing ListCursor {}", this );
         }
-        
+
         super.close();
     }
 
@@ -524,7 +525,7 @@ public class ListCursor<E> extends Abstr
         {
             LOG_CURSOR.debug( "Closing ListCursor {}", this );
         }
-        
+
         super.close( cause );
     }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java?rev=1447061&r1=1447060&r2=1447061&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java
Sun Feb 17 19:31:38 2013
@@ -25,6 +25,7 @@ import java.util.Comparator;
 import java.util.Set;
 
 import org.apache.directory.api.i18n.I18n;
+import org.apache.directory.api.ldap.model.constants.Loggers;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,7 +41,7 @@ import org.slf4j.LoggerFactory;
 public class SetCursor<E> extends AbstractCursor<E>
 {
     /** A dedicated log for cursors */
-    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( Loggers.CURSOR_LOG.getName()
);
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
@@ -76,7 +77,7 @@ public class SetCursor<E> extends Abstra
         {
             LOG_CURSOR.debug( "Creating SetCursor {}", this );
         }
-        
+
         this.comparator = comparator;
         this.set = ( E[] ) set.toArray();
     }
@@ -394,7 +395,7 @@ public class SetCursor<E> extends Abstra
         {
             LOG_CURSOR.debug( "Closing ListCursor {}", this );
         }
-        
+
         super.close();
     }
 
@@ -409,10 +410,10 @@ public class SetCursor<E> extends Abstra
         {
             LOG_CURSOR.debug( "Closing ListCursor {}", this );
         }
-        
+
         super.close( cause );
     }
-    
+
 
     /**
      * @see Object#toString()
@@ -420,7 +421,7 @@ public class SetCursor<E> extends Abstra
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "SetCursor :\n" );
         sb.append( tabs ).append( "    Index : " ).append( index ).append( "\n" );
 
@@ -429,23 +430,23 @@ public class SetCursor<E> extends Abstra
             sb.append( tabs ).append( "    Size : " ).append( set.length ).append( "\n" );
 
             int counter = 0; // Don't print more than 100 elements...
-            
+
             for ( E e : set )
             {
                 sb.append( tabs ).append( "    " ).append( e ).append( "\n" );
                 counter++;
-                
-                if (counter == 100 )
+
+                if ( counter == 100 )
                 {
                     break;
                 }
             }
         }
-        
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * @see Object#toString()
      */

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SingletonCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SingletonCursor.java?rev=1447061&r1=1447060&r2=1447061&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SingletonCursor.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SingletonCursor.java
Sun Feb 17 19:31:38 2013
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.Comparator;
 
 import org.apache.directory.api.i18n.I18n;
+import org.apache.directory.api.ldap.model.constants.Loggers;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,7 +38,7 @@ import org.slf4j.LoggerFactory;
 public class SingletonCursor<E> extends AbstractCursor<E>
 {
     /** A dedicated log for cursors */
-    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( Loggers.CURSOR_LOG.getName()
);
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
@@ -82,7 +83,7 @@ public class SingletonCursor<E> extends 
         {
             LOG_CURSOR.debug( "Creating SingletonCursor {}", this );
         }
-        
+
         this.singleton = singleton;
         this.comparator = comparator;
     }
@@ -332,7 +333,7 @@ public class SingletonCursor<E> extends 
         {
             LOG_CURSOR.debug( "Closing SingletonCursor {}", this );
         }
-        
+
         super.close();
     }
 
@@ -347,7 +348,7 @@ public class SingletonCursor<E> extends 
         {
             LOG_CURSOR.debug( "Closing SingletonCursor {}", this );
         }
-        
+
         super.close( cause );
     }
 }



Mime
View raw message