jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r918560 - in /jackrabbit/trunk: jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/ jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/
Date Wed, 03 Mar 2010 16:41:44 GMT
Author: angela
Date: Wed Mar  3 16:41:44 2010
New Revision: 918560

URL: http://svn.apache.org/viewvc?rev=918560&view=rev
Log:
JCR-2532: spi2davex: session-scoped lock tokens not included in if-header
+ minor improvement

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java?rev=918560&r1=918559&r2=918560&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
Wed Mar  3 16:41:44 2010
@@ -431,6 +431,22 @@
     }
 
     /**
+     * @return The DAV event type representation for all known JCR event types.
+     */
+    public static EventType[] getAllEventTypes() {
+        EventType[] types = new EventType[] {
+                getEventType(javax.jcr.observation.Event.NODE_ADDED),
+                getEventType(javax.jcr.observation.Event.NODE_REMOVED),
+                getEventType(javax.jcr.observation.Event.PROPERTY_ADDED),
+                getEventType(javax.jcr.observation.Event.PROPERTY_CHANGED),
+                getEventType(javax.jcr.observation.Event.PROPERTY_REMOVED),
+                getEventType(javax.jcr.observation.Event.NODE_MOVED),
+                getEventType(javax.jcr.observation.Event.PERSIST)
+        };
+        return types;
+    }
+
+    /**
      * Static utility method to convert an <code>EventType</code> as present
in
      * the Xml body into the corresponding JCR event constant defined by
      * {@link javax.jcr.observation.Event}.

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=918560&r1=918559&r2=918560&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Wed Mar  3 16:41:44 2010
@@ -60,6 +60,7 @@
 import org.apache.commons.httpclient.HostConfiguration;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpConnectionManager;
+import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.URI;
 import org.apache.commons.httpclient.URIException;
@@ -206,17 +207,7 @@
 
     private static Logger log = LoggerFactory.getLogger(RepositoryServiceImpl.class);
 
-    private static final EventType[] ALL_EVENTS = new EventType[7];
-    static {
-        ALL_EVENTS[0] = SubscriptionImpl.getEventType(javax.jcr.observation.Event.NODE_ADDED);
-        ALL_EVENTS[1] = SubscriptionImpl.getEventType(javax.jcr.observation.Event.NODE_REMOVED);
-        ALL_EVENTS[2] = SubscriptionImpl.getEventType(javax.jcr.observation.Event.PROPERTY_ADDED);
-        ALL_EVENTS[3] = SubscriptionImpl.getEventType(javax.jcr.observation.Event.PROPERTY_CHANGED);
-        ALL_EVENTS[4] = SubscriptionImpl.getEventType(javax.jcr.observation.Event.PROPERTY_REMOVED);
-        ALL_EVENTS[5] = SubscriptionImpl.getEventType(javax.jcr.observation.Event.NODE_MOVED);
-        ALL_EVENTS[6] = SubscriptionImpl.getEventType(javax.jcr.observation.Event.PERSIST);
-    }
-    private static final SubscriptionInfo S_INFO = new SubscriptionInfo(ALL_EVENTS, true,
INFINITE_TIMEOUT);
+    private static final SubscriptionInfo S_INFO = new SubscriptionInfo(SubscriptionImpl.getAllEventTypes(),
true, INFINITE_TIMEOUT);
 
     private final IdFactory idFactory;
     private final NameFactory nameFactory;
@@ -303,7 +294,7 @@
         return DavMethods.DAV_UNLOCK == code;
     }
 
-    private static void initMethod(DavMethod method, SessionInfo sessionInfo, boolean addIfHeader)
throws RepositoryException {
+    protected static void initMethod(HttpMethod method, SessionInfo sessionInfo, boolean
addIfHeader) throws RepositoryException {
         if (addIfHeader) {
             checkSessionInfo(sessionInfo);
             String[] locktokens = ((SessionInfoImpl) sessionInfo).getAllLockTokens();

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java?rev=918560&r1=918559&r2=918560&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
Wed Mar  3 16:41:44 2010
@@ -399,11 +399,7 @@
 
     private static void addIfHeader(SessionInfo sInfo, HttpMethod method) {
         try {
-            String[] locktokens = sInfo.getLockTokens();
-            if (locktokens != null && locktokens.length > 0) {
-                IfHeader ifH = new IfHeader(locktokens);
-                method.setRequestHeader(ifH.getHeaderName(), ifH.getHeaderValue());
-            }
+            initMethod(method, sInfo, true);
         } catch (RepositoryException e) {
             // should never get here
             log.error("Unable to retrieve lock tokens: omitted from request header.");



Mime
View raw message