jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1328941 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: RepositoryImpl.java SessionContext.java SessionImpl.java WorkspaceImpl.java query/QueryManagerImpl.java
Date Sun, 22 Apr 2012 19:20:32 GMT
Author: mduerig
Date: Sun Apr 22 19:20:31 2012
New Revision: 1328941

URL: http://svn.apache.org/viewvc?rev=1328941&view=rev
Log:
OAK-18: Define Oak API 
Rename variables, members and fields from connection to contentSession to match renamed class

Modified:
    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
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java

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=1328941&r1=1328940&r2=1328941&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
Sun Apr 22 19:20:31 2012
@@ -122,8 +122,8 @@ public class RepositoryImpl implements R
 
         ContentRepository contentRepository = context.getInstance(ContentRepository.class);
         try {
-            ContentSession connection = contentRepository.login(credentials, workspaceName);
-            return new SessionImpl(context, connection);
+            ContentSession contentSession = contentRepository.login(credentials, workspaceName);
+            return new SessionImpl(context, contentSession);
         } 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=1328941&r1=1328940&r2=1328941&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
Sun Apr 22 19:20:31 2012
@@ -34,7 +34,7 @@ public interface SessionContext<T extend
     T getSession();
     GlobalContext getGlobalContext();
     String getWorkspaceName();
-    ContentSession getConnection();
+    ContentSession getContentSession();
     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=1328941&r1=1328940&r2=1328941&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
Sun Apr 22 19:20:31 2012
@@ -54,7 +54,7 @@ public class SessionImpl extends Abstrac
     private static final Logger log = LoggerFactory.getLogger(SessionImpl.class);
 
     private final GlobalContext globalContext;
-    private final ContentSession connection;
+    private final ContentSession contentSession;
     private final ValueFactory valueFactory;
     private final Workspace workspace;
     private final SessionContext<SessionImpl> sessionContext = new Context();
@@ -62,13 +62,13 @@ public class SessionImpl extends Abstrac
 
     private Branch branch;
 
-    SessionImpl(GlobalContext globalContext, ContentSession connection) {
+    SessionImpl(GlobalContext globalContext, ContentSession contentSession) {
         this.globalContext = globalContext;
-        this.connection = connection;
+        this.contentSession = contentSession;
         this.valueFactory = new ValueFactoryImpl();
         workspace = new WorkspaceImpl(sessionContext);
 
-        this.branch = connection.branchRoot();
+        this.branch = contentSession.branchRoot();
     }
 
 
@@ -81,17 +81,17 @@ public class SessionImpl extends Abstrac
 
     @Override
     public String getUserID() {
-        return connection.getAuthInfo().getUserID();
+        return contentSession.getAuthInfo().getUserID();
     }
 
     @Override
     public String[] getAttributeNames() {
-        return connection.getAuthInfo().getAttributeNames();
+        return contentSession.getAuthInfo().getAttributeNames();
     }
 
     @Override
     public Object getAttribute(String name) {
-        return connection.getAuthInfo().getAttribute(name);
+        return contentSession.getAuthInfo().getAttribute(name);
     }
 
     @Override
@@ -157,9 +157,9 @@ public class SessionImpl extends Abstrac
     public void save() throws RepositoryException {
         ensureIsAlive();
         try {
-            connection.commit(branch);
-            connection.refresh();
-            branch = connection.branchRoot();
+            contentSession.commit(branch);
+            contentSession.refresh();
+            branch = contentSession.branchRoot();
         } catch (CommitFailedException e) {
             throw new RepositoryException(e);
         }
@@ -168,9 +168,9 @@ public class SessionImpl extends Abstrac
     @Override
     public void refresh(boolean keepChanges) throws RepositoryException {
         ensureIsAlive();
-        connection.refresh();
+        contentSession.refresh();
         if (!keepChanges) {
-            branch = connection.branchRoot();
+            branch = contentSession.branchRoot();
         }
     }
 
@@ -201,7 +201,7 @@ public class SessionImpl extends Abstrac
         // TODO
 
         try {
-            connection.close();
+            contentSession.close();
         } catch (IOException e) {
             log.warn("Error while closing connection", e);
         }
@@ -429,12 +429,12 @@ public class SessionImpl extends Abstrac
 
         @Override
         public String getWorkspaceName() {
-            return connection.getWorkspaceName();
+            return contentSession.getWorkspaceName();
         }
 
         @Override
-        public ContentSession getConnection() {
-            return connection;
+        public ContentSession getContentSession() {
+            return contentSession;
         }
 
         @Override

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=1328941&r1=1328940&r2=1328941&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
Sun Apr 22 19:20:31 2012
@@ -85,14 +85,14 @@ public class WorkspaceImpl implements Wo
         }
 
         try {
-            ContentSession connection = sessionContext.getConnection();
-            Branch branch = connection.branchRoot();
+            ContentSession contentSession = sessionContext.getContentSession();
+            Branch branch = contentSession.branchRoot();
 
             String srcPath = Paths.relativize("/", srcAbsPath);
             String destPath = Paths.relativize("/", destAbsPath);
             branch.copy(srcPath, destPath);
 
-            connection.commit(branch);
+            contentSession.commit(branch);
         }
         catch (CommitFailedException e) {
             throw new RepositoryException(e);
@@ -116,14 +116,14 @@ public class WorkspaceImpl implements Wo
         ensureIsAlive();
 
         try {
-            ContentSession connection = sessionContext.getConnection();
-            Branch branch = connection.branchRoot();
+            ContentSession contentSession = sessionContext.getContentSession();
+            Branch branch = contentSession.branchRoot();
 
             String srcPath = Paths.relativize("/", srcAbsPath);
             String destPath = Paths.relativize("/", destAbsPath);
             branch.move(srcPath, destPath);
 
-            connection.commit(branch);
+            contentSession.commit(branch);
         }
         catch (CommitFailedException e) {
             throw new RepositoryException(e);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java?rev=1328941&r1=1328940&r2=1328941&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
Sun Apr 22 19:20:31 2012
@@ -48,7 +48,7 @@ public class QueryManagerImpl implements
     private final QueryEngine queryEngine;
 
     public QueryManagerImpl(WorkspaceImpl workspace, SessionContext<SessionImpl> sessionContext)
{
-        queryEngine = sessionContext.getConnection().getQueryEngine();
+        queryEngine = sessionContext.getContentSession().getQueryEngine();
     }
 
     @Override



Mime
View raw message