You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2008/06/25 20:14:09 UTC

svn commit: r671617 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/

Author: kayyagari
Date: Wed Jun 25 11:14:08 2008
New Revision: 671617

URL: http://svn.apache.org/viewvc?rev=671617&view=rev
Log:
replaced the NamingException with Exception

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogSearchEngine.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogStore.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TagSearchEngine.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TaggableChangeLogStore.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java?rev=671617&r1=671616&r2=671617&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java Wed Jun 25 11:14:08 2008
@@ -24,8 +24,6 @@
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 
-import javax.naming.NamingException;
-
 
 /**
  * A facade for the change log subsystem.  It exposes the functionality
@@ -58,9 +56,9 @@
      * Gets the current revision for the server.
      *
      * @return the current revision
-     * @throws NamingException if there is a problem accessing this information
+     * @throws Exception if there is a problem accessing this information
      */
-    long getCurrentRevision() throws NamingException;
+    long getCurrentRevision() throws Exception;
 
 
     /**
@@ -71,9 +69,9 @@
      * @param forward LDIF of the change going to the next state
      * @param reverse LDIF (anti-operation): the change required to revert this change
      * @return the new revision reached after having applied the forward LDIF
-     * @throws NamingException if there are problems logging the change
+     * @throws Exception if there are problems logging the change
      */
-    long log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws NamingException;
+    long log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws Exception;
 
 
     /**
@@ -131,11 +129,11 @@
      *
      * @param revision the revision to tag the snapshot
      * @return the Tag associated with the revision
-     * @throws NamingException if there is a problem taking a tag
+     * @throws Exception if there is a problem taking a tag
      * @throws IllegalArgumentException if the revision is out of range (less than 0
      * and greater than the current revision)
      */
-    Tag tag( long revision ) throws NamingException;
+    Tag tag( long revision ) throws Exception;
 
 
     /**
@@ -147,11 +145,11 @@
      * @param revision the revision to tag the snapshot
      * @param description some information about what the snapshot tag represents
      * @return the Tag associated with the revision
-     * @throws NamingException if there is a problem taking a tag
+     * @throws Exception if there is a problem taking a tag
      * @throws IllegalArgumentException if the revision is out of range (less than 0
      * and greater than the current revision)
      */
-    Tag tag( long revision, String description ) throws NamingException;
+    Tag tag( long revision, String description ) throws Exception;
 
 
     /**
@@ -159,24 +157,24 @@
      *
      * @param description some information about what the snapshot tag represents
      * @return the revision at which the tag is created
-     * @throws NamingException if there is a problem taking a tag
+     * @throws Exception if there is a problem taking a tag
      */
-    Tag tag( String description ) throws NamingException;
+    Tag tag( String description ) throws Exception;
 
 
     /**
      * Creates a snapshot of the server at the current revision.
      *
      * @return the revision at which the tag is created
-     * @throws NamingException if there is a problem taking a tag
+     * @throws Exception if there is a problem taking a tag
      */
-    Tag tag() throws NamingException;
+    Tag tag() throws Exception;
 
-    Tag getLatest() throws NamingException;
+    Tag getLatest() throws Exception;
 
-    void init( DirectoryService service ) throws NamingException;
+    void init( DirectoryService service ) throws Exception;
 
-    void sync() throws NamingException;
+    void sync() throws Exception;
 
-    void destroy() throws NamingException;
+    void destroy() throws Exception;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogSearchEngine.java?rev=671617&r1=671616&r2=671617&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogSearchEngine.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogSearchEngine.java Wed Jun 25 11:14:08 2008
@@ -21,7 +21,6 @@
 
 
 import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -65,9 +64,9 @@
      *
      * @param generalizedTime the generalized time descriptor to find the effective revision for
      * @return the revision that was in effect at a certain time
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    long lookup( String generalizedTime ) throws NamingException;
+    long lookup( String generalizedTime ) throws Exception;
 
 
     /**
@@ -75,11 +74,11 @@
      *
      * @param revision to get a ChangeLogEvent for
      * @return the ChangeLogEvent associated with the revision
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      * @throws IllegalArgumentException if the revision is out of range (less than 0
      * and greater than the current revision)
      */
