directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1306983 - in /directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering: BaseEntryFilteringCursor.java CursorList.java EntryFilteringCursor.java
Date Thu, 29 Mar 2012 16:51:39 GMT
Author: elecharny
Date: Thu Mar 29 16:51:39 2012
New Revision: 1306983

URL: http://svn.apache.org/viewvc?rev=1306983&view=rev
Log:
javadoc additiona nd minor refactoring

Modified:
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/EntryFilteringCursor.java

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java?rev=1306983&r1=1306982&r2=1306983&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
Thu Mar 29 16:51:39 2012
@@ -29,6 +29,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.entry.ClonedServerEntrySearch;
 import org.apache.directory.server.core.api.interceptor.context.SearchingOperationContext;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.ClosureMonitor;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.cursor.CursorIterator;
@@ -160,7 +161,6 @@ public class BaseEntryFilteringCursor im
         return filters.add( filter );
     }
 
-
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#removeEntryFilter(org.apache.directory.server.core.filtering.EntryFilter)
      */
@@ -169,9 +169,8 @@ public class BaseEntryFilteringCursor im
         return filters.remove( filter );
     }
 
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#getEntryFilters()
+    /**
+     * {@inheritDoc}
      */
     public List<EntryFilter> getEntryFilters()
     {
@@ -179,8 +178,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#getOperationContext()
+    /**
+     * {@inheritDoc}
      */
     public SearchingOperationContext getOperationContext()
     {
@@ -191,7 +190,6 @@ public class BaseEntryFilteringCursor im
     // ------------------------------------------------------------------------
     // Cursor Interface Methods
     // ------------------------------------------------------------------------
-
     /* 
      * @see Cursor#after(Object)
      */
@@ -204,11 +202,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#afterLast()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#afterLast()
+    /**
+     * {@inheritDoc}
      */
     public void afterLast() throws Exception
     {
@@ -217,11 +212,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#available()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#available()
+    /**
+     * {@inheritDoc}
      */
     public boolean available()
     {
@@ -241,11 +233,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#beforeFirst()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#beforeFirst()
+    /**
+     * {@inheritDoc}
      */
     public void beforeFirst() throws Exception
     {
@@ -254,11 +243,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#close()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#close()
+    /**
+     * {@inheritDoc}
      */
     public void close() throws Exception
     {
@@ -267,11 +253,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#close()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#close()
+    /**
+     * {@inheritDoc}
      */
     public void close( Exception reason ) throws Exception
     {
@@ -286,11 +269,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#first()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#first()
+    /**
+     * {@inheritDoc}
      */
     public boolean first() throws Exception
     {
@@ -302,15 +282,13 @@ public class BaseEntryFilteringCursor im
         }
 
         beforeFirst();
+        
         return next();
     }
 
 
-    /* 
-     * @see Cursor#get()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#get()
+    /**
+     * {@inheritDoc}
      */
     public Entry get() throws Exception
     {
@@ -323,11 +301,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#isClosed()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#isClosed()
+    /**
+     * {@inheritDoc}
      */
     public boolean isClosed() throws Exception
     {
@@ -335,11 +310,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#last()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#last()
+    /**
+     * {@inheritDoc}
      */
     public boolean last() throws Exception
     {
@@ -351,6 +323,7 @@ public class BaseEntryFilteringCursor im
         }
 
         afterLast();
+        
         return previous();
     }
 
@@ -475,11 +448,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#next()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#next()
+    /**
+     * {@inheritDoc}
      */
     public boolean next() throws Exception
     {
@@ -533,7 +503,7 @@ public class BaseEntryFilteringCursor im
             for ( EntryFilter filter : filters )
             {
                 // if a filter rejects then short and continue with outer loop
-                if ( !( accepted &= filter.accept( getOperationContext(), tempResult
) ) )
+                if ( !filter.accept( getOperationContext(), tempResult ) )
                 {
                     continue outer;
                 }
@@ -553,11 +523,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Cursor#previous()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#previous()
+    /**
+     * {@inheritDoc}
      */
     public boolean previous() throws Exception
     {
@@ -602,7 +569,7 @@ public class BaseEntryFilteringCursor im
             for ( EntryFilter filter : filters )
             {
                 // if a filter rejects then short and continue with outer loop
-                if ( !( accepted &= filter.accept( getOperationContext(), tempResult
) ) )
+                if ( !filter.accept( getOperationContext(), tempResult ) )
                 {
                     continue outer;
                 }
@@ -613,6 +580,7 @@ public class BaseEntryFilteringCursor im
              */
             prefetched = tempResult;
             filterContents( prefetched );
+            
             return true;
         }
 
@@ -622,11 +590,8 @@ public class BaseEntryFilteringCursor im
     }
 
 
-    /* 
-     * @see Iterable#iterator()
-     */
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.filtering.EntryFilteringCursor#iterator()
+    /**
+     * {@inheritDoc}
      */
     public Iterator<Entry> iterator()
     {

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java?rev=1306983&r1=1306982&r2=1306983&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
(original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
Thu Mar 29 16:51:39 2012
@@ -26,6 +26,7 @@ import java.util.List;
 
 import org.apache.directory.server.core.api.interceptor.context.SearchingOperationContext;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.ClosureMonitor;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
@@ -130,7 +131,7 @@ public class CursorList implements Entry
      */
     public boolean available()
     {
-        if ( index >= 0 && index < end )
+        if ( ( index >= 0 ) && ( index < end ) )
         {
             return list.get( index ).available();
         }
@@ -164,7 +165,7 @@ public class CursorList implements Entry
      */
     public void beforeFirst() throws Exception
     {
-        this.index = 0;
+        index = 0;
         list.get( index ).beforeFirst();
     }
 
@@ -174,7 +175,7 @@ public class CursorList implements Entry
      */
     public void afterLast() throws Exception
     {
-        this.index = end - 1;
+        index = end - 1;
         list.get( index ).afterLast();
     }
 
@@ -187,6 +188,7 @@ public class CursorList implements Entry
         if ( list.size() > 0 )
         {
             index = start;
+            
             return list.get( index ).first();
         }
 
@@ -267,6 +269,7 @@ public class CursorList implements Entry
             if ( !list.get( index ).previous() )
             {
                 index--;
+                
                 if ( index != -1 )
                 {
                     return list.get( index ).previous();
@@ -288,6 +291,7 @@ public class CursorList implements Entry
             if ( !list.get( index ).previous() )
             {
                 index = -1;
+                
                 return false;
             }
             else
@@ -311,18 +315,19 @@ public class CursorList implements Entry
     public boolean next() throws Exception
     {
         // if parked at -1 we advance to the start index and return true
-        if ( list.size() > 0 && index == -1 )
+        if ( ( list.size() ) > 0 && ( index == -1 ) )
         {
             index = start;
             return list.get( index ).next();
         }
 
         // if the index plus one is less than the end then increment and return true
-        if ( list.size() > 0 && index + 1 < end )
+        if ( ( list.size()  > 0 ) && ( index + 1 < end ) )
         {
             if ( !list.get( index ).next() )
             {
                 index++;
+                
                 if ( index < end )
                 {
                     return list.get( index ).next();
@@ -339,7 +344,7 @@ public class CursorList implements Entry
         }
 
         // if the index plus one is equal to the end then increment and return false
-        if ( list.size() > 0 && index + 1 == end )
+        if ( ( list.size() > 0 ) && ( index + 1 == end ) )
         {
             if ( !list.get( index ).next() )
             {
@@ -380,6 +385,9 @@ public class CursorList implements Entry
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean addEntryFilter( EntryFilter filter )
     {
         for ( EntryFilteringCursor efc : list )
@@ -392,12 +400,18 @@ public class CursorList implements Entry
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public List<EntryFilter> getEntryFilters()
     {
         throw new UnsupportedOperationException( "CursorList doesn't support this operation"
);
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public SearchingOperationContext getOperationContext()
     {
         return searchContext;
@@ -470,12 +484,14 @@ public class CursorList implements Entry
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setClosureMonitor( ClosureMonitor monitor )
     {
-        for ( Cursor c : list )
+        for ( EntryFilteringCursor c : list )
         {
             c.setClosureMonitor( monitor );
         }
     }
-
 }

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/EntryFilteringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/EntryFilteringCursor.java?rev=1306983&r1=1306982&r2=1306983&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/EntryFilteringCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/EntryFilteringCursor.java
Thu Mar 29 16:51:39 2012
@@ -28,30 +28,12 @@ import org.apache.directory.shared.ldap.
 
 
 /**
- * 
- * TODO Add Javadoc !
+ * A wrapper on top of a Cursor used to filter entries we get from the backend.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public interface EntryFilteringCursor extends Cursor<Entry>
 {
-
-    /**
-     * Gets whether or not this BaseEntryFilteringCursor has been abandoned.
-     *
-     * @return true if abandoned, false if not
-     */
-    public abstract boolean isAbandoned();
-
-
-    /**
-     * Sets whether this BaseEntryFilteringCursor has been abandoned.
-     *
-     * @param abandoned true if abandoned, false if not
-     */
-    public abstract void setAbandoned( boolean abandoned );
-
-
     /**
      * Adds an entry filter to this BaseEntryFilteringCursor at the very end of 
      * the filter list.  EntryFilters are applied in the order of addition.
@@ -59,17 +41,7 @@ public interface EntryFilteringCursor ex
      * @param filter a filter to apply to the entries
      * @return the result of {@link List#add(Object)}
      */
-    public abstract boolean addEntryFilter( EntryFilter filter );
-
-
-    /**
-     * Removes an entry filter to this BaseEntryFilteringCursor at the very end of 
-     * the filter list.  
-     * 
-     * @param filter a filter to remove from the filter list
-     * @return the result of {@link List#remove(Object)}
-     */
-    public abstract boolean removeEntryFilter( EntryFilter filter );
+    boolean addEntryFilter( EntryFilter filter );
 
 
     /**
@@ -77,11 +49,11 @@ public interface EntryFilteringCursor ex
      *
      * @return an unmodifiable list of EntryFilters applied
      */
-    public abstract List<EntryFilter> getEntryFilters();
+    List<EntryFilter> getEntryFilters();
 
 
     /**
      * @return the operationContext
      */
-    public abstract SearchingOperationContext getOperationContext();
+    SearchingOperationContext getOperationContext();
 }
\ No newline at end of file



Mime
View raw message