jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1390525 - in /jackrabbit/oak/trunk: oak-core/ oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ oak-core/src/main/j...
Date Wed, 26 Sep 2012 14:40:16 GMT
Author: mduerig
Date: Wed Sep 26 14:40:14 2012
New Revision: 1390525

URL: http://svn.apache.org/viewvc?rev=1390525&view=rev
Log:
OAK-197: oak-api ConflictHandler defines method using oak.spi.state.NodeState
move conflict handler from method parameter to plugin

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java   (contents, props changed)
      - copied, changed from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/AnnotatingConflictHandler.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandlerProvider.java   (with props)
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java   (contents, props changed)
      - copied, changed from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidator.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidatorProvider.java   (contents, props changed)
      - copied, changed from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidatorProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/DefaultConflictHandler.java   (contents, props changed)
      - copied, changed from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/DefaultConflictHandler.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandler.java   (contents, props changed)
      - copied, changed from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ConflictHandler.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandlerProvider.java   (with props)
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ConflictHandler.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/DefaultConflictHandler.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/AnnotatingConflictHandler.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidator.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidatorProvider.java
Modified:
    jackrabbit/oak/trunk/oak-core/pom.xml
    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/api/Root.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/Sql2QueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java
    jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java

Modified: jackrabbit/oak/trunk/oak-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/pom.xml?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-core/pom.xml Wed Sep 26 14:40:14 2012
@@ -39,27 +39,27 @@
         <configuration>
           <instructions>
             <Export-Package>
-              org.apache.jackrabbit.oak.api,
-              org.apache.jackrabbit.oak.core,
-              org.apache.jackrabbit.oak.util,
-              org.apache.jackrabbit.oak.namepath,
-              org.apache.jackrabbit.oak.plugins.identifier,
-              org.apache.jackrabbit.oak.plugins.name,
-              org.apache.jackrabbit.oak.plugins.type,
-              org.apache.jackrabbit.oak.plugins.unique,
-              org.apache.jackrabbit.oak.plugins.value,
-              org.apache.jackrabbit.oak.spi.query,
-              org.apache.jackrabbit.oak.spi.commit,
-              org.apache.jackrabbit.oak.spi.state,
-              org.apache.jackrabbit.oak.spi.security.authentication,
-              org.apache.jackrabbit.oak.spi.security.principal,
-              org.apache.jackrabbit.oak.spi.security.privilege,
-              org.apache.jackrabbit.oak.spi.security.user,
-              org.apache.jackrabbit.oak.spi.security.user.action,
-              org.apache.jackrabbit.oak.security.authorization,
-              org.apache.jackrabbit.oak.security.principal,
-              org.apache.jackrabbit.oak.security.privilege,
-              org.apache.jackrabbit.oak.security.user
+                org.apache.jackrabbit.oak.api,
+                org.apache.jackrabbit.oak.core,
+                org.apache.jackrabbit.oak.util,
+                org.apache.jackrabbit.oak.namepath,
+                org.apache.jackrabbit.oak.plugins.identifier,
+                org.apache.jackrabbit.oak.plugins.name,
+                org.apache.jackrabbit.oak.plugins.type,
+                org.apache.jackrabbit.oak.plugins.unique,
+                org.apache.jackrabbit.oak.plugins.commit,
+                org.apache.jackrabbit.oak.spi.query,
+                org.apache.jackrabbit.oak.spi.commit,
+                org.apache.jackrabbit.oak.spi.state,
+                org.apache.jackrabbit.oak.spi.security.authentication,
+                org.apache.jackrabbit.oak.spi.security.principal,
+                org.apache.jackrabbit.oak.spi.security.privilege,
+                org.apache.jackrabbit.oak.spi.security.user,
+                org.apache.jackrabbit.oak.spi.security.user.action,
+                org.apache.jackrabbit.oak.security.authorization,
+                org.apache.jackrabbit.oak.security.principal,
+                org.apache.jackrabbit.oak.security.privilege,
+                org.apache.jackrabbit.oak.security.user
             </Export-Package>
             <Bundle-Activator>
               org.apache.jackrabbit.oak.osgi.Activator

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=1390525&r1=1390524&r2=1390525&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 Sep 26 14:40:14 2012
@@ -68,7 +68,7 @@ public interface ContentSession extends 
 
     /**
      * The current head root as seen by this content session. Use
-     * {@link Root#commit(ConflictHandler)} to atomically apply the changes made
+     * {@link Root#commit()} to atomically apply the changes made
      * in that subtree the underlying Microkernel.
      * <p>
      * The root instance gives you a stable view of the tree at the time the

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java Wed Sep 26 14:40:14 2012
@@ -42,7 +42,7 @@ public interface Root {
      * </ul>
      * If a tree at {@code destinationPath} exists but is not accessible to the
      * editing content session this method succeeds but a subsequent
-     * {@link #commit(ConflictHandler)} will detect the violation and fail.
+     * {@link #commit()} will detect the violation and fail.
      *
      * @param sourcePath The source path
      * @param destPath The destination path
@@ -62,7 +62,7 @@ public interface Root {
      * </ul>
      * If a tree at {@code destinationPath} exists but is not accessible to the
      * editing content session this method succeeds but a subsequent
-     * {@link #commit(ConflictHandler)} will detect the violation and fail.
+     * {@link #commit()} will detect the violation and fail.
      *
      * @param sourcePath source path
      * @param destPath destination path
@@ -94,10 +94,8 @@ public interface Root {
      * Rebase this root instance to the latest revision. After a call to this method,
      * all trees obtained through {@link #getTree(String)} become invalid and fresh
      * instances must be obtained.
-     *
-     * @param conflictHandler A {@link ConflictHandler} for resolving conflicts.
      */