-    ChangeLogEvent lookup( long revision ) throws NamingException;
+    ChangeLogEvent lookup( long revision ) throws Exception;
 
 
     /**
@@ -91,9 +90,9 @@
      *
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return an enumeration of all the ChangeLogEvents
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    NamingEnumeration<ChangeLogEvent> find( RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> find( RevisionOrder order ) throws Exception;
 
 
     /**
@@ -102,11 +101,11 @@
      * @param revision the revision number to get the ChangeLogEvents before
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return an enumeration of all the ChangeLogEvents before and including some revision
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      * @throws IllegalArgumentException if the revision is out of range (less than 0
      * and greater than the current revision)
      */
-    NamingEnumeration<ChangeLogEvent> findBefore( long revision, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> findBefore( long revision, RevisionOrder order ) throws Exception;
 
 
     /**
@@ -119,11 +118,11 @@
      * @param revision the revision number to get the ChangeLogEvents after
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return an enumeration of all the ChangeLogEvents after and including the revision
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      * @throws IllegalArgumentException if the revision is out of range (less than 0
      * and greater than the current revision)
      */
-    NamingEnumeration<ChangeLogEvent> findAfter( long revision, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> findAfter( long revision, RevisionOrder order ) throws Exception;
 
 
     /**
@@ -133,12 +132,12 @@
      * @param endRevision the revision number to start getting the ChangeLogEvents below
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return an enumeration of all the ChangeLogEvents within some revision range inclusive
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      * @throws IllegalArgumentException if the start and end revisions are out of range
      * (less than 0 and greater than the current revision), or if startRevision > endRevision
      */
     NamingEnumeration<ChangeLogEvent> find( long startRevision, long endRevision, RevisionOrder order )
-        throws NamingException;
+        throws Exception;
 
     
     /**
@@ -147,9 +146,9 @@
      * @param dn the normalized DN of the entry to get ChangeLogEvents for
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return the set of changes that occurred on an entry
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    NamingEnumeration<ChangeLogEvent> find( LdapDN dn, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> find( LdapDN dn, RevisionOrder order ) throws Exception;
     
     
     /**
@@ -159,9 +158,9 @@
      * @param scope the scope of the search under the base similar to LDAP search scope
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return the set of changes that occurred on an entry and/or it's descendants depending on the scope
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    NamingEnumeration<ChangeLogEvent> find( LdapDN base, Scope scope, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> find( LdapDN base, Scope scope, RevisionOrder order ) throws Exception;
     
 
     /**
@@ -170,9 +169,9 @@
      * @param principal the LDAP principal who triggered the events
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return the set of changes that were triggered by a specific LDAP user
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    NamingEnumeration<ChangeLogEvent> find( LdapPrincipal principal, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> find( LdapPrincipal principal, RevisionOrder order ) throws Exception;
     
     
     /**
@@ -181,9 +180,9 @@
      * @param changeType the change type of the ChangeLogEvents to search for
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return the set of ChangeLogEvents of a particular ChangeType
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    NamingEnumeration<ChangeLogEvent> find( ChangeType changeType, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> find( ChangeType changeType, RevisionOrder order ) throws Exception;
     
     
     /**
@@ -192,9 +191,9 @@
      * @param attributeType the attributeType definition for the changed attribute to search changes for
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return the set of ChangeLogEvents on a particular attributeType
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    NamingEnumeration<ChangeLogEvent> find( AttributeType attributeType, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> find( AttributeType attributeType, RevisionOrder order ) throws Exception;
     
 
     /**
@@ -203,9 +202,9 @@
      * @param objectClass the objectClass definition for the entries to search changes for
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return the set of ChangeLogEvents on a particular attributeType
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    NamingEnumeration<ChangeLogEvent> find( ObjectClass objectClass, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> find( ObjectClass objectClass, RevisionOrder order ) throws Exception;
     
     
     /**
@@ -237,7 +236,7 @@
      * @param filter the filter to use for finding the change
      * @param order the order in which to return ChangeLogEvents (ordered by revision number)
      * @return the set of ChangeLogEvents on entries of a particular objectClass
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    NamingEnumeration<ChangeLogEvent> find( ExprNode filter, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<ChangeLogEvent> find( ExprNode filter, RevisionOrder order ) throws Exception;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogStore.java?rev=671617&r1=671616&r2=671617&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogStore.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogStore.java Wed Jun 25 11:14:08 2008
@@ -25,7 +25,6 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 
-import javax.naming.NamingException;
 
 
 /**
@@ -37,13 +36,13 @@
  */
 public interface ChangeLogStore 
 {
-    void init( DirectoryService service ) throws NamingException;
+    void init( DirectoryService service ) throws Exception;
 
 
-    void sync() throws NamingException;
+    void sync() throws Exception;
 
 
-    void destroy() throws NamingException;
+    void destroy() throws Exception;
 
 
     /**
@@ -62,9 +61,9 @@
      * @param forward LDIF of the change going to the next state
      * @param reverse LDIF (anti-operation): the change required to revert this change
      * @return the new revision reached after having applied the forward LDIF
-     * @throws NamingException if there are problems logging the change
+     * @throws Exception if there are problems logging the change
      */
-    long log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws NamingException;
+    long log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws Exception;
 
     
     /**
@@ -72,11 +71,11 @@
      *
      * @param revision to get a ChangeLogEvent for
      * @return the ChangeLogEvent associated with the revision
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      * @throws IllegalArgumentException if the revision is out of range (less than 0
      * and greater than the current revision)
      */
-    ChangeLogEvent lookup( long revision ) throws NamingException;
+    ChangeLogEvent lookup( long revision ) throws Exception;
 
 
     /**
@@ -88,9 +87,9 @@
      * increasing the revision should not be seen.
      *
      * @return a Cursor over all the ChangeLogEvents
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      */
-    Cursor<ChangeLogEvent> find() throws NamingException;
+    Cursor<ChangeLogEvent> find() throws Exception;
 
 
     /**
@@ -99,11 +98,11 @@
      *
      * @param revision the revision number to get the ChangeLogEvents before
      * @return a Cursor over the ChangeLogEvents before a revision
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      * @throws IllegalArgumentException if the revision is out of range (less than 0
      * and greater than the current revision)
      */
-    Cursor<ChangeLogEvent> findBefore( long revision ) throws NamingException;
+    Cursor<ChangeLogEvent> findBefore( long revision ) throws Exception;
 
 
     /**
@@ -115,11 +114,11 @@
      *
      * @param revision the revision number to get the ChangeLogEvents after
      * @return a Cursor of all the ChangeLogEvents after and including the revision
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      * @throws IllegalArgumentException if the revision is out of range (less than 0
      * and greater than the current revision)
      */
-    Cursor<ChangeLogEvent> findAfter( long revision ) throws NamingException;
+    Cursor<ChangeLogEvent> findAfter( long revision ) throws Exception;
 
 
     /**
@@ -128,9 +127,9 @@
      * @param startRevision the revision number to start getting the ChangeLogEvents above
      * @param endRevision the revision number to start getting the ChangeLogEvents below
      * @return an enumeration of all the ChangeLogEvents within some revision range inclusive
-     * @throws NamingException if there are failures accessing the store
+     * @throws Exception if there are failures accessing the store
      * @throws IllegalArgumentException if the start and end revisions are out of range
      * (less than 0 and greater than the current revision), or if startRevision > endRevision
      */
-    Cursor<ChangeLogEvent> find( long startRevision, long endRevision ) throws NamingException;
+    Cursor<ChangeLogEvent> find( long startRevision, long endRevision ) throws Exception;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java?rev=671617&r1=671616&r2=671617&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java Wed Jun 25 11:14:08 2008
@@ -19,12 +19,10 @@
 package org.apache.directory.server.core.changelog;
 
 
-import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 
-import javax.naming.NamingException;
-
 
 /**
  * The default ChangeLog service implementation.
@@ -53,13 +51,13 @@
     }
 
 
-    public long getCurrentRevision() throws NamingException
+    public long getCurrentRevision() throws Exception
     {
         return store.getCurrentRevision();
     }
 
 
-    public long log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws NamingException
+    public long log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws Exception
     {
         if ( ! enabled )
         {
@@ -112,7 +110,7 @@
     }
 
 
-    public Tag tag( long revision, String description ) throws NamingException
+    public Tag tag( long revision, String description ) throws Exception
     {
         if ( revision < 0 )
         {
@@ -133,19 +131,19 @@
     }
 
 
-    public Tag tag( long revision ) throws NamingException
+    public Tag tag( long revision ) throws Exception
     {
         return tag( revision, null );
     }
 
 
-    public Tag tag( String description ) throws NamingException
+    public Tag tag( String description ) throws Exception
     {
         return tag( store.getCurrentRevision(), description );
     }
 
 
-    public Tag tag() throws NamingException
+    public Tag tag() throws Exception
     {
         return tag( store.getCurrentRevision(), null );
     }
@@ -163,7 +161,7 @@
     }
 
 
-    public Tag getLatest() throws NamingException
+    public Tag getLatest() throws Exception
     {
         if ( latest != null )
         {
@@ -179,7 +177,7 @@
     }
 
 
-    public void init( DirectoryService service ) throws NamingException
+    public void init( DirectoryService service ) throws Exception
     {
         if ( enabled )
         {
@@ -188,7 +186,7 @@
     }
 
 
-    public void sync() throws NamingException
+    public void sync() throws Exception
     {
         if ( enabled )
         {
@@ -197,7 +195,7 @@
     }
 
 
-    public void destroy() throws NamingException
+    public void destroy() throws Exception
     {
         if ( enabled )
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java?rev=671617&r1=671616&r2=671617&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java Wed Jun 25 11:14:08 2008
@@ -43,8 +43,6 @@
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.util.DateUtils;
 
-import javax.naming.NamingException;
-
 
 /**
  * A change log store that keeps it's information in memory.
@@ -53,6 +51,7 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
+ * TODO remove the NamingException
  */
 public class MemoryChangeLogStore implements TaggableChangeLogStore
 {
@@ -67,7 +66,7 @@
     private File workingDirectory;
 
 
-    public Tag tag( long revision ) throws NamingException
+    public Tag tag( long revision ) throws Exception
     {
         if ( tags.containsKey( revision ) )
         {
@@ -80,7 +79,7 @@
     }
 
 
-    public Tag tag() throws NamingException
+    public Tag tag() throws Exception
     {
         if ( latest != null && latest.getRevision() == currentRevision )
         {
@@ -93,7 +92,7 @@
     }
 
 
-    public Tag tag( String description ) throws NamingException
+    public Tag tag( String description ) throws Exception
     {
         if ( latest != null && latest.getRevision() == currentRevision )
         {
@@ -106,7 +105,7 @@
     }
 
 
-    public void init( DirectoryService service ) throws NamingException
+    public void init( DirectoryService service ) throws Exception
     {
         workingDirectory = service.getWorkingDirectory();
         loadRevision();
@@ -115,7 +114,7 @@
     }
 
 
-    private void loadRevision() throws NamingException
+    private void loadRevision() throws Exception
     {
         File revFile = new File( workingDirectory, REV_FILE );
         if ( revFile.exists() )
@@ -129,7 +128,7 @@
             }
             catch ( IOException e )
             {
-                throw new NamingException( "Failed to open stream to read from revfile: " + revFile.getAbsolutePath() );
+                throw e;
             }
             finally
             {
@@ -149,7 +148,7 @@
     }
 
 
-    private void saveRevision() throws NamingException
+    private void saveRevision() throws Exception
     {
         File revFile = new File( workingDirectory, REV_FILE );
         if ( revFile.exists() )
@@ -166,7 +165,7 @@
         }
         catch ( IOException e )
         {
-            throw new NamingException( "Failed to write out revision file." );
+            throw e;
         }
         finally
         {
@@ -178,7 +177,7 @@
     }
 
 
-    private void saveTags() throws NamingException
+    private void saveTags() throws Exception
     {
         File tagFile = new File( workingDirectory, TAG_FILE );
         if ( tagFile.exists() )
@@ -210,7 +209,7 @@
         }
         catch ( IOException e )
         {
-            throw new NamingException( "Failed to write out revision file." );
+            throw e;
         }
         finally
         {
@@ -229,7 +228,7 @@
     }
 
 
-    private void loadTags() throws NamingException
+    private void loadTags() throws Exception
     {
         File revFile = new File( workingDirectory, REV_FILE );
         if ( revFile.exists() )
@@ -272,7 +271,7 @@
             }
             catch ( IOException e )
             {
-                throw new NamingException( "Failed to open stream to read from revfile: " + revFile.getAbsolutePath() );
+                throw e;
             }
             finally
             {
@@ -292,7 +291,7 @@
     }
 
 
-    private void loadChangeLog() throws NamingException
+    private void loadChangeLog() throws Exception
     {
         File file = new File( workingDirectory, CHANGELOG_FILE );
         if ( file.exists() )
@@ -323,10 +322,7 @@
             }
             catch ( Exception e )
             {
-                NamingException ne = new NamingException( "Failed to open stream to read from changelog file: "
-                        + file.getAbsolutePath() );
-                ne.setRootCause( e );
-                throw ne;
+                throw e;
             }
             finally
             {
@@ -346,7 +342,7 @@
     }
 
 
-    private void saveChangeLog() throws NamingException
+    private void saveChangeLog() throws Exception
     {
         File file = new File( workingDirectory, CHANGELOG_FILE );
         if ( file.exists() )
@@ -360,10 +356,7 @@
         }
         catch ( IOException e )
         {
-            NamingException ne = new NamingException( "Failed to create new file for changelog: "
-                    + file.getAbsolutePath() );
-            ne.setRootCause( e );
-            throw ne;
+            throw e;
         }
 
         ObjectOutputStream out = null;
@@ -381,10 +374,7 @@
         }
         catch ( Exception e )
         {
-            NamingException ne = new NamingException( "Failed to open stream to write to changelog file: "
-                    + file.getAbsolutePath() );
-            ne.setRootCause( e );
-            throw ne;
+            throw e;
         }
         finally
         {
@@ -403,7 +393,7 @@
     }
 
 
-    public void sync() throws NamingException
+    public void sync() throws Exception
     {
         saveRevision();
         saveTags();
@@ -411,7 +401,7 @@
     }
 
 
-    public void destroy() throws NamingException
+    public void destroy() throws Exception
     {
         saveRevision();
         saveTags();
@@ -425,7 +415,7 @@
     }
 
 
-    public long log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws NamingException
+    public long log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws Exception
     {
         currentRevision++;
         ChangeLogEvent event = new ChangeLogEvent( currentRevision, DateUtils.getGeneralizedTime(), 
@@ -435,7 +425,7 @@
     }
 
 
-    public ChangeLogEvent lookup( long revision ) throws NamingException
+    public ChangeLogEvent lookup( long revision ) throws Exception
     {
         if ( revision < 0 )
         {
@@ -451,31 +441,31 @@
     }
 
 
-    public Cursor<ChangeLogEvent> find() throws NamingException
+    public Cursor<ChangeLogEvent> find() throws Exception
     {
         return new ListCursor<ChangeLogEvent>( events );
     }
 
 
-    public Cursor<ChangeLogEvent> findBefore( long revision ) throws NamingException
+    public Cursor<ChangeLogEvent> findBefore( long revision ) throws Exception
     {
         return new ListCursor<ChangeLogEvent>( events, ( int ) revision );
     }
 
 
-    public Cursor<ChangeLogEvent> findAfter( long revision ) throws NamingException
+    public Cursor<ChangeLogEvent> findAfter( long revision ) throws Exception
     {
         return new ListCursor<ChangeLogEvent>( ( int ) revision, events );
     }
 
 
-    public Cursor<ChangeLogEvent> find( long startRevision, long endRevision ) throws NamingException
+    public Cursor<ChangeLogEvent> find( long startRevision, long endRevision ) throws Exception
     {
         return new ListCursor<ChangeLogEvent>( ( int ) startRevision, events, ( int ) ( endRevision + 1 ) );
     }
 
 
-    public Tag getLatest()
+    public Tag getLatest() throws Exception
     {
         return latest;
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TagSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TagSearchEngine.java?rev=671617&r1=671616&r2=671617&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TagSearchEngine.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TagSearchEngine.java Wed Jun 25 11:14:08 2008
@@ -21,7 +21,6 @@
 
 
 import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 
 
 /**
@@ -58,18 +57,18 @@
      *
      * @param revision the revision number to use to check for a snapshot
      * @return the snapshot at the revision if one exists, otherwise null
-     * @throws NamingException if there is a problem accessing the store
+     * @throws Exception if there is a problem accessing the store
      */
-    Tag lookup( long revision ) throws NamingException;
+    Tag lookup( long revision ) throws Exception;
     
     /**
      * Checks to see if a snapshot exists for a specific revision. 
      *
      * @param revision the revision number to use to check for a snapshot
      * @return true if a snapshot exists at the revision, false otherwise
-     * @throws NamingException if there is a problem accessing the store
+     * @throws Exception if there is a problem accessing the store
      */
-    boolean has( long revision ) throws NamingException;
+    boolean has( long revision ) throws Exception;
 
 
     // -----------------------------------------------------------------------
@@ -83,9 +82,9 @@
      *
      * @param order the revision order in which to return snapshot tags 
      * @return an enumeration over the tags of all snapshots taken since revision 0
-     * @throws NamingException if there is a problem accessing the store
+     * @throws Exception if there is a problem accessing the store
      */
-    NamingEnumeration<Tag> find( RevisionOrder order ) throws NamingException;
+    NamingEnumeration<Tag> find( RevisionOrder order ) throws Exception;
     
     /**
      * Finds all the snapshot tags taken before a specific revision.  If a tag 
@@ -94,11 +93,11 @@
      * @param revision the revision number to get snapshots before 
      * @param order the revision order in which to return snapshot tags 
      * @return an enumeration over the tags of all snapshots taken before a revision inclusive
-     * @throws NamingException if there is a problem accessing the store
+     * @throws Exception if there is a problem accessing the store
      * @throws IllegalArgumentException if the revision is greater than the current revision
      * or less than 0.
      */
-    NamingEnumeration<Tag> findBefore( long revision, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<Tag> findBefore( long revision, RevisionOrder order ) throws Exception;
     
     /**
      * Finds all the snapshot tags taken after a specific revision.  If a tag 
@@ -107,11 +106,11 @@
      * @param revision the revision number to get snapshots after
      * @param order the revision order in which to return snapshot tags 
      * @return an enumeration over the tags of all snapshots taken after a revision inclusive
-     * @throws NamingException if there is a problem accessing the store
+     * @throws Exception if there is a problem accessing the store
      * @throws IllegalArgumentException if the revision is greater than the current revision
      * or less than 0.
      */
-    NamingEnumeration<Tag> findAfter( long revision, RevisionOrder order ) throws NamingException;
+    NamingEnumeration<Tag> findAfter( long revision, RevisionOrder order ) throws Exception;
     
     /**
      * Enumerates over the tags of all snapshots taken between a specific revision 
@@ -122,10 +121,10 @@
      * @param endRevision the revision to end on inclusive
      * @param order the revision order in which to return snapshot tags
      * @return enumeration over all the snapshots taken in a revision range inclusive
-     * @throws NamingException if there is a problem accessing the store
+     * @throws Exception if there is a problem accessing the store
      * @throws IllegalArgumentException if the revision range is not constructed properly
      * or if either revision number is greater than the current revision or less than 0.
      */
     NamingEnumeration<Tag> find( long startRevision, long endRevision, RevisionOrder order ) 
-        throws NamingException;
+        throws Exception;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TaggableChangeLogStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TaggableChangeLogStore.java?rev=671617&r1=671616&r2=671617&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TaggableChangeLogStore.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/TaggableChangeLogStore.java Wed Jun 25 11:14:08 2008
@@ -19,7 +19,6 @@
  */
 package org.apache.directory.server.core.changelog;
 
-import javax.naming.NamingException;
 
 
 /**
@@ -36,19 +35,19 @@
      * Creates a tag for a snapshot of the server in a specific state at a revision.
      *
      * @param revision the revision to tag the snapshot
-     * @throws NamingException if there is a problem taking a tag, or if
-     * the revision does not exist
      * @return the Tag associated with the revision
+     * @throws Exception if there is a problem taking a tag, or if
+     * the revision does not exist
      */
-    Tag tag( long revision ) throws NamingException;
+    Tag tag( long revision ) throws Exception;
 
     /**
      * Creates a snapshot of the server at the current revision.
      *
      * @return the revision at which the tag is created
-     * @throws NamingException if there is a problem taking a tag
+     * @throws Exception if there is a problem taking a tag
      */
-    Tag tag() throws NamingException;
+    Tag tag() throws Exception;
 
     /**
      * Creates a snapshot of the server at the current revision with a description
@@ -56,9 +55,9 @@
      *
      * @param description a description of the state associate with the tag
      * @return the revision at which the tag is created
-     * @throws NamingException if there is a problem taking a tag
+     * @throws Exception if there is a problem taking a tag
      */
-    Tag tag( String description ) throws NamingException;
+    Tag tag( String description ) throws Exception;
 
 
     /**
@@ -66,7 +65,7 @@
      *
      * @return the last tag to have been created (youngest), or null if no
      * tags have been created
-     * @throws NamingException on failures to access the tag store
+     * @throws Exception on failures to access the tag store
      */
-    Tag getLatest() throws NamingException;
+    Tag getLatest() throws Exception;
 }