dflorey     2004/02/24 09:03:34

  Modified:    src/webdav/server/org/apache/slide/webdav/event
                        WebdavAdapter.java WebdavEvent.java
                        WebdavListener.java
               src/webdav/server/org/apache/slide/webdav/method
                        AbstractWebdavMethod.java AclMethod.java
                        BindMethod.java CheckinMethod.java
                        CheckoutMethod.java CopyMethod.java
                        DefaultMethodFactory.java DeleteMethod.java
                        GetMethod.java LabelMethod.java LockMethod.java
                        MkcolMethod.java MoveMethod.java OptionsMethod.java
                        PropFindMethod.java PropPatchMethod.java
                        PutMethod.java RebindMethod.java ReportMethod.java
                        SearchMethod.java UnbindMethod.java
                        UncheckoutMethod.java UnlockMethod.java
                        UpdateMethod.java VersionControlMethod.java
               src/webdav/server/org/apache/slide/webdav/util
                        PropertyHelper.java UriHandler.java
                        VersioningHelper.java WebdavUtils.java
  Log:
  Added notification support with methods SUBSCRIBE, POLL, NOTIFY
  To do: UNSUBSCRIBE
  
  Revision  Changes    Path
  1.2       +61 -12    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/event/WebdavAdapter.java
  
  Index: WebdavAdapter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/event/WebdavAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebdavAdapter.java        11 Feb 2004 12:58:30 -0000      1.1
  +++ WebdavAdapter.java        24 Feb 2004 17:03:33 -0000      1.2
  @@ -5,19 +5,59 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2004 The Apache Software Foundation 
  + * The Apache Software License, Version 1.1
    *
  - * Licensed under the Apache License, Version 2.0 (the "License");
  - * you may not use this file except in compliance with the License.
  - * You may obtain a copy of the License at
  - *
  - *     http://www.apache.org/licenses/LICENSE-2.0
  - *
  - * Unless required by applicable law or agreed to in writing, software
  - * distributed under the License is distributed on an "AS IS" BASIS,
  - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - * See the License for the specific language governing permissions and
  - * limitations under the License.
  + * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowlegement may appear in the software itself,
  + *    if and wherever such third-party acknowlegements normally appear.
  + *
  + * 4. The names "The Jakarta Project", "Slide", and "Apache Software
  + *    Foundation" must not be used to endorse or promote products derived
  + *    from this software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache"
  + *    nor may "Apache" appear in their names without prior written
  + *    permission of the Apache Group.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + *
  + * [Additional notices, if required by prior licensing conditions]
    *
    */
   
  @@ -102,5 +142,14 @@
       }
   
       public void mkworkspace(WebdavEvent event) throws VetoException {
  +    }
  +
  +    public void subscribe(WebdavEvent event) throws VetoException {
  +    }
  +
  +    public void unsubscribe(WebdavEvent event) throws VetoException {
  +    }
  +
  +    public void poll(WebdavEvent event) throws VetoException {
       }
   }
  
  
  
  1.2       +86 -13    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/event/WebdavEvent.java
  
  Index: WebdavEvent.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/event/WebdavEvent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebdavEvent.java  11 Feb 2004 12:58:30 -0000      1.1
  +++ WebdavEvent.java  24 Feb 2004 17:03:33 -0000      1.2
  @@ -5,19 +5,59 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2004 The Apache Software Foundation 
  + * The Apache Software License, Version 1.1
    *
  - * Licensed under the Apache License, Version 2.0 (the "License");
  - * you may not use this file except in compliance with the License.
  - * You may obtain a copy of the License at
  - *
  - *     http://www.apache.org/licenses/LICENSE-2.0
  - *
  - * Unless required by applicable law or agreed to in writing, software
  - * distributed under the License is distributed on an "AS IS" BASIS,
  - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - * See the License for the specific language governing permissions and
  - * limitations under the License.
  + * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowlegement may appear in the software itself,
  + *    if and wherever such third-party acknowlegements normally appear.
  + *
  + * 4. The names "The Jakarta Project", "Slide", and "Apache Software
  + *    Foundation" must not be used to endorse or promote products derived
  + *    from this software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache"
  + *    nor may "Apache" appear in their names without prior written
  + *    permission of the Apache Group.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + *
  + * [Additional notices, if required by prior licensing conditions]
    *
    */
   
  @@ -61,12 +101,15 @@
       public static Update UPDATE = new Update();
       public static Label LABEL = new Label();
       public static Mkworkspace MKWORKSPACE = new Mkworkspace();
  +    public static Subscribe SUBSCRIBE = new Subscribe();
  +    public static Unsubscribe UNSUBSCRIBE = new Unsubscribe();
  +    public static Poll POLL = new Poll();
   
       public final static String GROUP = "webdav";
       public final static AbstractEventMethod[] methods = new AbstractEventMethod[] { 
GET, PUT, PROPFIND, PROPPATCH, BIND,
                                                                                       
UNBIND, REBIND, MKCOL, COPY, MOVE, DELETE, LOCK, UNLOCK, ACL,
                                                                                       
REPORT, SEARCH, VERSION_CONTROL, OPTIONS, CHECKIN, CHECKOUT, UNCHECKOUT,
  -                                                                                    
UPDATE, LABEL, MKWORKSPACE };
  +                                                                                    
