jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1572487 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/WorkspaceImpl.java
Date Thu, 27 Feb 2014 09:58:49 GMT
Author: angela
Date: Thu Feb 27 09:58:48 2014
New Revision: 1572487

URL: http://svn.apache.org/r1572487
Log:
minor improvement (resolving TODOs)

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/WorkspaceImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/WorkspaceImpl.java?rev=1572487&r1=1572486&r2=1572487&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/WorkspaceImpl.java
Thu Feb 27 09:58:48 2014
@@ -162,30 +162,47 @@ public class WorkspaceImpl implements Ja
         final String srcOakPath = getOakPathOrThrowNotFound(srcAbsPath);
         final String destOakPath = getOakPathOrThrowNotFound(destAbsPath);
 
-        // TODO: use perform()
-        ensureIsAlive();
+        sessionDelegate.perform(new SessionOperation<Object>(true) {
 
-        sessionDelegate.checkProtectedNode(getParentPath(srcOakPath));
-        sessionDelegate.checkProtectedNode(getParentPath(destOakPath));
+            @Override
+            public void checkPreconditions() throws RepositoryException {
+                super.checkPreconditions();
+                ensureIsAlive();
+            }
 
-        // TODO
-        throw new UnsupportedRepositoryOperationException("Not implemented.");
+            @Override
+            public Object perform() throws RepositoryException {
+                sessionDelegate.checkProtectedNode(getParentPath(srcOakPath));
+                sessionDelegate.checkProtectedNode(getParentPath(destOakPath));
+                throw new UnsupportedRepositoryOperationException("Not implemented.");
+            }
+        });
     }
 
     @Override
-    public void move(String srcAbsPath, String destAbsPath) throws RepositoryException {
+    public void move(String srcAbsPath, final String destAbsPath) throws RepositoryException
{
         final String srcOakPath = getOakPathOrThrowNotFound(srcAbsPath);
         final String destOakPath = getOakPathOrThrowNotFound(destAbsPath);
 
-        // TODO: use perform()
-        ensureIsAlive();
+        sessionDelegate.perform(new SessionOperation<Object>(true) {
+            @Override
+            public void checkPreconditions() throws RepositoryException {
+                super.checkPreconditions();
+                ensureIsAlive();
+            }
 
-        sessionDelegate.checkProtectedNode(getParentPath(srcOakPath));
-        sessionDelegate.checkProtectedNode(getParentPath(destOakPath));
+            @Override
+            public Object perform() throws RepositoryException {
+                sessionDelegate.checkProtectedNode(getParentPath(srcOakPath));
+                sessionDelegate.checkProtectedNode(getParentPath(destOakPath));
+
+                SessionImpl.checkIndexOnName(sessionContext, destAbsPath);
 
-        SessionImpl.checkIndexOnName(sessionContext, destAbsPath);
+                sessionDelegate.move(srcOakPath, destOakPath, false);
+                return null;
+            }
+        });
 
-        sessionDelegate.move(srcOakPath, destOakPath, false);
     }
 
     @Override
@@ -239,8 +256,7 @@ public class WorkspaceImpl implements Ja
     @Override
     public String[] getAccessibleWorkspaceNames() throws RepositoryException {
         ensureIsAlive();
-
-        // TODO -> SPI
+        // FIXME: adjust implementation once OAK-118 is being addressed.
         return new String[]{getName()};
     }
 
@@ -283,25 +299,19 @@ public class WorkspaceImpl implements Ja
     @Override
     public void createWorkspace(String name) throws RepositoryException {
         ensureIsAlive();
-
-        // TODO -> SPI
-        throw new UnsupportedRepositoryOperationException("TODO: Workspace.createWorkspace");
+        throw new UnsupportedRepositoryOperationException("OAK-118: Workspace.createWorkspace");
     }
 
     @Override
     public void createWorkspace(String name, String srcWorkspace) throws RepositoryException
{
         ensureIsAlive();
-
-        // TODO -> SPI
-        throw new UnsupportedRepositoryOperationException("TODO: Workspace.createWorkspace");
+        throw new UnsupportedRepositoryOperationException("OAK-118: Workspace.createWorkspace");
     }
 
     @Override
     public void deleteWorkspace(String name) throws RepositoryException {
         ensureIsAlive();
-
-        // TODO -> SPI
-        throw new UnsupportedRepositoryOperationException("TODO: Workspace.deleteWorkspace");
+        throw new UnsupportedRepositoryOperationException("OAK-118: Workspace.deleteWorkspace");
     }
 
     //------------------------------------------------< JackrabbitWorkspace >---
@@ -309,9 +319,7 @@ public class WorkspaceImpl implements Ja
     @Override
     public void createWorkspace(String workspaceName, InputSource workspaceTemplate) throws
RepositoryException {
         ensureIsAlive();
-
-        // TODO -> SPI
-        throw new UnsupportedRepositoryOperationException("TODO: Workspace.createWorkspace");
+        throw new UnsupportedRepositoryOperationException("OAK-118: Workspace.createWorkspace");
     }
 
     /**



Mime
View raw message