jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1328597 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/
Date Sat, 21 Apr 2012 07:16:28 GMT
Author: jukka
Date: Sat Apr 21 07:16:27 2012
New Revision: 1328597

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

Rename the RepositoryService and Connection interfaces to ContentRepository and ContentSession.

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentRepository.java
      - copied, changed from r1328596, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/RepositoryService.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
      - copied, changed from r1328596, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/RepositoryService.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/GlobalContext.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/SessionContext.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentRepository.java
(from r1328596, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/RepositoryService.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentRepository.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentRepository.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/RepositoryService.java&r1=1328596&r2=1328597&rev=1328597&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/RepositoryService.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentRepository.java
Sat Apr 21 07:16:27 2012
@@ -24,16 +24,16 @@ import javax.security.auth.login.LoginEx
  * serves the following purposes:
  *
  * <ul>
- * <li> validating a given login request and providing a {@link Connection}
+ * <li> validating a given login request and providing a {@link ContentSession}
  *   that is used for further communication with the persistent layer (i.e.
  *   Microkernel).</li>
  * </ul>
  */
-public interface RepositoryService {
+public interface ContentRepository {
 
     /**
      * Try to login a user identified by the passed {@code credentials}. On success
-     * this method returns a {@link Connection} to the given {@code workspace}.
+     * this method returns a {@link ContentSession} to the given {@code workspace}.
      *
      * @param credentials
      * @param workspaceName
@@ -41,6 +41,6 @@ public interface RepositoryService {
      * @throws LoginException
      * @throws NoSuchWorkspaceException
      */
-    Connection login(Object credentials, String workspaceName)
+    ContentSession login(Object credentials, String workspaceName)
             throws LoginException, NoSuchWorkspaceException;
 }
\ No newline at end of file

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
(from r1328596, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java&r1=1328596&r2=1328597&rev=1328597&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
Sat Apr 21 07:16:27 2012
@@ -40,14 +40,14 @@ import java.io.Closeable;
  *
  * - Whether this connection is bound to a workspace or to the whole repository
  *   is determined by how the connection was acquired: connections acquired by
- *   {@link RepositoryService#login(Object, String)} are bound to the workspace
+ *   {@link ContentRepository#login(Object, String)} are bound to the workspace
  *   passed to the login method. Connections acquired by
- *   {@link Connection#getRepositoryConnection()} are bound to the whole repository.
+ *   {@link ContentSession#getRepositoryConnection()} are bound to the whole repository.
  *   TODO: check if that is really necessary, desirable and feasible.
  *
  * TODO: describe how this interface is intended to handle validation: nt, names, ac, constraints...
  */
-public interface Connection extends Closeable {
+public interface ContentSession extends Closeable {
 
     /**
      * This methods provides access to information related to authentication
@@ -77,7 +77,7 @@ public interface Connection extends Clos
      *
      * @return a {@code Connection} which covers the whole repository.
      */
-    Connection getRepositoryConnection();
+    ContentSession getRepositoryConnection();
 
     /**
      * Refresh this connection to the latest revision of the underlying Microkernel.

Modified: 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/ConnectionImpl.java?rev=1328597&r1=1328596&r2=1328597&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/ConnectionImpl.java
Sat Apr 21 07:16:27 2012
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.core;
 import org.apache.jackrabbit.mk.api.MicroKernelException;
 import org.apache.jackrabbit.oak.api.AuthInfo;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.Connection;
+import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.kernel.NodeState;
 import org.apache.jackrabbit.oak.api.Branch;
 import org.apache.jackrabbit.oak.kernel.NodeStore;
@@ -34,7 +34,7 @@ import java.io.IOException;
 /**
  * ConnectionImpl...
  */
-public class ConnectionImpl implements Connection {
+public class ConnectionImpl implements ContentSession {
 
     /**
      * logger instance
@@ -57,7 +57,7 @@ public class ConnectionImpl implements C
         this.root = root;
     }
 
-    static Connection createWorkspaceConnection(SimpleCredentials credentials,
+    static ContentSession createWorkspaceConnection(SimpleCredentials credentials,
             String workspace, NodeStore store, String revision, QueryEngine queryEngine)
             throws NoSuchWorkspaceException {
 
@@ -123,7 +123,7 @@ public class ConnectionImpl implements C
     }
 
     @Override
-    public Connection getRepositoryConnection() {
+    public ContentSession getRepositoryConnection() {
         return new ConnectionImpl(credentials, null, store, store.getRoot(), queryEngine);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java?rev=1328597&r1=1328596&r2=1328597&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
Sat Apr 21 07:16:27 2012
@@ -18,11 +18,11 @@ package org.apache.jackrabbit.oak.core;
 
 import org.apache.jackrabbit.mk.MicroKernelFactory;
 import org.apache.jackrabbit.mk.api.MicroKernel;
-import org.apache.jackrabbit.oak.api.Connection;
+import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.kernel.NodeState;
 import org.apache.jackrabbit.oak.api.Branch;
 import org.apache.jackrabbit.oak.api.QueryEngine;
-import org.apache.jackrabbit.oak.api.RepositoryService;
+import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.query.QueryEngineImpl;
 import org.slf4j.Logger;
@@ -36,7 +36,7 @@ import javax.security.auth.login.LoginEx
 /**
  * TmpRepositoryService...
  */
-public class TmpRepositoryService implements RepositoryService {
+public class TmpRepositoryService implements ContentRepository {
 
     /**
      * logger instance
@@ -55,7 +55,7 @@ public class TmpRepositoryService implem
     }
 
     @Override
-    public Connection login(Object credentials, String workspaceName)
+    public ContentSession login(Object credentials, String workspaceName)
             throws LoginException, NoSuchWorkspaceException {
 
         // TODO: add proper implementation

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/GlobalContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/GlobalContext.java?rev=1328597&r1=1328596&r2=1328597&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/GlobalContext.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/GlobalContext.java
Sat Apr 21 07:16:27 2012
@@ -19,7 +19,7 @@
 
 package org.apache.jackrabbit.oak.jcr;
 
-import org.apache.jackrabbit.oak.api.RepositoryService;
+import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.core.TmpRepositoryService;
 import org.apache.jackrabbit.oak.jcr.configuration.OakRepositoryConfiguration;
 import org.apache.jackrabbit.oak.jcr.configuration.RepositoryConfiguration;
@@ -45,7 +45,7 @@ public class GlobalContext {
     
     public GlobalContext(RepositoryConfiguration repositoryConfiguration) throws RepositoryException
{
         put(RepositoryConfiguration.class, repositoryConfiguration);
-        put(RepositoryService.class, new TmpRepositoryService(repositoryConfiguration.getMicrokernelUrl()));
+        put(ContentRepository.class, new TmpRepositoryService(repositoryConfiguration.getMicrokernelUrl()));
         put(Repository.class, new RepositoryImpl(this));
     }
 

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=1328597&r1=1328596&r2=1328597&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
Sat Apr 21 07:16:27 2012
@@ -17,8 +17,8 @@
 package org.apache.jackrabbit.oak.jcr;
 
 import org.apache.jackrabbit.commons.SimpleValueFactory;
-import org.apache.jackrabbit.oak.api.Connection;
-import org.apache.jackrabbit.oak.api.RepositoryService;
+import org.apache.jackrabbit.oak.api.ContentSession;
+import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -119,9 +119,9 @@ public class RepositoryImpl implements R
     public Session login(Credentials credentials, String workspaceName) throws RepositoryException
{
         // TODO: needs complete refactoring
 
-        RepositoryService service = context.getInstance(RepositoryService.class);
+        ContentRepository service = context.getInstance(ContentRepository.class);
         try {
-            Connection connection = service.login(credentials, workspaceName);
+            ContentSession connection = service.login(credentials, workspaceName);
             return new SessionImpl(context, connection);
         } catch (LoginException e) {
             throw new javax.jcr.LoginException(e.getMessage());

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java?rev=1328597&r1=1328596&r2=1328597&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
Sat Apr 21 07:16:27 2012
@@ -19,7 +19,7 @@
 
 package org.apache.jackrabbit.oak.jcr;
 
-import org.apache.jackrabbit.oak.api.Connection;
+import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Branch;
 import org.apache.jackrabbit.oak.api.TransientNodeState;
 
@@ -34,7 +34,7 @@ public interface SessionContext<T extend
     T getSession();
     GlobalContext getGlobalContext();
     String getWorkspaceName();
-    Connection getConnection();
+    ContentSession getConnection();
     ValueFactory getValueFactory();
     LockManager getLockManager() throws RepositoryException;
     NodeTypeManager getNodeTypeManager() throws RepositoryException;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1328597&r1=1328596&r2=1328597&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Sat Apr 21 07:16:27 2012
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.jcr;
 import org.apache.jackrabbit.commons.AbstractSession;
 import org.apache.jackrabbit.oak.api.Branch;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.Connection;
+import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.TransientNodeState;
 import org.apache.jackrabbit.oak.namepath.Paths;
 import org.slf4j.Logger;
@@ -54,7 +54,7 @@ public class SessionImpl extends Abstrac
     private static final Logger log = LoggerFactory.getLogger(SessionImpl.class);
 
     private final GlobalContext globalContext;
-    private final Connection connection;
+    private final ContentSession connection;
     private final ValueFactory valueFactory;
     private final Workspace workspace;
     private final SessionContext<SessionImpl> sessionContext = new Context();
@@ -62,7 +62,7 @@ public class SessionImpl extends Abstrac
 
     private Branch branch;
 
-    SessionImpl(GlobalContext globalContext, Connection connection) {
+    SessionImpl(GlobalContext globalContext, ContentSession connection) {
         this.globalContext = globalContext;
         this.connection = connection;
         this.valueFactory = new ValueFactoryImpl();
@@ -433,7 +433,7 @@ public class SessionImpl extends Abstrac
         }
 
         @Override
-        public Connection getConnection() {
+        public ContentSession getConnection() {
             return connection;
         }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1328597&r1=1328596&r2=1328597&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Sat Apr 21 07:16:27 2012
@@ -18,7 +18,7 @@ package org.apache.jackrabbit.oak.jcr;
 
 import org.apache.jackrabbit.oak.api.Branch;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.Connection;
+import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.jcr.query.QueryManagerImpl;
 import org.apache.jackrabbit.oak.namepath.Paths;
 import org.slf4j.Logger;
@@ -85,7 +85,7 @@ public class WorkspaceImpl implements Wo
         }
 
         try {
-            Connection connection = sessionContext.getConnection();
+            ContentSession connection = sessionContext.getConnection();
             Branch branch = connection.branchRoot();
 
             String srcPath = Paths.relativize("/", srcAbsPath);
@@ -116,7 +116,7 @@ public class WorkspaceImpl implements Wo
         ensureIsAlive();
 
         try {
-            Connection connection = sessionContext.getConnection();
+            ContentSession connection = sessionContext.getConnection();
             Branch branch = connection.branchRoot();
 
             String srcPath = Paths.relativize("/", srcAbsPath);



Mime
View raw message