jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1330001 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/
Date Tue, 24 Apr 2012 20:42:27 GMT
Author: mduerig
Date: Tue Apr 24 20:42:27 2012
New Revision: 1330001

URL: http://svn.apache.org/viewvc?rev=1330001&view=rev
Log:
- implement Session.hasPendingChanges
- More specific error messages

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java?rev=1330001&r1=1330000&r2=1330001&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java Tue
Apr 24 20:42:27 2012
@@ -74,4 +74,9 @@ public interface Root {
      */
     void commit() throws CommitFailedException;
 
+    /**
+     * Determine whether there are changes on this tree
+     * @return  {@code true} iff this tree was modified
+     */
+    boolean hasPendingChanges();
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java?rev=1330001&r1=1330000&r2=1330001&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java
Tue Apr 24 20:42:27 2012
@@ -114,6 +114,9 @@ public class KernelRoot implements Root 
         }
     }
 
+    public boolean hasPendingChanges() {
+        return !changeLog.isEmpty();
+    }
 
     //------------------------------------------------------------< internal >---
 
@@ -228,6 +231,10 @@ public class KernelRoot implements Root 
                     .append(copied.getPath()).append('"');
         }
 
+        public boolean isEmpty() {
+            return jsop.length() == 0;
+        }
+
         public String toJsop() {
             return jsop.toString();
         }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1330001&r1=1330000&r2=1330001&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Tue Apr 24 20:42:27 2012
@@ -520,7 +520,7 @@ public class NodeImpl extends ItemImpl i
     @Override
     public PropertyIterator getReferences(String name) throws RepositoryException {
         checkStatus();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Node.getReferences");
     }
 
     /**
@@ -534,7 +534,7 @@ public class NodeImpl extends ItemImpl i
     @Override
     public PropertyIterator getWeakReferences(String name) throws RepositoryException {
         checkStatus();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Node.getWeakReferences");
     }
 
     @Override
@@ -650,14 +650,14 @@ public class NodeImpl extends ItemImpl i
     @Override
     public NodeDefinition getDefinition() throws RepositoryException {
         checkStatus();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Node.getDefinition");
     }
 
 
     @Override
     public String getCorrespondingNodePath(String workspaceName) throws RepositoryException
{
         checkStatus();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Node.getCorrespondingNodePath");
     }
 
 
@@ -814,7 +814,7 @@ public class NodeImpl extends ItemImpl i
 
     @Override
     public NodeIterator getSharedSet() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Node.getSharedSet");
     }
 
     @Override

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=1330001&r1=1330000&r2=1330001&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
Tue Apr 24 20:42:27 2012
@@ -24,6 +24,7 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.kernel.KernelRoot;
 import org.apache.jackrabbit.oak.namepath.Paths;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -107,7 +108,7 @@ public class SessionImpl extends Abstrac
     @Override
     public Session impersonate(Credentials credentials) throws RepositoryException {
         ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Session.impersonate");
     }
 
     @Override
@@ -127,13 +128,13 @@ public class SessionImpl extends Abstrac
     @Override
     public Node getNodeByUUID(String uuid) throws RepositoryException {
         ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Session.getNodeByUUID");
     }
 
     @Override
     public Node getNodeByIdentifier(String id) throws RepositoryException {
         ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Session.getNodeByIdentifier");
     }
 
     //------------------------------------------------------------< Writing >---
@@ -173,8 +174,7 @@ public class SessionImpl extends Abstrac
     public boolean hasPendingChanges() throws RepositoryException {
         ensureIsAlive();
 
-        // todo implement hasPendingChanges
-        return false;
+        return root.hasPendingChanges();
     }
 
     //----------------------------------------------------------< Lifecycle >---
@@ -207,7 +207,7 @@ public class SessionImpl extends Abstrac
     @Override
     public ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior)
throws RepositoryException {
         ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Session.getImportContentHandler");
     }
 
     //------------------------------------------------------------< Locking >---
@@ -279,7 +279,7 @@ public class SessionImpl extends Abstrac
     @Override
     public AccessControlManager getAccessControlManager() throws RepositoryException {
         ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Session.getAccessControlManager");
     }
 
     //----------------------------------------------------------< Retention >---

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=1330001&r1=1330000&r2=1330001&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
Tue Apr 24 20:42:27 2012
@@ -142,7 +142,7 @@ public class WorkspaceImpl implements Ja
     public LockManager getLockManager() throws RepositoryException {
         ensureIsAlive();
         ensureSupportedOption(Repository.OPTION_LOCKING_SUPPORTED);
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Workspace.getLockManager");
     }
 
     @Override
@@ -167,21 +167,21 @@ public class WorkspaceImpl implements Ja
     @Override
     public NodeTypeManager getNodeTypeManager() throws RepositoryException {
         ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Workspace.getNodeTypeManager");
     }
 
     @Override
     public ObservationManager getObservationManager() throws RepositoryException {
         ensureSupportedOption(Repository.OPTION_OBSERVATION_SUPPORTED);
         ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Workspace.getObservationManager");
     }
 
     @Override
     public VersionManager getVersionManager() throws RepositoryException {
         ensureIsAlive();
         ensureSupportedOption(Repository.OPTION_VERSIONING_SUPPORTED);
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Workspace.getVersionManager");
     }
 
     @Override
@@ -197,7 +197,7 @@ public class WorkspaceImpl implements Ja
     public ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior)
throws RepositoryException {
         ensureSupportedOption(Repository.LEVEL_2_SUPPORTED);
         ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO");
+        throw new UnsupportedRepositoryOperationException("TODO: Workspace.getImportContentHandler");
     }
 
     @SuppressWarnings("deprecation")



Mime
View raw message