directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r490909 - in /directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store: ReplicationLogIterator.java ReplicationStore.java ReplicationStoreException.java
Date Fri, 29 Dec 2006 02:35:02 GMT
Author: trustin
Date: Thu Dec 28 18:35:01 2006
New Revision: 490909

URL: http://svn.apache.org/viewvc?view=rev&rev=490909
Log:
Added JavaDoc to mitosis.store package

Modified:
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java?view=diff&rev=490909&r1=490908&r2=490909
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java
Thu Dec 28 18:35:01 2006
@@ -20,16 +20,33 @@
 package org.apache.directory.mitosis.store;
 
 
-import org.apache.directory.mitosis.operation.Operation;
+import java.sql.ResultSet;
 
+import org.apache.directory.mitosis.operation.Operation;
 
+/**
+ * Iterates a set of {@link Operation}s, which is a result of a query on 
+ * {@link ReplicationStore}.  It's usage is similar to that of JDBC
+ * {@link ResultSet}.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date$
+ */
 public interface ReplicationLogIterator
 {
+    /**
+     * Move on to the next item.
+     * @return <tt>true</tt> if and only if it has more item.
+     */
     boolean next();
 
-
+    /**
+     * Releases all resources allocated to this iterator.
+     */
     void close();
 
-
+    /**
+     * Returns the {@link Operation} on the current iterator position.
+     */
     Operation getOperation();
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java?view=diff&rev=490909&r1=490908&r2=490909
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java
Thu Dec 28 18:35:01 2006
@@ -24,63 +24,123 @@
 
 import javax.naming.Name;
 
-import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNVector;
+import org.apache.directory.mitosis.common.Replica;
 import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.UUID;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.operation.Operation;
+import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
-
+/**
+ * Provides an abstract storage that stores data required to perform
+ * replication, such as {@link UUID}-{@link LdapDN} mapping and
+ * LDAP {@link Operation}s.  It also calculates the Update Vector (UV)
+ * and the Purge Vector (PV) of a replica.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date#
+ */
 public interface ReplicationStore
 {
-
+    /**
+     * Opens this storage.
+     */
     void open( DirectoryServiceConfiguration serviceCfg, ReplicationConfiguration cfg );
 
-
+    /**
+     * Closes this storage and releases the resources allocated when it's
+     * opened.
+     */
     void close();
 
-
+    /**
+     * Returns the {@link ReplicaId} of the {@link Replica} that this storage
+     * is associated with.
+     */
     ReplicaId getReplicaId();
 
-
-    Set getKnownReplicaIds();
+    /**
+     * Returns the set of {@link ReplicaId}s of the {@link Replica}s that
+     * belongs to the same cluster.
+     */
+    Set<ReplicaId> getKnownReplicaIds();
 
 
     // UUID to DN table operations
 
+    /**
+     * Finds the {@link Name} of an entry with the specified {@link UUID}.
+     */
     Name getDN( UUID uuid );
 
-
+    /**
+     * Associates the specified name and UUID so a user can
+     * find an entry's name from a UUID.
+     */
     boolean putUUID( UUID uuid, Name dn );
 
-
+    /**
+     * Removed the specified UUID mapping from this storage.
+     * @return <tt>true</tt> if and only if the mapping has been removed
+     */
     boolean removeUUID( UUID uuid );
 
 
     // Log entry operations
 
+    /**
+     * Puts the specified operation into this storage.
+     */
     void putLog( Operation operation );
 
-
+    /**
+     * Queries all operations that is greater than the specified {@link CSN}.
+     * 
+     * @param inclusive <tt>true</tt> if you want to include <tt>fromCSN</tt>
+     *                  itself in the result set.
+     */
     ReplicationLogIterator getLogs( CSN fromCSN, boolean inclusive );
 
-
+    /**
+     * Queries all operations that is greater than the specified
+     * {@link CSNVector}.
+     * 
+     * @param inclusive <tt>true</tt> if you want to include
+     *                  <tt>updateVector</tt> itself in the result set.
+     */
     ReplicationLogIterator getLogs( CSNVector updateVector, boolean inclusive );
 
-
+    /**
+     * Removes all operations that is less than the specified {@link CSN}.
+     * 
+     * @param inclusive <tt>true</tt> if you want to delete the
+     *                  <tt>toCSN</tt> itself, too.
+     * @return the number of deleted {@link Operation}s
+     */
     int removeLogs( CSN toCSN, boolean inclusive );
 
-
+    /**
+     * Returns the number of {@link Operation}s logged in this storage.
+     */
     int getLogSize();
 
-
+    /**
+     * Returns the number of {@link Operation}s logged by
+     * the {@link Replica} with the specified {@link ReplicaId}
+     * in this storage .
+     */
     int getLogSize( ReplicaId replicaId );
 
-
+    /**
+     * Calculates the Update Vector (UV) from this storage. 
+     */
     CSNVector getUpdateVector();
 
-
+    /**
+     * Calculates the Purge Vector (PV) from this storage. 
+     */
     CSNVector getPurgeVector();
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java?view=diff&rev=490909&r1=490908&r2=490909
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java
Thu Dec 28 18:35:01 2006
@@ -19,7 +19,13 @@
  */
 package org.apache.directory.mitosis.store;
 
-
+/**
+ * A {@link RuntimeException} which is thrown when {@link ReplicationStore}
+ * has a problem in accessing its underlying data source (e.g. a file).
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date$
+ */
 public class ReplicationStoreException extends RuntimeException
 {
 



Mime
View raw message