directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1158786 - in /directory/apacheds/trunk/xdbm-partition/src: main/java/org/apache/directory/server/xdbm/ main/java/org/apache/directory/server/xdbm/search/impl/ test/java/org/apache/directory/server/xdbm/
Date Wed, 17 Aug 2011 15:53:55 GMT
Author: elecharny
Date: Wed Aug 17 15:53:54 2011
New Revision: 1158786

URL: http://svn.apache.org/viewvc?rev=1158786&view=rev
Log:
o moved the after() method to the AbstractIndexCursor class
o created a getUnsupportedMessage() method 

Modified:
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
Wed Aug 17 15:53:54 2011
@@ -32,11 +32,13 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractIndexCursor<K, E, ID> extends AbstractCursor<IndexEntry<K,
E, ID>> implements IndexCursor<K, E, ID>
+public abstract class AbstractIndexCursor<V, Entry, ID> extends AbstractCursor<IndexEntry<V,
Entry, ID>> implements IndexCursor<V, Entry, ID>
 {
     /** Tells if there are some element available in the cursor */
     private boolean available = false;
 
+    /** The message used for unsupported operations */
+    protected static final String UNSUPPORTED_MSG = "Unsupported operation";
 
     /**
      * {@inheritDoc}
@@ -45,6 +47,23 @@ public abstract class AbstractIndexCurso
     {
         return available;
     }
+    
+    
+    /**
+     * Gets the message to return for operations that are not supported
+     * 
+     * @return The Unsupported message
+     */
+    protected abstract String getUnsupportedMessage();
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void after( IndexEntry<V, Entry, ID> element ) throws Exception
+    {
+        throw new UnsupportedOperationException( getUnsupportedMessage() );
+    }
 
 
     /**
@@ -59,9 +78,9 @@ public abstract class AbstractIndexCurso
     /**
      * {@inheritDoc}
      */
-    public Iterator<IndexEntry<K, E, ID>> iterator()
+    public Iterator<IndexEntry<V, Entry, ID>> iterator()
     {
-        return new CursorIterator<IndexEntry<K, E, ID>>( this );
+        return new CursorIterator<IndexEntry<V, Entry, ID>>( this );
     }
 
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
Wed Aug 17 15:53:54 2011
@@ -36,6 +36,18 @@ public class EmptyIndexCursor<K, E, ID> 
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
     public void after( IndexEntry<K, E, ID> element ) throws Exception
     {
         checkNotClosed( "after()" );

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
Wed Aug 17 15:53:54 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.xdbm
 
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 
 
 /**
@@ -28,45 +29,48 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SingletonIndexCursor<K, E, ID> extends AbstractIndexCursor<K, E, ID>
+public class SingletonIndexCursor<V, ID> extends AbstractIndexCursor<V, Entry, ID>
 {
     private boolean beforeFirst = true;
     private boolean afterLast;
     private boolean onSingleton;
-    private final IndexEntry<K, E, ID> singleton;
+    private final IndexEntry<V, Entry, ID> singleton;
 
 
-    public SingletonIndexCursor( IndexEntry<K, E, ID> singleton )
+    public SingletonIndexCursor( IndexEntry<V, Entry, ID> singleton )
     {
         this.singleton = singleton;
     }
 
 
-    public boolean available()
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
     {
-        return onSingleton;
+        return UNSUPPORTED_MSG;
     }
 
-
-    public void before( IndexEntry<K, E, ID> element ) throws Exception
+    
+    public boolean available()
     {
-        throw new UnsupportedOperationException();
+        return onSingleton;
     }
 
 
-    public void beforeValue( ID id, K value ) throws Exception
+    public void before( IndexEntry<V, Entry, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void afterValue( ID id, K value ) throws Exception
+    public void beforeValue( ID id, V value ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void after( IndexEntry<K, E, ID> element ) throws Exception
+    public void afterValue( ID id, V value ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -186,7 +190,7 @@ public class SingletonIndexCursor<K, E, 
     }
 
 
-    public IndexEntry<K, E, ID> get() throws Exception
+    public IndexEntry<V, Entry, ID> get() throws Exception
     {
         checkNotClosed( "()" );
         if ( onSingleton )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
Wed Aug 17 15:53:54 2011
@@ -39,6 +39,15 @@ public class AllEntriesCursor<ID extends
     private final IndexCursor<String, Entry, ID> wrapped;
 
 
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
     public AllEntriesCursor( Store<Entry, ID> db ) throws Exception
     {
         // Get a reverse cursor because we want to sort by ID
@@ -66,8 +75,8 @@ public class AllEntriesCursor<ID extends
     }
 
 
-    /* 
-     * @see org.apache.directory.server.core.cursor.Cursor#after(java.lang.Object)
+    /**
+     * {@inheritDoc}
      */
     public void after( IndexEntry<ID, Entry, ID> indexEntry ) throws Exception
     {

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
Wed Aug 17 15:53:54 2011
@@ -55,6 +55,15 @@ public class AndCursor<V, ID> extends Ab
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
     public void beforeValue( ID id, V value )
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
@@ -73,6 +82,9 @@ public class AndCursor<V, ID> extends Ab
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void after( IndexEntry<V, Entry, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
Wed Aug 17 15:53:54 2011
@@ -78,6 +78,15 @@ public class ApproximateCursor<V, ID ext
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
     public boolean available()
     {
         if ( userIdxCursor != null )
@@ -132,16 +141,21 @@ public class ApproximateCursor<V, ID ext
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public void after( IndexEntry<V, Entry, ID> element ) throws Exception
     {
         checkNotClosed( "after()" );
+        
         if ( userIdxCursor != null )
         {
             userIdxCursor.after( element );
         }
         else
         {
-            throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+            super.after( element );
         }
     }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
Wed Aug 17 15:53:54 2011
@@ -164,7 +164,7 @@ public class DefaultSearchEngine<ID exte
 
             if ( evaluator.evaluate( indexEntry ) )
             {
-                return new SingletonIndexCursor<ID, Entry, ID>( indexEntry );
+                return new SingletonIndexCursor<ID, ID>( indexEntry );
             }
             else
             {

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
Wed Aug 17 15:53:54 2011
@@ -80,6 +80,15 @@ public class EqualityCursor<V, ID extend
     /**
      * {@inheritDoc}
      */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
     public boolean available()
     {
         if ( userIdxCursor != null )
@@ -158,7 +167,7 @@ public class EqualityCursor<V, ID extend
         }
         else
         {
-            throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+            super.after( element );
         }
     }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
Wed Aug 17 15:53:54 2011
@@ -82,6 +82,15 @@ public class GreaterEqCursor<V, ID exten
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
     @SuppressWarnings("unchecked")
     public void beforeValue( ID id, V value ) throws Exception
     {
@@ -186,10 +195,13 @@ public class GreaterEqCursor<V, ID exten
     }
 
 
-    @SuppressWarnings("unchecked")
+    /**
+     * {@inheritDoc}
+     */
     public void after( IndexEntry<V, Entry, ID> element ) throws Exception
     {
         checkNotClosed( "after()" );
+        
         if ( userIdxCursor != null )
         {
             int comparedValue = greaterEqEvaluator.getComparator().compare( element.getValue(),
@@ -223,7 +235,7 @@ public class GreaterEqCursor<V, ID exten
         }
         else
         {
-            throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+            super.after( element );
         }
     }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
Wed Aug 17 15:53:54 2011
@@ -82,6 +82,15 @@ public class LessEqCursor<V, ID extends 
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
     public void beforeValue( ID id, V value ) throws Exception
     {
         checkNotClosed( "beforeValue()" );
@@ -208,9 +217,13 @@ public class LessEqCursor<V, ID extends 
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void after( IndexEntry<V, Entry, ID> element ) throws Exception
     {
         checkNotClosed( "after()" );
+        
         if ( userIdxCursor != null )
         {
             int comparedValue = lessEqEvaluator.getComparator().compare( element.getValue(),
@@ -239,7 +252,7 @@ public class LessEqCursor<V, ID extends 
         }
         else
         {
-            throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+            super.after( element );
         }
     }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
Wed Aug 17 15:53:54 2011
@@ -52,19 +52,22 @@ public class NotCursor<V, ID extends Com
     }
 
 
-    public void beforeValue( ID id, V value ) throws Exception
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
     {
-        throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+        return UNSUPPORTED_MSG;
     }
 
-
-    public void before( IndexEntry<V, Entry, ID> element ) throws Exception
+    
+    public void beforeValue( ID id, V value ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
 
 
-    public void after( IndexEntry<V, Entry, ID> element ) throws Exception
+    public void before( IndexEntry<V, Entry, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
Wed Aug 17 15:53:54 2011
@@ -84,25 +84,28 @@ public class OneLevelScopeCursor<ID exte
     }
 
 
-    public void beforeValue( ID id, ID value ) throws Exception
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
     {
-        throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+        return UNSUPPORTED_MSG;
     }
 
-
-    public void afterValue( ID id, ID value ) throws Exception
+    
+    public void beforeValue( ID id, ID value ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
 
 
-    public void before( IndexEntry<ID, Entry, ID> element ) throws Exception
+    public void afterValue( ID id, ID value ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
 
 
-    public void after( IndexEntry<ID, Entry, ID> element ) throws Exception
+    public void before( IndexEntry<ID, Entry, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java
Wed Aug 17 15:53:54 2011
@@ -71,13 +71,16 @@ public class OrCursor<V, ID> extends Abs
     }
 
 
-    public void before( IndexEntry<V, Entry, ID> element ) throws Exception
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
     {
-        throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+        return UNSUPPORTED_MSG;
     }
 
-
-    public void after( IndexEntry<V, Entry, ID> element ) throws Exception
+    
+    public void before( IndexEntry<V, Entry, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java
Wed Aug 17 15:53:54 2011
@@ -64,6 +64,15 @@ public class PresenceCursor<ID extends C
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
     public boolean available()
     {
         if ( presenceCursor != null )
@@ -120,6 +129,9 @@ public class PresenceCursor<ID extends C
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void after( IndexEntry<String, Entry, ID> element ) throws Exception
     {
         checkNotClosed( "after()" );
@@ -131,7 +143,7 @@ public class PresenceCursor<ID extends C
             return;
         }
 
-        throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+        super.after( element );
     }
 
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
Wed Aug 17 15:53:54 2011
@@ -75,25 +75,28 @@ public class SubstringCursor<ID extends 
     }
 
 
-    public void beforeValue( ID id, String value ) throws Exception
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
     {
-        throw new UnsupportedOperationException( UNSUPPORTED_MSG );
+        return UNSUPPORTED_MSG;
     }
 
-
-    public void afterValue( ID id, String value ) throws Exception
+    
+    public void beforeValue( ID id, String value ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
 
 
-    public void before( IndexEntry<String, Entry, ID> element ) throws Exception
+    public void afterValue( ID id, String value ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
 
 
-    public void after( IndexEntry<String, Entry, ID> element ) throws Exception
+    public void before( IndexEntry<String, Entry, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java
Wed Aug 17 15:53:54 2011
@@ -91,8 +91,16 @@ public class SubtreeScopeCursor<ID exten
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    protected String getUnsupportedMessage()
+    {
+        return UNSUPPORTED_MSG;
+    }
+
+    
     // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
     private ID getContextEntryId() throws Exception
     {
         if ( contextEntryId == null )
@@ -135,12 +143,6 @@ public class SubtreeScopeCursor<ID exten
     }
 
 
-    public void after( IndexEntry<ID, Entry, ID> element ) throws Exception
-    {
-        throw new UnsupportedOperationException( UNSUPPORTED_MSG );
-    }
-
-
     public void beforeFirst() throws Exception
     {
         checkNotClosed( "beforeFirst()" );

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java?rev=1158786&r1=1158785&r2=1158786&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java
Wed Aug 17 15:53:54 2011
@@ -40,7 +40,7 @@ public class SingletonIndexCursorTest
 {
 
     private ForwardIndexEntry<String, Entry, Long> indexEntry;
-    private SingletonIndexCursor<String, Entry, Long> indexCursor;
+    private SingletonIndexCursor<String, Long> indexCursor;
 
 
     @Before
@@ -50,14 +50,14 @@ public class SingletonIndexCursorTest
         indexEntry.setId( 1L );
         indexEntry.setObject( new DefaultEntry() );
         indexEntry.setValue( "test" );
-        indexCursor = new SingletonIndexCursor<String, Entry, Long>( indexEntry );
+        indexCursor = new SingletonIndexCursor<String, Long>( indexEntry );
     }
 
 
     @Test
     public void testConstructor()
     {
-        new SingletonIndexCursor<String, Entry, Long>( indexEntry );
+        new SingletonIndexCursor<String, Long>( indexEntry );
     }
 
 



Mime
View raw message