-    void rebase(ConflictHandler conflictHandler);
+    void rebase();
 
     /**
      * Reverts all changes made to this root and refreshed to the latest trunk.
@@ -112,10 +110,9 @@ public interface Root {
      * all trees obtained through {@link #getTree(String)} become invalid and fresh
      * instances must be obtained.
      *
-     * @param conflictHandler  {@link ConflictHandler} for resolving conflicts.
      * @throws CommitFailedException
      */
-    void commit(ConflictHandler conflictHandler) throws CommitFailedException;
+    void commit() throws CommitFailedException;
 
     /**
      * Determine whether there are changes on this tree

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java Wed Sep 26 14:40:14 2012
@@ -29,11 +29,13 @@ import org.apache.jackrabbit.mk.core.Mic
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
+import org.apache.jackrabbit.oak.plugins.commit.AnnotatingConflictHandlerProvider;
 import org.apache.jackrabbit.oak.query.QueryEngineImpl;
 import org.apache.jackrabbit.oak.security.authentication.LoginContextProviderImpl;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeValidatorProvider;
+import org.apache.jackrabbit.oak.spi.commit.ConflictHandlerProvider;
 import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.apache.jackrabbit.oak.spi.query.CompositeQueryIndexProvider;
@@ -55,8 +57,10 @@ public class ContentRepositoryImpl imple
     // TODO: retrieve default wsp-name from configuration
     private static final String DEFAULT_WORKSPACE_NAME = "default";
 
-    private final LoginContextProvider loginContextProvider;
+    private static final ConflictHandlerProvider DEFAULT_CONFLICT_HANDLER_PROVIDER =
+            new AnnotatingConflictHandlerProvider();
 
+    private final LoginContextProvider loginContextProvider;
     private final QueryEngineImpl queryEngine;
     private final KernelNodeStore nodeStore;
 
@@ -156,6 +160,7 @@ public class ContentRepositoryImpl imple
         LoginContext loginContext = loginContextProvider.getLoginContext(credentials, workspaceName);
         loginContext.login();
 
-        return new ContentSessionImpl(loginContext, workspaceName, nodeStore, queryEngine);
+        return new ContentSessionImpl(loginContext, workspaceName, nodeStore, DEFAULT_CONFLICT_HANDLER_PROVIDER,
+                queryEngine);
     }
 }

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=1390525&r1=1390524&r2=1390525&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 Sep 26 14:40:14 2012
@@ -31,6 +31,7 @@ import org.apache.jackrabbit.oak.api.Ses
 import org.apache.jackrabbit.oak.plugins.type.BuiltInNodeTypes;
 import org.apache.jackrabbit.oak.query.QueryEngineImpl;
 import org.apache.jackrabbit.oak.query.SessionQueryEngineImpl;
+import org.apache.jackrabbit.oak.spi.commit.ConflictHandlerProvider;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -47,16 +48,18 @@ class ContentSessionImpl implements Cont
     private final LoginContext loginContext;
     private final String workspaceName;
     private final NodeStore store;
+    private final ConflictHandlerProvider conflictHandlerProvider;
     private final SessionQueryEngine queryEngine;
 
     private boolean initialised;
 
     public ContentSessionImpl(LoginContext loginContext, String workspaceName,
-                              NodeStore store, QueryEngineImpl queryEngine) {
-
+            NodeStore store, ConflictHandlerProvider conflictHandlerProvider,
+            QueryEngineImpl queryEngine) {
         this.loginContext = loginContext;
         this.workspaceName = workspaceName;
         this.store = store;
+        this.conflictHandlerProvider = conflictHandlerProvider;
         this.queryEngine = new SessionQueryEngineImpl(this, checkNotNull(queryEngine));
     }
 
@@ -82,7 +85,11 @@ class ContentSessionImpl implements Cont
             }
         }
 
-        return new RootImpl(store, workspaceName, loginContext.getSubject());
+        RootImpl root = new RootImpl(store, workspaceName, loginContext.getSubject());
+        if (conflictHandlerProvider != null) {
+            root.setConflictHandler(conflictHandlerProvider.getConflictHandler(getCoreValueFactory()));
+        }
+        return root;
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java Wed Sep 26 14:40:14 2012
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.oak.core;
 
-import org.apache.jackrabbit.oak.api.ConflictHandler;
+import org.apache.jackrabbit.oak.spi.commit.ConflictHandler;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
@@ -27,8 +27,8 @@ import org.slf4j.LoggerFactory;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
-import static org.apache.jackrabbit.oak.api.ConflictHandler.Resolution.MERGED;
-import static org.apache.jackrabbit.oak.api.ConflictHandler.Resolution.OURS;
+import static org.apache.jackrabbit.oak.spi.commit.ConflictHandler.Resolution.MERGED;
+import static org.apache.jackrabbit.oak.spi.commit.ConflictHandler.Resolution.OURS;
 
 /**
  * MergingNodeStateDiff... TODO

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java Wed Sep 26 14:40:14 2012
@@ -28,7 +28,8 @@ import javax.security.auth.Subject;
 
 import org.apache.jackrabbit.oak.api.ChangeExtractor;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.ConflictHandler;
+import org.apache.jackrabbit.oak.plugins.commit.DefaultConflictHandler;
+import org.apache.jackrabbit.oak.spi.commit.ConflictHandler;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.security.authorization.AccessControlContextImpl;
@@ -83,6 +84,8 @@ public class RootImpl implements Root {
      */
     private List<PurgeListener> purgePurgeListeners = new ArrayList<PurgeListener>();
 