UPDATE, LABEL, MKWORKSPACE, SUBSCRIBE, UNSUBSCRIBE, POLL };
   
       public WebdavEvent(Object source) {
           super(source);
  @@ -317,6 +360,36 @@
   
           public void fireVetaoableEvent(EventListener listener, EventObject event) 
throws VetoException  {
               if ( listener instanceof WebdavListener ) 
((WebdavListener)listener).label((WebdavEvent)event);
  +        }
  +    }
  +
  +    public final static class Subscribe extends VetoableEventMethod {
  +        public Subscribe() {
  +            super(GROUP, "subscribe");
  +        }
  +
  +        public void fireVetaoableEvent(EventListener listener, EventObject event) 
throws VetoException  {
  +            if ( listener instanceof WebdavListener ) 
((WebdavListener)listener).subscribe((WebdavEvent)event);
  +        }
  +    }
  +
  +    public final static class Unsubscribe extends VetoableEventMethod {
  +        public Unsubscribe() {
  +            super(GROUP, "unsubscribe");
  +        }
  +
  +        public void fireVetaoableEvent(EventListener listener, EventObject event) 
throws VetoException  {
  +            if ( listener instanceof WebdavListener ) 
((WebdavListener)listener).unsubscribe((WebdavEvent)event);
  +        }
  +    }
  +
  +    public final static class Poll extends VetoableEventMethod {
  +        public Poll() {
  +            super(GROUP, "poll");
  +        }
  +
  +        public void fireVetaoableEvent(EventListener listener, EventObject event) 
throws VetoException  {
  +            if ( listener instanceof WebdavListener ) 
((WebdavListener)listener).poll((WebdavEvent)event);
           }
       }
   }
  
  
  
  1.2       +58 -12    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/event/WebdavListener.java
  
  Index: WebdavListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/event/WebdavListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebdavListener.java       11 Feb 2004 12:58:30 -0000      1.1
  +++ WebdavListener.java       24 Feb 2004 17:03:33 -0000      1.2
  @@ -5,19 +5,59 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2004 The Apache Software Foundation 
  + * The Apache Software License, Version 1.1
    *
  - * Licensed under the Apache License, Version 2.0 (the "License");
  - * you may not use this file except in compliance with the License.
  - * You may obtain a copy of the License at
  - *
  - *     http://www.apache.org/licenses/LICENSE-2.0
  - *
  - * Unless required by applicable law or agreed to in writing, software
  - * distributed under the License is distributed on an "AS IS" BASIS,
  - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - * See the License for the specific language governing permissions and
  - * limitations under the License.
  + * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowlegement may appear in the software itself,
  + *    if and wherever such third-party acknowlegements normally appear.
  + *
  + * 4. The names "The Jakarta Project", "Slide", and "Apache Software
  + *    Foundation" must not be used to endorse or promote products derived
  + *    from this software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache"
  + *    nor may "Apache" appear in their names without prior written
  + *    permission of the Apache Group.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + *
  + * [Additional notices, if required by prior licensing conditions]
    *
    */
   
  @@ -79,4 +119,10 @@
       void label(WebdavEvent event) throws VetoException;
   
       void mkworkspace(WebdavEvent event) throws VetoException;
  +
  +    void subscribe(WebdavEvent event) throws VetoException;
  +
  +    void unsubscribe(WebdavEvent event) throws VetoException;
  +
  +    void poll(WebdavEvent event) throws VetoException;
   }
  
  
  
  1.22      +156 -24   
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
  
  Index: AbstractWebdavMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- AbstractWebdavMethod.java 11 Feb 2004 11:30:28 -0000      1.21
  +++ AbstractWebdavMethod.java 24 Feb 2004 17:03:33 -0000      1.22
  @@ -27,11 +27,7 @@
   import java.io.StringWriter;
   import java.security.MessageDigest;
   import java.security.NoSuchAlgorithmException;
  -import java.util.ArrayList;
  -import java.util.Collections;
  -import java.util.Enumeration;
  -import java.util.Iterator;
  -import java.util.List;
  +import java.util.*;
   
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  @@ -64,13 +60,7 @@
   import org.apache.slide.webdav.WebdavException;
   import org.apache.slide.webdav.WebdavMethod;
   import org.apache.slide.webdav.WebdavServletConfig;
  -import org.apache.slide.webdav.util.BindConstants;
  -import org.apache.slide.webdav.util.DeltavConstants;
  -import org.apache.slide.webdav.util.PreconditionViolationException;
  -import org.apache.slide.webdav.util.UnlockListenerImpl;
  -import org.apache.slide.webdav.util.ViolatedPrecondition;
  -import org.apache.slide.webdav.util.WebdavConstants;
  -import org.apache.slide.webdav.util.WebdavUtils;
  +import org.apache.slide.webdav.util.*;
   import org.apache.util.MD5Encoder;
   import org.apache.util.WebdavStatus;
   import org.jdom.Document;
  @@ -87,7 +77,7 @@
    * @author Christopher Lenz
    */
   public abstract class AbstractWebdavMethod
  -    implements WebdavMethod, WebdavConstants, DeltavConstants, BindConstants {
  +    implements WebdavMethod, WebdavConstants, DeltavConstants, BindConstants, 
NotificationConstants {
   
   
       // -------------------------------------------------------------- Constants
  @@ -120,7 +110,7 @@
       /**
        * The indent to use in the XML response.
        */
  -    public static final String XML_REPONSE_INDENT = "    ";
  +    public static final String XML_RESPONSE_INDENT = "    ";
   
       private static final String LOG_CHANNEL =
           AbstractWebdavMethod.class.getName();
  @@ -128,7 +118,7 @@
       //  public static final String PRINCIPAL =
       //      "org.apache.slide.webdav.method.principal";
   
  -    protected static final int INFINITY = Integer.MAX_VALUE;
  +    public static final int INFINITY = Integer.MAX_VALUE;
       
       protected static final Namespace DNSP = NamespaceCache.DEFAULT_NAMESPACE;
       
  @@ -657,7 +647,7 @@
   
               resp.setContentType(TEXT_XML_UTF_8);
   
  -            new XMLOutputter(XML_REPONSE_INDENT, true).
  +            new XMLOutputter(XML_RESPONSE_INDENT, true).
                   output(new 
Document(MethodUtil.getPreconditionViolationError(pve.getViolatedPrecondition())), 
resp.getWriter());
           }
       }
  @@ -941,7 +931,12 @@
           private String hOverwriteStr;
           private String hTimeoutStr;
           private String hLabelStr;
  -        
  +        private String hNotificationTypeStr;
  +        private String hCallbackStr;
  +        private String hSubscriptionIdStr;
  +        private String hNotificationDelayStr;
  +        private String hSubscriptionLifetimeStr;
  +
           // parsed headers
           private List hIf;
           private String hLockToken;
  @@ -950,7 +945,12 @@
           private boolean hOverwrite;
           private int hTimeout;
           private String hLabel;
  -        
  +        private String hNotificationType;
  +        private String hCallback;
  +        private int []hSubscriptionId;
  +        private int hNotificationDelay;
  +        private int hSubscriptionLifetime;
  +
           // states
           private int stIf = ST_UNDEFINED;
           private int stLockToken = ST_UNDEFINED;
  @@ -959,7 +959,12 @@
           private int stOverwrite = ST_UNDEFINED;
           private int stTimeout = ST_UNDEFINED;
           private int stLabel = ST_UNDEFINED;
  -        
  +        private int stNotificationType = ST_UNDEFINED;
  +        private int stCallback = ST_UNDEFINED;
  +        private int stSubscriptionId = ST_UNDEFINED;
  +        private int stNotificationDelay = ST_UNDEFINED;
  +        private int stSubscriptionLifetime = ST_UNDEFINED;
  +
           private RequestHeaders() {
           }
           
  @@ -1064,9 +1069,136 @@
                   return hTimeout;
               }
           }
  -        
  +
  +        protected String getNotificationType() throws WebdavException {
  +            if (stNotificationType == ST_UNDEFINED) {
  +                return null;
  +            } else if (stNotificationType == ST_INVALID) {
  +                int sc = WebdavStatus.SC_PRECONDITION_FAILED;
  +                sendError( sc, "Invalid notification type: "+hNotificationTypeStr );
  +                throw new WebdavException( sc );
  +            }
  +            else {
  +                return hNotificationType;
  +            }
  +        }
  +
  +        protected int []getSubscriptionId() throws WebdavException {
  +            if (stSubscriptionId == ST_UNDEFINED) {
  +                return new int[0];
  +            } else if (stSubscriptionId == ST_INVALID) {
  +                int sc = WebdavStatus.SC_PRECONDITION_FAILED;
  +                sendError( sc, "Invalid subscription ID: "+hSubscriptionIdStr );
  +                throw new WebdavException( sc );
  +            }
  +            else {
  +                return hSubscriptionId;
  +            }
  +        }
  +
  +        protected String getCallback() throws WebdavException {
  +            if (stCallback == ST_UNDEFINED) {
  +                return null;
  +            } else if (stCallback == ST_INVALID) {
  +                int sc = WebdavStatus.SC_PRECONDITION_FAILED;
  +                sendError( sc, "Invalid callback: "+hCallbackStr );
  +                throw new WebdavException( sc );
  +            }
  +            else {
  +                return hCallback;
  +            }
  +        }
  +
  +        protected int getNotificationDelay( int defaultValue ) throws 
