jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1352124 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: api/ChangeSet.java api/ContentSession.java core/ContentSessionImpl.java
Date Wed, 20 Jun 2012 14:20:41 GMT
Author: mduerig
Date: Wed Jun 20 14:20:40 2012
New Revision: 1352124

URL: http://svn.apache.org/viewvc?rev=1352124&view=rev
Log:
OAK-144: Implement observation
update oak-core API draft to reflect results from latest discussion on @oak-dev

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChangeSet.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChangeSet.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChangeSet.java?rev=1352124&r1=1352123&r2=1352124&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChangeSet.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChangeSet.java
Wed Jun 20 14:20:40 2012
@@ -22,28 +22,20 @@ import javax.annotation.Nonnull;
 
 
 /**
- * A {@code ChangeSet} instance describes a set of changes which was applied atomically
- * to a (sub-)tree.
+ * A {@code ChangeSet} instance describes a set of changes to a (sub-)tree.
+ *
+ * TODO (which) meta data do we need to carry along in a ChangeSet?
+ * - timestamp(s)?
+ * - commit message?
+ * - JCR user data?
+ * - revision id(s)?
+ * - cluster id?
+ * - session id?
+ * - whether gaps occurred due to gc-ed revisions
  */
 public interface ChangeSet {
 
     /**
-     * Timestamp for when the changes occurred.
-     * @return  time stamp in milliseconds
-     */
-    long getTimeStamp();
-
-    /**
-     * Commit message from the underlying Microkernel.
-     *
-     * TODO: implementation detail: we might need to encode JCR user data and session
-     * IDs (for no-local support) here but we should expose them separately.
-     * @return
-     */
-    @Nonnull
-    String getCommitMessage();
-
-    /**
      * The {@link Tree} how it was before the changes.
      * @return a read only tree.
      */

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java?rev=1352124&r1=1352123&r2=1352124&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
Wed Jun 20 14:20:40 2012
@@ -94,17 +94,19 @@ public interface ContentSession extends 
     CoreValueFactory getCoreValueFactory();
 
     /**
-     * Wait for changes to occur at {@code path} in the underlying repository.
-     * If {@code previous} is not {@code null} returns the {@link ChangeSet}
-     * instance following the one given in {@code previous}.
+     * Retrieves {@link ChangeSet changes} in the underlying repository which
+     * occurred at {@code path}. If {@code previous} is {@code null} this method
+     * blocks until a changes occurs but no longer than for {@code timeout}
+     * milliseconds. If {@code previous} is not {@code null} this method returns a
+     * {@code ChangeSet} instance which follows the one given in {@code previous}.
      *
-     * @param path  path to the subtree to watch for changes
+     * @param path  path to the subtree
      * @param previous  previous {@code ChangeSet} or {@code null}.
      * @param timeout the maximum time to wait in milliseconds
-     * @return  the next {@code ChangeSet} or {@code null} if a timeout occurred.
+     * @return  a next {@code ChangeSet} or {@code null} if a timeout occurred.
      */
     @CheckForNull
-    ChangeSet waitForChanges(String path, ChangeSet previous, long timeout);
+    ChangeSet getChanges(String path, ChangeSet previous, long timeout);
 
     // TODO : add versioning operations
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java?rev=1352124&r1=1352123&r2=1352124&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
Wed Jun 20 14:20:40 2012
@@ -100,7 +100,7 @@ class ContentSessionImpl implements Cont
     }
 
     @Override
-    public ChangeSet waitForChanges(String path, ChangeSet previous, long timeout) {
-        return null; // todo implement waitForChanges. See OAK-144
+    public ChangeSet getChanges(String path, ChangeSet previous, long timeout) {
+        return null; // todo implement getChanges. See OAK-144
     }
 }
\ No newline at end of file



Mime
View raw message