+    private volatile ConflictHandler conflictHandler = DefaultConflictHandler.OURS;
+
     /**
      * Purge listener.
      * @see #purgePurgeListeners
@@ -104,6 +107,14 @@ public class RootImpl implements Root {
         refresh();
     }
 
+    public void setConflictHandler(ConflictHandler conflictHandler) {
+        this.conflictHandler = conflictHandler;
+    }
+
+    public ConflictHandler getConflictHandler() {
+        return conflictHandler;
+    }
+
     //---------------------------------------------------------------< Root >---
     @Override
     public boolean move(String sourcePath, String destPath) {
@@ -144,7 +155,7 @@ public class RootImpl implements Root {
     }
 
     @Override
-    public void rebase(ConflictHandler conflictHandler) {
+    public void rebase() {
         if (!store.getRoot().equals(rootTree.getBaseState())) {
             purgePendingChanges();
             NodeState base = getBaseState();
@@ -161,8 +172,8 @@ public class RootImpl implements Root {
     }
 
     @Override
-    public void commit(ConflictHandler conflictHandler) throws CommitFailedException {
-        rebase(conflictHandler);
+    public void commit() throws CommitFailedException {
+        rebase();
         purgePendingChanges();
         CommitFailedException exception = Subject.doAs(
                 getCombinedSubject(), new PrivilegedAction<CommitFailedException>() {

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java (from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/AnnotatingConflictHandler.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/AnnotatingConflictHandler.java&r1=1390513&r2=1390525&rev=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/AnnotatingConflictHandler.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java Wed Sep 26 14:40:14 2012
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.oak.plugins.value;
+package org.apache.jackrabbit.oak.plugins.commit;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import javax.jcr.PropertyType;
 
-import org.apache.jackrabbit.oak.api.ConflictHandler;
+import org.apache.jackrabbit.oak.spi.commit.ConflictHandler;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.PropertyState;

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandlerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandlerProvider.java?rev=1390525&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandlerProvider.java (added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandlerProvider.java Wed Sep 26 14:40:14 2012
@@ -0,0 +1,12 @@
+package org.apache.jackrabbit.oak.plugins.commit;
+
+import org.apache.jackrabbit.oak.api.CoreValueFactory;
+import org.apache.jackrabbit.oak.spi.commit.ConflictHandler;
+import org.apache.jackrabbit.oak.spi.commit.ConflictHandlerProvider;
+
+public class AnnotatingConflictHandlerProvider implements ConflictHandlerProvider {
+    @Override
+    public ConflictHandler getConflictHandler(CoreValueFactory valueFactory) {
+        return new AnnotatingConflictHandler(valueFactory);
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandlerProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandlerProvider.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java (from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidator.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidator.java&r1=1390513&r2=1390525&rev=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidator.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java Wed Sep 26 14:40:14 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.oak.plugins.value;
+package org.apache.jackrabbit.oak.plugins.commit;
 
 import javax.jcr.InvalidItemStateException;
 

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidatorProvider.java (from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidatorProvider.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidatorProvider.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidatorProvider.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidatorProvider.java&r1=1390513&r2=1390525&rev=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ConflictValidatorProvider.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidatorProvider.java Wed Sep 26 14:40:14 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.oak.plugins.value;
+package org.apache.jackrabbit.oak.plugins.commit;
 
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidatorProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidatorProvider.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/DefaultConflictHandler.java (from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/DefaultConflictHandler.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/DefaultConflictHandler.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/DefaultConflictHandler.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/DefaultConflictHandler.java&r1=1390513&r2=1390525&rev=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/DefaultConflictHandler.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/DefaultConflictHandler.java Wed Sep 26 14:40:14 2012
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.core;
+package org.apache.jackrabbit.oak.plugins.commit;
 
-import org.apache.jackrabbit.oak.api.ConflictHandler;
+import org.apache.jackrabbit.oak.spi.commit.ConflictHandler;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.spi.state.NodeState;

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/DefaultConflictHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/DefaultConflictHandler.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java Wed Sep 26 14:40:14 2012
@@ -24,7 +24,6 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.plugins.memory.StringValue;
 
 /**
@@ -83,7 +82,7 @@ public abstract class ReadWriteNamespace
                 }
             }
             namespaces.setProperty(prefix, new StringValue(uri));
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
             refresh();
         } catch (NamespaceValidatorException e) {
             throw e.getNamespaceException();
@@ -106,7 +105,7 @@ public abstract class ReadWriteNamespace
 
         try {
             namespaces.removeProperty(prefix);
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
             refresh();
         } catch (NamespaceValidatorException e) {
             throw e.getNamespaceException();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java Wed Sep 26 14:40:14 2012
@@ -43,7 +43,6 @@ import org.apache.jackrabbit.commons.ite
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.util.NodeUtil;
 
 import static org.apache.jackrabbit.JcrConstants.JCR_AUTOCREATED;
@@ -188,7 +187,7 @@ public abstract class ReadWriteNodeTypeM
         Tree types = getOrCreateNodeTypes(root);
         try {
             NodeType type = internalRegister(types, ntd, allowUpdate);
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
             refresh();
             return type;
         } catch (CommitFailedException e) {
@@ -207,7 +206,7 @@ public abstract class ReadWriteNodeTypeM
             for (NodeTypeDefinition ntd : ntds) {
                 list.add(internalRegister(types, ntd, allowUpdate));
             }
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
             refresh();
             return new NodeTypeIteratorAdapter(list);
         } catch (CommitFailedException e) {
@@ -349,7 +348,7 @@ public abstract class ReadWriteNodeTypeM
 
         try {
             type.remove();
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
             refresh();
         } catch (CommitFailedException e) {
             throw new RepositoryException("Failed to unregister node type " + name, e);
@@ -372,7 +371,7 @@ public abstract class ReadWriteNodeTypeM
                 }
                 type.remove();
             }
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
             refresh();
         } catch (CommitFailedException e) {
             throw new RepositoryException("Failed to unregister node types", e);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java Wed Sep 26 14:40:14 2012
@@ -27,6 +27,7 @@ import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
 import java.util.Map;
+
 import javax.annotation.CheckForNull;
 import javax.jcr.Credentials;
 import javax.jcr.SimpleCredentials;
@@ -39,7 +40,6 @@ import org.apache.jackrabbit.oak.api.Cor
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.spi.security.user.PasswordUtility;
 import org.apache.jackrabbit.oak.spi.security.user.Type;
 import org.apache.jackrabbit.oak.spi.security.user.UserContext;
@@ -140,7 +140,7 @@ public class TokenProviderImpl implement
                             tokenNode.setString(name, attr);
                         }
                     }
-                    root.commit(DefaultConflictHandler.OURS);
+                    root.commit();
 
                     // also set the new token to the simple credentials.
                     sc.setAttribute(TOKEN_ATTRIBUTE, token);
@@ -180,7 +180,7 @@ public class TokenProviderImpl implement
         if (tokenTree != null) {
             try {
                 if (tokenTree.remove()) {
-                    root.commit(DefaultConflictHandler.OURS);
+                    root.commit();
                     return true;
                 }
             } catch (CommitFailedException e) {
@@ -200,7 +200,7 @@ public class TokenProviderImpl implement
                 long expirationTime = loginTime + tokenExpiration;
                 try {
                     tokenNode.setDate(TOKEN_ATTRIBUTE_EXPIRY, expirationTime);
-                    root.commit(DefaultConflictHandler.OURS);
+                    root.commit();
                     return true;
                 } catch (CommitFailedException e) {
                     log.warn("Error while resetting token expiration", e.getMessage());

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java Wed Sep 26 14:40:14 2012
@@ -19,6 +19,7 @@ package org.apache.jackrabbit.oak.securi
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
+
 import javax.annotation.Nonnull;
 import javax.jcr.RepositoryException;
 
@@ -26,7 +27,6 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeDefinition;
 import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeProvider;
 import org.apache.jackrabbit.oak.util.NodeUtil;
@@ -121,7 +121,7 @@ public class PrivilegeRegistry implement
             writeDefinition(privilegesNode, toRegister);
 
             // delegate validation to the commit validation (see above)
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
 
         } catch (CommitFailedException e) {
             Throwable t = e.getCause();

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandler.java (from r1390513, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ConflictHandler.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandler.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandler.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ConflictHandler.java&r1=1390513&r2=1390525&rev=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ConflictHandler.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandler.java Wed Sep 26 14:40:14 2012
@@ -16,14 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.api;
+package org.apache.jackrabbit.oak.spi.commit;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 /**
  * A {@code ConflictHandler} is responsible for handling conflicts which happen
- * on {@link Root#rebase(ConflictHandler)} and on the implicit rebase operation which
- * takes part on {@link Root#commit(ConflictHandler)}.
+ * on {@link org.apache.jackrabbit.oak.api.Root#rebase()} and on the implicit rebase operation which
+ * takes part on {@link org.apache.jackrabbit.oak.api.Root#commit()}.
  *
  * This interface contains one method per type of conflict which might occur.
  * Each of these methods must return a {@link Resolution} for the current conflict.
@@ -40,7 +42,7 @@ public interface ConflictHandler {
      */
     enum Resolution {
         /**
-         * Use the changes from the current {@link Root} instance
+         * Use the changes from the current {@link org.apache.jackrabbit.oak.api.Root} instance
          */
         OURS,
 

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandler.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandlerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandlerProvider.java?rev=1390525&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandlerProvider.java (added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandlerProvider.java Wed Sep 26 14:40:14 2012
@@ -0,0 +1,7 @@
+package org.apache.jackrabbit.oak.spi.commit;
+
+import org.apache.jackrabbit.oak.api.CoreValueFactory;
+
+public interface ConflictHandlerProvider {
+    ConflictHandler getConflictHandler(CoreValueFactory valueFactory);
+}

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandlerProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ConflictHandlerProvider.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTest.java Wed Sep 26 14:40:14 2012
@@ -24,6 +24,7 @@ import org.apache.jackrabbit.oak.api.Cor
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.plugins.commit.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.junit.Test;
 
@@ -32,7 +33,7 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertNull;
 
 public class DefaultConflictHandlerTest extends AbstractCoreTest {
-    private Root ourRoot;
+    private RootImpl ourRoot;
     private Root theirRoot;
     private CoreValue ourValue;
     private CoreValue theirValue;
@@ -55,8 +56,8 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").setProperty("p", theirValue);
         ourRoot.getTree("/").setProperty("p", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.OURS);
-        ourRoot.commit(DefaultConflictHandler.OURS);
+        theirRoot.commit();
+        ourRoot.commit();
 
         PropertyState p = ourRoot.getTree("/").getProperty("p");
         assertNotNull(p);
@@ -68,8 +69,8 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").removeProperty("a");
         ourRoot.getTree("/").setProperty("a", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.OURS);
-        ourRoot.commit(DefaultConflictHandler.OURS);
+        theirRoot.commit();
+        ourRoot.commit();
 
         PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNotNull(p);
@@ -81,8 +82,8 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").setProperty("a", theirValue);
         ourRoot.getTree("/").setProperty("a", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.OURS);
-        ourRoot.commit(DefaultConflictHandler.OURS);
+        theirRoot.commit();
+        ourRoot.commit();
 
         PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNotNull(p);
@@ -94,8 +95,8 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").setProperty("a", theirValue);
         ourRoot.getTree("/").removeProperty("a");
 
-        theirRoot.commit(DefaultConflictHandler.OURS);
-        ourRoot.commit(DefaultConflictHandler.OURS);
+        theirRoot.commit();
+        ourRoot.commit();
 
         PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNull(p);
@@ -106,8 +107,8 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").addChild("n").setProperty("p", theirValue);
         ourRoot.getTree("/").addChild("n").setProperty("p", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.OURS);
-        ourRoot.commit(DefaultConflictHandler.OURS);
+        theirRoot.commit();
+        ourRoot.commit();
 
         Tree n = ourRoot.getTree("/n");
         assertNotNull(n);
@@ -119,8 +120,8 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/x").remove();
         ourRoot.getTree("/x").setProperty("p", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.OURS);
-        ourRoot.commit(DefaultConflictHandler.OURS);
+        theirRoot.commit();
+        ourRoot.commit();
 
         Tree n = ourRoot.getTree("/x");
         assertNotNull(n);
@@ -132,8 +133,8 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/x").setProperty("p", theirValue);
         ourRoot.getTree("/x").remove();
 
-        theirRoot.commit(DefaultConflictHandler.OURS);
-        ourRoot.commit(DefaultConflictHandler.OURS);
+        theirRoot.commit();
+        ourRoot.commit();
 
         Tree n = ourRoot.getTree("/x");
         assertNull(n);
@@ -144,8 +145,9 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").setProperty("p", theirValue);
         ourRoot.getTree("/").setProperty("p", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.THEIRS);
-        ourRoot.commit(DefaultConflictHandler.THEIRS);
+        theirRoot.commit();
+        ourRoot.setConflictHandler(DefaultConflictHandler.THEIRS);
+        ourRoot.commit();
 
         PropertyState p = ourRoot.getTree("/").getProperty("p");
         assertNotNull(p);
@@ -157,8 +159,9 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").removeProperty("a");
         ourRoot.getTree("/").setProperty("a", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.THEIRS);
-        ourRoot.commit(DefaultConflictHandler.THEIRS);
+        theirRoot.commit();
+        ourRoot.setConflictHandler(DefaultConflictHandler.THEIRS);
+        ourRoot.commit();
 
         PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNull(p);
@@ -169,8 +172,9 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").setProperty("a", theirValue);
         ourRoot.getTree("/").setProperty("a", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.THEIRS);
-        ourRoot.commit(DefaultConflictHandler.THEIRS);
+        theirRoot.commit();
+        ourRoot.setConflictHandler(DefaultConflictHandler.THEIRS);
+        ourRoot.commit();
 
         PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNotNull(p);
@@ -182,8 +186,9 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").setProperty("a", theirValue);
         ourRoot.getTree("/").removeProperty("a");
 
-        theirRoot.commit(DefaultConflictHandler.THEIRS);
-        ourRoot.commit(DefaultConflictHandler.THEIRS);
+        theirRoot.commit();
+        ourRoot.setConflictHandler(DefaultConflictHandler.THEIRS);
+        ourRoot.commit();
 
         PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNotNull(p);
@@ -195,8 +200,9 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/").addChild("n").setProperty("p", theirValue);
         ourRoot.getTree("/").addChild("n").setProperty("p", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.THEIRS);
-        ourRoot.commit(DefaultConflictHandler.THEIRS);
+        theirRoot.commit();
+        ourRoot.setConflictHandler(DefaultConflictHandler.THEIRS);
+        ourRoot.commit();
 
         Tree n = ourRoot.getTree("/n");
         assertNotNull(n);
@@ -208,8 +214,9 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/x").remove();
         ourRoot.getTree("/x").setProperty("p", ourValue);
 
-        theirRoot.commit(DefaultConflictHandler.THEIRS);
-        ourRoot.commit(DefaultConflictHandler.THEIRS);
+        theirRoot.commit();
+        ourRoot.setConflictHandler(DefaultConflictHandler.THEIRS);
+        ourRoot.commit();
 
         Tree n = ourRoot.getTree("/x");
         assertNull(n);
@@ -220,8 +227,8 @@ public class DefaultConflictHandlerTest 
         theirRoot.getTree("/x").setProperty("p", theirValue);
         ourRoot.getTree("/").remove();
 
-        theirRoot.commit(DefaultConflictHandler.THEIRS);
-        ourRoot.commit(DefaultConflictHandler.THEIRS);
+        theirRoot.commit();
+        ourRoot.commit();
 
         Tree n = ourRoot.getTree("/x");
         assertNotNull(n);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java Wed Sep 26 14:40:14 2012
@@ -96,10 +96,10 @@ public class RootImplFuzzIT {
             op.apply(root2);
             checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-            root1.commit(DefaultConflictHandler.OURS);
+            root1.commit();
             checkEqual(root1.getTree("/"), root2.getTree("/"));
             if (op instanceof Save) {
-                root2.commit(DefaultConflictHandler.OURS);
+                root2.commit();
                 assertEquals("seed " + SEED, store1.getRoot(), store2.getRoot());
             }
         }
@@ -272,7 +272,7 @@ public class RootImplFuzzIT {
         static class Rebase extends Operation {
             @Override
             void apply(RootImpl root) {
-                root.rebase(DefaultConflictHandler.OURS);
+                root.rebase();
             }
 
             @Override

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java Wed Sep 26 14:40:14 2012
@@ -82,7 +82,7 @@ public class RootImplTest extends Abstra
         assertFalse(tree.hasChild("x"));
         assertTrue(y.hasChild("xx"));
         
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         assertFalse(tree.hasChild("x"));
@@ -122,7 +122,7 @@ public class RootImplTest extends Abstra
         assertFalse(r.hasChild("a"));
         assertFalse(r.hasChild("b"));
 
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         assertFalse(r.hasChild("a"));
         assertFalse(r.hasChild("b"));
     }
@@ -137,7 +137,7 @@ public class RootImplTest extends Abstra
         assertFalse(tree.hasChild("x"));
         assertTrue(tree.hasChild("xx"));
         
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         assertFalse(tree.hasChild("x"));
@@ -156,7 +156,7 @@ public class RootImplTest extends Abstra
         assertTrue(tree.hasChild("x"));
         assertTrue(y.hasChild("xx"));
         
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         assertTrue(tree.hasChild("x"));
@@ -176,7 +176,7 @@ public class RootImplTest extends Abstra
         assertTrue(y.hasChild("xx"));
         assertTrue(y.getChild("xx").hasChild("x1"));
 
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         assertTrue(tree.hasChild("x"));
@@ -199,17 +199,17 @@ public class RootImplTest extends Abstra
         CoreValue value = valueFactory.createValue("V1");
         root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", value);
-        root2.commit(DefaultConflictHandler.OURS);
+        root2.commit();
 
-        root1.rebase(DefaultConflictHandler.OURS);
+        root1.rebase();
         checkEqual(root1.getTree("/"), (root2.getTree("/")));
 
         Tree one = root2.getTree("/one");
         one.getChild("two").remove();
         one.addChild("four");
-        root2.commit(DefaultConflictHandler.OURS);
+        root2.commit();
 
-        root1.rebase(DefaultConflictHandler.OURS);
+        root1.rebase();
         checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java Wed Sep 26 14:40:14 2012
@@ -131,7 +131,7 @@ public class TreeImplTest extends Abstra
         assertEquals("new", added.getName());
         assertTrue(tree.hasChild("new"));
 
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         assertTrue(tree.hasChild("new"));
@@ -148,7 +148,7 @@ public class TreeImplTest extends Abstra
         assertFalse(tree.hasChild("new"));
         tree.addChild("new");
 
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         assertTrue(tree.hasChild("new"));
@@ -166,7 +166,7 @@ public class TreeImplTest extends Abstra
         tree.getChild("x").remove();
         assertFalse(tree.hasChild("x"));
 
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         assertFalse(tree.hasChild("x"));
@@ -185,7 +185,7 @@ public class TreeImplTest extends Abstra
         assertEquals("new", property.getName());
         assertEquals(value, property.getValue());
 
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         property = tree.getProperty("new");
@@ -203,7 +203,7 @@ public class TreeImplTest extends Abstra
         tree.removeProperty("a");
         assertFalse(tree.hasProperty("a"));
 
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
 
         assertFalse(tree.hasProperty("a"));
@@ -253,12 +253,12 @@ public class TreeImplTest extends Abstra
         Tree tree = root.getTree("/");
 
         tree.setProperty("P0", valueFactory.createValue("V1"));
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
         assertTrue(tree.hasProperty("P0"));
 
         tree.removeProperty("P0");
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
         assertFalse(tree.hasProperty("P0"));
     }
@@ -270,20 +270,20 @@ public class TreeImplTest extends Abstra
 
         tree.addChild("new");
         assertEquals(Tree.Status.NEW, tree.getChild("new").getStatus());
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         tree = root.getTree("/");
         assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
         Tree added = tree.getChild("new");
         added.addChild("another");
         assertEquals(Tree.Status.MODIFIED, tree.getChild("new").getStatus());
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         tree = root.getTree("/");
         assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
         tree.getChild("new").getChild("another").remove();
         assertEquals(Tree.Status.MODIFIED, tree.getChild("new").getStatus());
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         tree = root.getTree("/");
         assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
@@ -305,19 +305,19 @@ public class TreeImplTest extends Abstra
 
         tree.setProperty("new", value1);
         assertEquals(Tree.Status.NEW, tree.getPropertyStatus("new"));
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         tree = root.getTree("/");
         assertEquals(Tree.Status.EXISTING, tree.getPropertyStatus("new"));
         tree.setProperty("new", value2);
         assertEquals(Tree.Status.MODIFIED, tree.getPropertyStatus("new"));
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         tree = root.getTree("/");
         assertEquals(Tree.Status.EXISTING, tree.getPropertyStatus("new"));
         tree.removeProperty("new");
         assertEquals(Tree.Status.REMOVED, tree.getPropertyStatus("new"));
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         tree = root.getTree("/");
         assertNull(tree.getPropertyStatus("new"));
@@ -333,7 +333,7 @@ public class TreeImplTest extends Abstra
         RootImpl root = createRootImpl(null);
         Tree tree = root.getTree("/");
         tree.addChild("one").addChild("two");
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         tree = root.getTree("/");
         tree.getChild("one").getChild("two").addChild("three");
@@ -356,7 +356,7 @@ public class TreeImplTest extends Abstra
             tree.addChild(name);
         }
 
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
         tree = root.getTree("/");
         tree = tree.getChild("large");
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java Wed Sep 26 14:40:14 2012
@@ -31,7 +31,6 @@ import org.apache.jackrabbit.oak.api.Ses
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.query.CompositeQueryIndexProvider;
@@ -82,7 +81,7 @@ public abstract class AbstractLuceneQuer
         }
         index.addChild("test-lucene").setProperty("type",
                 vf.createValue("lucene"));
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
     }
 
     protected Result executeQuery(String statement) throws ParseException {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java Wed Sep 26 14:40:14 2012
@@ -16,17 +16,11 @@
  */
 package org.apache.jackrabbit.oak.plugins.lucene;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
-
 import javax.security.auth.Subject;
 
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.core.RootImpl;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryValueFactory;
@@ -39,6 +33,11 @@ import org.apache.jackrabbit.oak.spi.que
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.junit.Test;
 
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
+
 public class LuceneEditorTest implements LuceneIndexConstants {
 
     @Test
@@ -52,7 +51,7 @@ public class LuceneEditorTest implements
         Tree tree = root.getTree("/");
 
         tree.setProperty("foo", MemoryValueFactory.INSTANCE.createValue("bar"));
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         QueryIndex index = new LuceneIndex(testID);
         FilterImpl filter = new FilterImpl(null);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/Sql2QueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/Sql2QueryTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/Sql2QueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/Sql2QueryTest.java Wed Sep 26 14:40:14 2012
@@ -16,17 +16,16 @@
  */
 package org.apache.jackrabbit.oak.plugins.lucene;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-
 import java.util.Iterator;
 
 import org.apache.jackrabbit.oak.api.ResultRow;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 public class Sql2QueryTest extends AbstractLuceneQueryTest {
 
     @Test
@@ -35,7 +34,7 @@ public class Sql2QueryTest extends Abstr
         Tree test = root.getTree("/").addChild("test");
         test.addChild("a").setProperty("name", vf.createValue("hello"));
         test.addChild("b").setProperty("name", vf.createValue("nothello"));
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         String sql = "select * from [nt:base] where name = 'hello'";
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java Wed Sep 26 14:40:14 2012
@@ -13,10 +13,6 @@
  */
 package org.apache.jackrabbit.oak.query;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -34,9 +30,12 @@ import java.util.List;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.Result;
 import org.apache.jackrabbit.oak.api.ResultRow;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 /**
  * Test the query feature.
  */
@@ -73,7 +72,7 @@ public class QueryTest extends AbstractQ
                 root,
                 "/ + \"test\": { \"hello\": {\"id\": \"1\"}, \"world\": {\"id\": \"2\"}}",
                 vf);
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         HashMap<String, CoreValue> sv = new HashMap<String, CoreValue>();
         sv.put("id", vf.createValue("1"));
@@ -189,7 +188,7 @@ public class QueryTest extends AbstractQ
                     w.println(line);
                     line = line.substring("commit".length()).trim();
                     JsopUtil.apply(root, line, vf);
-                    root.commit(DefaultConflictHandler.OURS);
+                    root.commit();
                 }
                 w.flush();
             }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderImplTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderImplTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderImplTest.java Wed Sep 26 14:40:14 2012
