jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1328611 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core: ConnectionImpl.java KernelContentRepository.java KernelContentSession.java
Date Sat, 21 Apr 2012 08:28:18 GMT
Author: jukka
Date: Sat Apr 21 08:28:17 2012
New Revision: 1328611

URL: http://svn.apache.org/viewvc?rev=1328611&view=rev
Log:
OAK-18: Define Oak API

Rename ConnectionImpl to KernelContentSession to match the new interface name

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentSession.java
      - copied, changed from r1328607, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java?rev=1328611&r1=1328610&r2=1328611&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java
Sat Apr 21 08:28:17 2012
@@ -89,8 +89,14 @@ public class KernelContentRepository imp
         }
 
         QueryEngine queryEngine = new QueryEngineImpl(microKernel);
-        return ConnectionImpl.createWorkspaceConnection(sc, wspName, nodeStore, revision,
-                queryEngine);
+        // TODO set revision!?
+        NodeState wspRoot = nodeStore.getRoot().getChildNode(workspaceName);
+        if (wspRoot == null) {
+            throw new NoSuchWorkspaceException(workspaceName);
+        }
+
+        return new KernelContentSession(
+                sc, workspaceName, nodeStore, wspRoot, queryEngine);
     }
 
     /**

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentSession.java
(from r1328607, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentSession.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentSession.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java&r1=1328607&r2=1328611&rev=1328611&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentSession.java
Sat Apr 21 08:28:17 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.oak.core;
 
+import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.api.MicroKernelException;
 import org.apache.jackrabbit.oak.api.AuthInfo;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
@@ -27,19 +28,18 @@ import org.apache.jackrabbit.oak.api.Que
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jcr.NoSuchWorkspaceException;
 import javax.jcr.SimpleCredentials;
 import java.io.IOException;
 
 /**
- * ConnectionImpl...
+ * {@link MicroKernel}-based implementation of
+ * the {@link ContentSession} interface.
  */
-public class ConnectionImpl implements ContentSession {
+class KernelContentSession implements ContentSession {
 
-    /**
-     * logger instance
-     */
-    private static final Logger log = LoggerFactory.getLogger(ConnectionImpl.class);
+    /** Logger instance */
+    private static final Logger log =
+            LoggerFactory.getLogger(KernelContentSession.class);
 
     private final SimpleCredentials credentials;
     private final String workspaceName;
@@ -48,7 +48,8 @@ public class ConnectionImpl implements C
 
     private NodeState root;
 
-    private ConnectionImpl(SimpleCredentials credentials, String workspaceName,
+    public KernelContentSession(
+            SimpleCredentials credentials, String workspaceName,
             NodeStore store, NodeState root, QueryEngine queryEngine) {
         this.credentials = credentials;
         this.workspaceName = workspaceName;
@@ -57,19 +58,6 @@ public class ConnectionImpl implements C
         this.root = root;
     }
 
-    static ContentSession createWorkspaceConnection(SimpleCredentials credentials,
-            String workspace, NodeStore store, String revision, QueryEngine queryEngine)
-            throws NoSuchWorkspaceException {
-
-        // TODO set revision!?
-        NodeState wspRoot = store.getRoot().getChildNode(workspace);
-        if (wspRoot == null) {
-            throw new NoSuchWorkspaceException(workspace);
-        }
-
-        return new ConnectionImpl(credentials, workspace, store, wspRoot, queryEngine);
-    }
-
     @Override
     public AuthInfo getAuthInfo() {
         // todo implement getAuthInfo



Mime
View raw message