jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r468384 - /jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
Date Fri, 27 Oct 2006 13:52:27 GMT
Author: angela
Date: Fri Oct 27 06:52:26 2006
New Revision: 468384

URL: http://svn.apache.org/viewvc?view=rev&rev=468384
Log:
- add distiction between session and open scoped locks
- existing lock must be listed as session-ref in order to avoid logout
- improve log output.

Modified:
    jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java

Modified: jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java?view=diff&rev=468384&r1=468383&r2=468384
==============================================================================
--- jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
(original)
+++ jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
Fri Oct 27 06:52:26 2006
@@ -32,6 +32,7 @@
 import org.apache.jackrabbit.webdav.io.InputContext;
 import org.apache.jackrabbit.webdav.io.OutputContext;
 import org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock;
+import org.apache.jackrabbit.webdav.jcr.lock.SessionScopedLockEntry;
 import org.apache.jackrabbit.webdav.jcr.nodetype.NodeTypeProperty;
 import org.apache.jackrabbit.webdav.jcr.version.report.ExportViewReport;
 import org.apache.jackrabbit.webdav.jcr.version.report.LocateCorrespondingNodeReport;
@@ -537,7 +538,6 @@
                         log.warn("Unable to retrieve lock: no item found at '" + getResourcePath()
+ "'");
                     } else if (((Node) item).isLocked()) {
                         Lock jcrLock = ((Node) item).getLock();
-                        // TODO: find out whether this lock is session-scoped or not!
                         lock = new JcrActiveLock(jcrLock);
                     }
                 } catch (AccessDeniedException e) {
@@ -580,6 +580,8 @@
             try {
                 boolean sessionScoped = EXCLUSIVE_SESSION.equals(reqLockInfo.getScope());
                 Lock jcrLock = ((Node)item).lock(reqLockInfo.isDeep(), sessionScoped);
+                // add reference to DAVSession for this lock
+                getSession().addReference(jcrLock.getLockToken());
                 return new JcrActiveLock(jcrLock, sessionScoped);
 
             } catch (RepositoryException e) {
@@ -713,7 +715,7 @@
         }
         // only custom ordering is allowed
         if (!OrderingConstants.ORDERING_TYPE_CUSTOM.equalsIgnoreCase(orderPatch.getOrderingType()))
{
-            throw new DavException(DavServletResponse.SC_UNPROCESSABLE_ENTITY,"Only DAV:custom
ordering type supported.");
+            throw new DavException(DavServletResponse.SC_UNPROCESSABLE_ENTITY, "Only DAV:custom
ordering type supported.");
         }
 
         OrderPatch.Member[] instructions = orderPatch.getOrderInstructions();
@@ -793,8 +795,7 @@
         try {
             if (exists() && ((Node)item).isNodeType(JcrConstants.MIX_LOCKABLE)) {
                 supportedLock.addEntry(Type.WRITE, Scope.EXCLUSIVE);
-                // TODO: do session-scoped lock properly (including session caching and proper
scope discovery)
-                //supportedLock.addEntry(new SessionScopedLockEntry());
+                supportedLock.addEntry(new SessionScopedLockEntry());
             }
         } catch (RepositoryException e) {
             log.warn(e.getMessage());
@@ -855,7 +856,7 @@
                 Item primaryItem = n.getPrimaryItem();
                 addHrefProperty(JCR_PRIMARYITEM, new Item[] {primaryItem}, true);
             } catch (ItemNotFoundException e) {
-                log.info("No primary item present on this node '" + getResourcePath() + "'");
+                log.debug("No primary item present on this node '" + getResourcePath() +
"'");
             } catch (RepositoryException e) {
                 log.error("Error while retrieving primary item: " + e.getMessage());
             }



Mime
View raw message