@@ -21,6 +21,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+
 import javax.jcr.RepositoryException;
 
 import org.apache.jackrabbit.oak.AbstractOakTest;
@@ -30,7 +31,6 @@ import org.apache.jackrabbit.oak.api.Con
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.plugins.unique.UniqueIndexHook;
 import org.apache.jackrabbit.oak.spi.security.user.Type;
 import org.apache.jackrabbit.oak.spi.security.user.UserConfig;
@@ -223,7 +223,7 @@ public class UserProviderImplTest extend
         for (String uid : colliding.keySet()) {
             try {
                 Tree c = userProvider.createUser(uid, colliding.get(uid));
-                root.commit(DefaultConflictHandler.OURS);
+                root.commit();
                 fail("userID collision must be detected");
             } catch (CommitFailedException e) {
                 // success
@@ -233,7 +233,7 @@ public class UserProviderImplTest extend
         for (String uid : colliding.keySet()) {
             try {
                 Tree c = userProvider.createGroup(uid, colliding.get(uid));
-                root.commit(DefaultConflictHandler.OURS);
+                root.commit();
                 fail("userID collision must be detected");
             } catch (CommitFailedException e) {
                 // success
@@ -253,7 +253,7 @@ public class UserProviderImplTest extend
 
         for (String uid : m.keySet()) {
             Tree user = userProvider.createUser(uid, null);
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
 
             assertEquals(defaultUserPath + m.get(uid), user.getPath());
             assertEquals(uid, userProvider.getAuthorizableId(user));
@@ -272,7 +272,7 @@ public class UserProviderImplTest extend
 
         Tree user = up.createUser(userID, null);
         Tree group = up.createGroup(groupID, null);
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         Tree a = up.getAuthorizable(userID);
         assertNotNull(a);
@@ -289,7 +289,7 @@ public class UserProviderImplTest extend
 
         String userID = "thabit";
         Tree user = up.createUser(userID, null);
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         Tree a = up.getAuthorizable(userID, Type.USER);
         assertNotNull(a);
@@ -300,7 +300,7 @@ public class UserProviderImplTest extend
 
         String groupID = "hr";
         Tree group = up.createGroup(groupID, null);
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         Tree g = up.getAuthorizable(groupID, Type.GROUP);
         assertNotNull(a);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java Wed Sep 26 14:40:14 2012
@@ -16,21 +16,20 @@
  */
 package org.apache.jackrabbit.oak.util;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
 import org.apache.jackrabbit.oak.AbstractOakTest;
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.query.JsopUtil;
 import org.junit.Before;
 import org.junit.Test;
 
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+
 public class JsopUtilTest extends AbstractOakTest {
 
     protected ContentSession session;
@@ -58,7 +57,7 @@ public class JsopUtilTest extends Abstra
 
         String add = "/ + \"test\": { \"a\": { \"id\": \"123\" }, \"b\": {} }";
         JsopUtil.apply(root, add, vf);
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         t = root.getTree("/");
         assertTrue(t.hasChild("test"));
@@ -77,7 +76,7 @@ public class JsopUtilTest extends Abstra
 
         String rm = "/ - \"test\"";
         JsopUtil.apply(root, rm, vf);
-        root.commit(DefaultConflictHandler.OURS);
+        root.commit();
 
         t = root.getTree("/");
         assertFalse(t.hasChild("test"));

Modified: jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java (original)
+++ jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java Wed Sep 26 14:40:14 2012
@@ -28,21 +28,19 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.dataformat.smile.SmileFactory;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryValueFactory;
 import org.apache.tika.mime.MediaType;
 
-import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.dataformat.smile.SmileFactory;
-
 public class OakServlet extends HttpServlet {
 
     private static final MediaType JSON =
@@ -107,7 +105,7 @@ public class OakServlet extends HttpServ
             JsonNode node = mapper.readTree(request.getInputStream());
             if (node.isObject()) {
                 post(node, tree);
-                root.commit(DefaultConflictHandler.OURS);
+                root.commit();
                 doGet(request, response);
             } else {
                 response.sendError(HttpServletResponse.SC_BAD_REQUEST);
@@ -168,7 +166,7 @@ public class OakServlet extends HttpServ
                 if (child != null) {
                     child.remove();
                 }
-                root.commit(DefaultConflictHandler.OURS);
+                root.commit();
                 response.sendError(HttpServletResponse.SC_OK);
             } else {
                 // Can't remove the root node

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java Wed Sep 26 14:40:14 2012
@@ -69,7 +69,6 @@ import org.apache.jackrabbit.oak.api.Roo
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Tree.Status;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.jcr.value.ValueConverter;
 import org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager;
 import org.apache.jackrabbit.oak.plugins.type.NodeTypeConstants;
@@ -1225,7 +1224,7 @@ public class NodeImpl extends ItemImpl<N
             }
             tree.setProperty(lockOwner, factory.createValue(userID));
             tree.setProperty(lockIsDeep, factory.createValue(isDeep));
-            root.commit(DefaultConflictHandler.OURS); // TODO: fail instead?
+            root.commit(); // TODO: fail instead?
         } catch (CommitFailedException e) {
             throw new RepositoryException("Unable to lock " + this, e);
         }
@@ -1298,7 +1297,7 @@ public class NodeImpl extends ItemImpl<N
             }
             tree.removeProperty(lockOwner);
             tree.removeProperty(lockIsDeep);
-            root.commit(DefaultConflictHandler.OURS);
+            root.commit();
         } catch (CommitFailedException e) {
             throw new RepositoryException("Unable to unlock " + this, e);
         }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java Wed Sep 26 14:40:14 2012
@@ -36,7 +36,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.name.NamespaceValidatorProvider;
 import org.apache.jackrabbit.oak.plugins.type.TypeValidatorProvider;
 import org.apache.jackrabbit.oak.plugins.unique.UniqueIndexHook;
-import org.apache.jackrabbit.oak.plugins.value.ConflictValidatorProvider;
+import org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider;
 import org.apache.jackrabbit.oak.security.authorization.AccessControlValidatorProvider;
 import org.apache.jackrabbit.oak.security.authorization.PermissionValidatorProvider;
 import org.apache.jackrabbit.oak.security.privilege.PrivilegeValidatorProvider;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java Wed Sep 26 14:40:14 2012
@@ -38,14 +38,12 @@ import org.apache.jackrabbit.api.securit
 import org.apache.jackrabbit.oak.api.AuthInfo;
 import org.apache.jackrabbit.oak.api.ChangeExtractor;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.ConflictHandler;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.SessionQueryEngine;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.jcr.observation.ObservationManagerImpl;
 import org.apache.jackrabbit.oak.jcr.security.principal.PrincipalManagerImpl;
 import org.apache.jackrabbit.oak.jcr.security.user.UserManagerImpl;
@@ -54,7 +52,6 @@ import org.apache.jackrabbit.oak.namepat
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.namepath.NamePathMapperImpl;
 import org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager;
-import org.apache.jackrabbit.oak.plugins.value.AnnotatingConflictHandler;
 import org.apache.jackrabbit.oak.security.principal.TmpPrincipalProvider;
 import org.apache.jackrabbit.oak.security.user.UserContextImpl;
 import org.apache.jackrabbit.oak.spi.security.user.UserContext;
@@ -75,7 +72,6 @@ public class SessionDelegate {
     private final Workspace workspace;
     private final Session session;
     private final Root root;
-    private final ConflictHandler conflictHandler;
     private final boolean autoRefresh;
 
     private final IdentifierManager idManager;
@@ -95,7 +91,6 @@ public class SessionDelegate {
         this.workspace = new WorkspaceImpl(this);
         this.session = new SessionImpl(this);
         this.root = contentSession.getLatestRoot();
-        this.conflictHandler = new AnnotatingConflictHandler(contentSession.getCoreValueFactory());
         this.autoRefresh = autoRefresh;
         this.idManager = new IdentifierManager(contentSession.getQueryEngine(), root);
         this.namePathMapper = new NamePathMapperImpl(new SessionNameMapper(), idManager);
@@ -228,7 +223,7 @@ public class SessionDelegate {
 
     public void save() throws RepositoryException {
         try {
-            root.commit(conflictHandler);
+            root.commit();
         } catch (CommitFailedException e) {
             e.throwRepositoryException();
         }
@@ -236,8 +231,9 @@ public class SessionDelegate {
 
     public void refresh(boolean keepChanges) {
         if (keepChanges) {
-            root.rebase(conflictHandler);
-        } else {
+            root.rebase();
+        }
+        else {
             root.refresh();
         }
     }
@@ -372,8 +368,9 @@ public class SessionDelegate {
         try {
             Root currentRoot = contentSession.getLatestRoot();
             currentRoot.copy(srcPath, destPath);
-            currentRoot.commit(DefaultConflictHandler.OURS);
-        } catch (CommitFailedException e) {
+            currentRoot.commit();
+        }
+        catch (CommitFailedException e) {
             e.throwRepositoryException();
         }
     }
@@ -412,7 +409,7 @@ public class SessionDelegate {
         try {
             moveRoot.move(srcPath, destPath);
             if (!transientOp) {
-                moveRoot.commit(DefaultConflictHandler.OURS);
+                moveRoot.commit();
             }
         } catch (CommitFailedException e) {
             e.throwRepositoryException();

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java?rev=1390525&r1=1390524&r2=1390525&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java (original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Wed Sep 26 14:40:14 2012
@@ -35,7 +35,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.name.NamespaceValidatorProvider;
 import org.apache.jackrabbit.oak.plugins.type.DefaultTypeEditor;
 import org.apache.jackrabbit.oak.plugins.type.TypeValidatorProvider;
-import org.apache.jackrabbit.oak.plugins.value.ConflictValidatorProvider;
+import org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider;
 import org.apache.jackrabbit.oak.security.authorization.AccessControlValidatorProvider;
 import org.apache.jackrabbit.oak.security.authorization.PermissionValidatorProvider;
 import org.apache.jackrabbit.oak.security.privilege.PrivilegeValidatorProvider;



Mime
View raw message