jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1306786 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
Date Thu, 29 Mar 2012 11:25:25 GMT
Author: mduerig
Date: Thu Mar 29 11:25:25 2012
New Revision: 1306786

URL: http://svn.apache.org/viewvc?rev=1306786&view=rev
Log:
OAK-18: Define Oak API
add method to acquire a repository connection

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java

Modified: 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/Connection.java?rev=1306786&r1=1306785&r2=1306786&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/Connection.java
Thu Mar 29 11:25:25 2012
@@ -41,7 +41,12 @@ import java.io.Closeable;
  *   hold the state of the persistent layer at a given revision without any
  *   session-related state modifications.
  *
- * TODO: define whether this is a repository-level connection or just bound to a single workspace.
+ * - 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
+ *   passed to the login method. Connections acquired by
+ *   {@link Connection#getRepositoryConnection()} are bound to the whole repository.
+ *
  * TODO: describe how this interface is intended to handle validation: nt, names, ac, constraints...
  */
 public interface Connection extends Closeable {
@@ -57,7 +62,7 @@ public interface Connection extends Clos
     AuthInfo getAuthInfo();
 
     /**
-     * The immutable name of the workspace this {@code SessionInfo} instance has
+     * The immutable name of the workspace this {@code Connection} instance has
      * been created for. If no workspace name has been specified during
      * repository login this method will return the name of the default
      * workspace.
@@ -66,6 +71,15 @@ public interface Connection extends Clos
      */
     String getWorkspaceName();
 
+    /**
+     * Provide access to the whole repository (i.e. all workspaces) respecting
+     * the access rights of the current connection. This method returns the
+     * same connection instance on every invocation.
+     *
+     * @return a {@code Connection} which covers the whole repository.
+     */
+    Connection getRepositoryConnection();
+
     NodeState getCurrentRoot();
 
     NodeState commit(NodeState newRoot) throws CommitFailedException;



Mime
View raw message