WebdavException {
  +            if (stNotificationDelay == ST_UNDEFINED) {
  +                return defaultValue;
  +            }
  +            else if (stNotificationDelay == ST_INVALID) {
  +                int sc = WebdavStatus.SC_PRECONDITION_FAILED;
  +                sendError( sc, "Invalid notification delay: "+hNotificationDelayStr 
);
  +                throw new WebdavException( sc );
  +            }
  +            else {
  +                return hNotificationDelay;
  +            }
  +        }
  +
  +        protected int getSubscriptionLifetime( int defaultValue ) throws 
WebdavException {
  +            if (stSubscriptionLifetime == ST_UNDEFINED) {
  +                return defaultValue;
  +            }
  +            else if (stSubscriptionLifetime == ST_INVALID) {
  +                int sc = WebdavStatus.SC_PRECONDITION_FAILED;
  +                sendError( sc, "Invalid subscription lifetime: 
"+hSubscriptionLifetimeStr );
  +                throw new WebdavException( sc );
  +            }
  +            else {
  +                return hSubscriptionLifetime;
  +            }
  +        }
  +
           private void parse() {
  -            
  +            // NotificationType header
  +            hNotificationTypeStr = req.getHeader(H_NOTIFICATION_TYPE);
  +            if (hNotificationTypeStr != null) {
  +                stNotificationType = ST_DEFINED;
  +                try {
  +                    hNotificationType = hNotificationTypeStr;
  +                } catch (Exception e) {
  +                    stNotificationType = ST_INVALID;
  +                }
  +            }
  +
  +            // NotificationDelay header
  +            hNotificationDelayStr = req.getHeader(H_NOTIFICATION_DELAY);
  +            if (hNotificationDelayStr != null) {
  +                stNotificationDelay = ST_DEFINED;
  +                try {
  +                    hNotificationDelay = Integer.parseInt(hNotificationDelayStr);
  +                } catch (Exception e) {
  +                    stNotificationDelay = ST_INVALID;
  +                }
  +            }
  +
  +            // SubscriptionLifetime header
  +            hSubscriptionLifetimeStr = req.getHeader(H_SUBSCRIPTION_LIFETIME);
  +            if (hSubscriptionLifetimeStr != null) {
  +                stSubscriptionLifetime = ST_DEFINED;
  +                try {
  +                    hSubscriptionLifetime = 
Integer.parseInt(hSubscriptionLifetimeStr);
  +                } catch (Exception e) {
  +                    stSubscriptionLifetime = ST_INVALID;
  +                }
  +            }
  +
  +            // SubscriptionID header
  +            hSubscriptionIdStr = req.getHeader(H_SUBSCRIPTION_ID);
  +            if (hSubscriptionIdStr != null) {
  +                stSubscriptionId = ST_DEFINED;
  +                try {
  +                    StringTokenizer tokenizer = new 
StringTokenizer(hSubscriptionIdStr, ",");
  +                    hSubscriptionId = new int[tokenizer.countTokens()];
  +                    int i = 0;
  +                    while ( tokenizer.hasMoreTokens() ) {
  +                        hSubscriptionId[i] = 
Integer.parseInt(tokenizer.nextToken().trim());
  +                        i++;
  +                    }
  +                } catch (Exception e) {
  +                    stSubscriptionId = ST_INVALID;
  +                }
  +            }
  +
  +            // Call back header
  +            hCallbackStr = req.getHeader(H_CALL_BACK);
  +            if (hCallbackStr != null) {
  +                stCallback = ST_DEFINED;
  +                try {
  +                    hCallback = hCallbackStr;
  +                } catch (Exception e) {
  +                    stCallback = ST_INVALID;
  +                }
  +            }
  +
               // If header
               hIfStr = req.getHeader(H_IF);
               if (hIfStr != null) {
  
  
  
  1.39      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AclMethod.java
  
  Index: AclMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AclMethod.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  
  
  
  1.14      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/BindMethod.java
  
  Index: BindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/BindMethod.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  
  
  
  1.25      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java
  
  Index: CheckinMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  
  
  
  1.29      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java
  
  Index: CheckoutMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  
  
  
  1.61      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java
  
  Index: CopyMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  
  
  
  1.7       +7 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DefaultMethodFactory.java
  
  Index: DefaultMethodFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DefaultMethodFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultMethodFactory.java 11 Feb 2004 11:30:29 -0000      1.6
  +++ DefaultMethodFactory.java 24 Feb 2004 17:03:33 -0000      1.7
  @@ -92,6 +92,10 @@
               return new PropPatchMethod(token, config);
           } else if (name.equals("REPORT")) {
               return new ReportMethod(token, config);
  +        } else if (name.equals("SUBSCRIBE")) {
  +            return new SubscribeMethod(token, config);
  +        } else if (name.equals("POLL")) {
  +            return new PollMethod(token, config);
           } else {
               if (Configuration.useIntegratedSecurity()) {
                   if (name.equals("ACL")) {
  
  
  
  1.33      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java
  
  Index: DeleteMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  
  
  
  1.43      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java
  
  Index: GetMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  
  
  
  1.24      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java
  
  Index: LabelMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  
  
  
  1.57      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java
  
  Index: LockMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- LockMethod.java   11 Feb 2004 11:30:30 -0000      1.56
  +++ LockMethod.java   24 Feb 2004 17:03:33 -0000      1.57
  @@ -520,7 +520,7 @@
               //System.out.println(generatedXML.toString());
               resp.setContentType(TEXT_XML_UTF_8);
               Writer writer = resp.getWriter();
  -            new org.jdom.output.XMLOutputter(XML_REPONSE_INDENT, true).output(new 
org.jdom.Document(prop), writer);
  +            new org.jdom.output.XMLOutputter(XML_RESPONSE_INDENT, true).output(new 
org.jdom.Document(prop), writer);
               writer.flush();
           } catch (Exception e) {
               int statusCode = WebdavStatus.SC_INTERNAL_SERVER_ERROR;
  
  
  
  1.32      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java
  
  Index: MkcolMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  
  
  
  1.68      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java
  
  Index: MoveMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  
  
  
  1.40      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java
  
  Index: OptionsMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- OptionsMethod.java        11 Feb 2004 12:58:29 -0000      1.39
  +++ OptionsMethod.java        24 Feb 2004 17:03:33 -0000      1.40
  @@ -61,7 +61,7 @@
       implements DeltavConstants, AclConstants, BindConstants {
       
       // An XML outputter
  -    private XMLOutputter xmlOut = new XMLOutputter(XML_REPONSE_INDENT, true, 
"UTF-8" );
  +    private XMLOutputter xmlOut = new XMLOutputter(XML_RESPONSE_INDENT, true, 
"UTF-8" );
       //  private Namespace xmlNs = Namespace.getNamespace(DEFAULT_NAMESPACE);
       
       // the collections which may contain VH or workspace resources are requested
  
  
  
  1.98      +10 -10    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java
  
  Index: PropFindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- PropFindMethod.java       11 Feb 2004 12:58:29 -0000      1.97
  +++ PropFindMethod.java       24 Feb 2004 17:03:33 -0000      1.98
  @@ -284,7 +284,7 @@
           
           // Create multistatus object
           Element multistatusElement = new Element(E_MULTISTATUS, DNSP);
  -        XMLOutputter xmlOutputter = new XMLOutputter(XML_REPONSE_INDENT, true);
  +        XMLOutputter xmlOutputter = new XMLOutputter(XML_RESPONSE_INDENT, true);
           
           if (resource != null) {
               if (depth == 0) {
  @@ -489,10 +489,10 @@
               sendError( statusCode, e );
               throw new WebdavException( statusCode );
           }
  -        
  +
           Vector propertiesParser = null;
           PropertyRetrieverImpl propertyRetriever = new PropertyRetrieverImpl(token, 
lightSToken, getConfig());
  -        
  +
           switch (propFindType) {
               case FIND_ALL_PROP :
               case FIND_BY_PROPERTY :
  @@ -513,12 +513,12 @@
                   }
                   break;
               case FIND_PROPERTY_NAMES :
  -                
  +
                   try {
                       status = new String("HTTP/1.1 " + WebdavStatus.SC_OK
                                               + " " + WebdavStatus.getStatusText
                                               (WebdavStatus.SC_OK));
  -                    
  +
                       Element propstatElement = new Element(E_PROPSTAT, DNSP);
                       Element propElement = new Element(E_PROP, DNSP);
                       RequestedProperties propnames =
  @@ -549,10 +549,10 @@
                   }
                   break;
           }
  -        
  +
           return responseElement;
       }
  -    
  +
       /**
        * Returns the appropriate <code>&lt;response&gt;</code> due to the given
        * <code>exception</code> to the <code>generatedXML</code>
  
  
  
  1.76      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java
  
  Index: PropPatchMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- PropPatchMethod.java      11 Feb 2004 12:58:29 -0000      1.75
  +++ PropPatchMethod.java      24 Feb 2004 17:03:33 -0000      1.76
  @@ -477,7 +477,7 @@
           try {
               resp.setContentType(TEXT_XML_UTF_8);
               Writer writer = resp.getWriter();
  -            new XMLOutputter(XML_REPONSE_INDENT, true).
  +            new XMLOutputter(XML_RESPONSE_INDENT, true).
                   output(new Document(multistatus), writer);
               writer.flush();
           } catch (Exception e) {
  
  
  
  1.72      +5 -5      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java
  
  Index: PutMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- PutMethod.java    11 Feb 2004 12:58:29 -0000      1.71
  +++ PutMethod.java    24 Feb 2004 17:03:34 -0000      1.72
  @@ -131,7 +131,7 @@
           
           // Prevent dirty reads
           slideToken.setForceStoreEnlistment(true);
  -        
  +
           // check destination URI
           UriHandler destUh = UriHandler.getUriHandler(resourcePath);
           if( VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH != null && 
VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH.length() > 0 ) {
  @@ -160,7 +160,7 @@
           try {
               // fire put event
               if ( WebdavEvent.PUT.isEnabled() ) 
EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.PUT, new 
WebdavEvent(this));
  -            
  +
               try {
   
                   boolean isLockedNullResource = false;
  
  
  
  1.12      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java
  
  Index: RebindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  
  
  
  1.64      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java
  
  Index: ReportMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- ReportMethod.java 11 Feb 2004 12:58:29 -0000      1.63
  +++ ReportMethod.java 24 Feb 2004 17:03:34 -0000      1.64
  @@ -223,7 +223,7 @@
                   reportWorker.execute(resourcePath, rootElm, getDepth());
                   resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
               }
  -            new XMLOutputter(XML_REPONSE_INDENT, true).
  +            new XMLOutputter(XML_RESPONSE_INDENT, true).
                   output(new Document(rootElm), resp.getWriter());
           }
           catch (PreconditionViolationException e) {
  
  
  
  1.39      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java
  
  Index: SearchMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- SearchMethod.java 11 Feb 2004 12:58:29 -0000      1.38
  +++ SearchMethod.java 24 Feb 2004 17:03:34 -0000      1.39
  @@ -292,7 +292,7 @@
       private void  sendResult (org.jdom.Document responseDoc)
           throws org.jdom.JDOMException, IOException
       {
  -        XMLOutputter xmlWriter = new XMLOutputter (XML_REPONSE_INDENT, true);
  +        XMLOutputter xmlWriter = new XMLOutputter (XML_RESPONSE_INDENT, true);
           xmlWriter.output (responseDoc, resp.getWriter());
       }
       
  
  
  
  1.11      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnbindMethod.java
  
  Index: UnbindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnbindMethod.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  
  
  
  1.16      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java
  
  Index: UncheckoutMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  
  
  
  1.33      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java
  
  Index: UnlockMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  
  
  
  1.26      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java
  
  Index: UpdateMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- UpdateMethod.java 11 Feb 2004 12:58:29 -0000      1.25
  +++ UpdateMethod.java 24 Feb 2004 17:03:34 -0000      1.26
  @@ -264,7 +264,7 @@
           try {
               resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
               resp.setContentType(TEXT_XML_UTF_8);
  -            new XMLOutputter(XML_REPONSE_INDENT, true).
  +            new XMLOutputter(XML_RESPONSE_INDENT, true).
                   output(new Document(multistatusElement), resp.getWriter());
           }
           catch (Exception e) {
  
  
  
  1.26      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java
  
  Index: VersionControlMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- VersionControlMethod.java 11 Feb 2004 12:58:29 -0000      1.25
  +++ VersionControlMethod.java 24 Feb 2004 17:03:34 -0000      1.26
  @@ -162,7 +162,7 @@
                           new Exception("The resource path has been excluded from 
version-control") );
               }
               if ( WebdavEvent.VERSION_CONTROL.isEnabled() ) 
EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.VERSION_CONTROL, new 
WebdavEvent(this));
  -            
  +
               VersioningHelper vh = VersioningHelper.getVersioningHelper(
                   slideToken, token, req, resp, getConfig() );
               if( existingVersionPath == null )
  
  
  
  1.67      +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java
  
  Index: PropertyHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- PropertyHelper.java       11 Feb 2004 12:58:30 -0000      1.66
  +++ PropertyHelper.java       24 Feb 2004 17:03:34 -0000      1.67
  @@ -1687,7 +1687,7 @@
           NamespaceConfig config = nsaToken.getNamespaceConfig();
           Structure structure = nsaToken.getStructureHelper();
           ObjectNode object =  structure.retrieve(sToken, 
revisionDescriptors.getUri());
  -        
  +
           // check read-own-permissions permission
           Security security = nsaToken.getSecurityHelper();
           security.checkCredentials(sToken, object, 
config.getReadOwnPermissionsAction());
  
  
  
  1.27      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/UriHandler.java
  
  Index: UriHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/UriHandler.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  
  
  
  1.99      +3 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java
  
  Index: VersioningHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  
  
  
  1.16      +5 -5      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java
  
  Index: WebdavUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WebdavUtils.java  11 Feb 2004 12:58:30 -0000      1.15
  +++ WebdavUtils.java  24 Feb 2004 17:03:34 -0000      1.16
  @@ -538,7 +538,7 @@
               return WebdavStatus.SC_INTERNAL_SERVER_ERROR;
           }
       }
  -    
  +
       /**
        * Get return status based on exception type.
        */
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to