directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1152102 - in /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event: EventType.java NotificationCriteria.java RegistrationEntry.java
Date Fri, 29 Jul 2011 04:54:02 GMT
Author: elecharny
Date: Fri Jul 29 04:54:00 2011
New Revision: 1152102

URL: http://svn.apache.org/viewvc?rev=1152102&view=rev
Log:
Added Javadoc and toString() methods

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/RegistrationEntry.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java?rev=1152102&r1=1152101&r2=1152102&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java
Fri Jul 29 04:54:00 2011
@@ -219,7 +219,13 @@ public enum EventType
     }
     
     
-    public String toString( int mask )
+    /**
+     * Print the flags
+     * 
+     * @param mask the flags value to print
+     * @return A textual version of the mask
+     */
+    public static String toString( int mask )
     {
         switch ( mask )
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java?rev=1152102&r1=1152101&r2=1152102&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java
Fri Jul 29 04:54:00 2011
@@ -190,11 +190,11 @@ public class NotificationCriteria
         StringBuilder sb = new StringBuilder();
         
         sb.append( "Notification criteria : " );
-        sb.append( "(" ).append( base ).append( "), " );
-        sb.append( "(" ).append( filter ).append( "), " );
-        sb.append( "(" ).append( scope ).append( "), " );
-        sb.append( "(" ).append( aliasDerefMode ).append( "), " );
-        sb.append( "(" ).append( eventMask ).append( ")" );
+        sb.append( '\'' ).append( base ).append( "', " );
+        sb.append( '\'' ).append( filter ).append( "', " );
+        sb.append( '\'' ).append( scope ).append( "', " );
+        sb.append( '\'' ).append( aliasDerefMode ).append( "', " );
+        sb.append( '\'' ).append( EventType.toString( eventMask ) ).append( '\'' );
         
         return sb.toString();
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/RegistrationEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/RegistrationEntry.java?rev=1152102&r1=1152101&r2=1152102&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/RegistrationEntry.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/RegistrationEntry.java
Fri Jul 29 04:54:00 2011
@@ -27,16 +27,29 @@ package org.apache.directory.server.core
  */
 public class RegistrationEntry
 {
+    /** The associated listener */
     private final DirectoryListener listener;
+    
+    /** The notification criteria */
     private final NotificationCriteria criteria;
 
     
+    /**
+     * Creates a new instance of RegistrationEntry associated with a listener
+     * @param listener The associated listener
+     */
     RegistrationEntry( DirectoryListener listener )
     {
         this( listener, new NotificationCriteria() );
     }
 
     
+    /**
+     * Creates a new instance of RegistrationEntry associated with a listener
+     * and a notification criteria
+     * @param listener The associated listener
+     * @param criteria The notification criteria
+     */
     RegistrationEntry( DirectoryListener listener, NotificationCriteria criteria )
     {
         this.listener = listener;
@@ -60,4 +73,22 @@ public class RegistrationEntry
     {
         return listener;
     }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( listener ).append( '/' );
+        
+        if ( criteria != null )
+        {
+            sb.append( criteria.toString() );
+        }
+        
+        return sb.toString();
+    }
 }
\ No newline at end of file



Mime
View raw message