01: package com.ibm.webdav.impl;
02:
03: /*
04: * (C) Copyright IBM Corp. 2000 All rights reserved.
05: *
06: * The program is provided "AS IS" without any warranty express or
07: * implied, including the warranty of non-infringement and the implied
08: * warranties of merchantibility and fitness for a particular purpose.
09: * IBM will not be liable for any damages suffered by you as a result
10: * of using the Program. In no event will IBM be liable for any
11: * special, indirect or consequential damages or lost profits even if
12: * IBM has been advised of the possibility of their occurrence. IBM
13: * will not be liable for any third party claims against you.
14: */
15: import java.util.*;
16:
17: import org.w3c.dom.*;
18:
19: import com.ibm.webdav.*;
20:
21: /** LockManager implements all WebDAV locking methods that are
22: * dependent on a specific repository manager interface. This manager is
23: * used by ResourceImpl and its subclasses to interface with a particular
24: * repository manager for locking and unlocking resources. Implementing
25: * this interface along with NamespaceManager and PropertiesManager is all that
26: * is needed to provide WebDAV access to a particular repository manager.
27: * @author Jim Amsden <jamsden@us.ibm.com>
28: */
29: public interface LockManager {
30: /** Get the lockdiscovery DAV property for the resource.
31: *
32: * @return an Element with tag name D:lockdiscovery
33: * @exception com.ibm.webdav.WebDAVException
34: */
35: public Element getLockDiscovery() throws WebDAVException;
36:
37: /** Get the locks that exist on this resource. May be null if the resource
38: * is not locked.
39: *
40: * @return a Vector of ActiveLock objects
41: * @exception com.ibm.webdav.WebDAVException
42: */
43: public Vector getLocks() throws WebDAVException;
44:
45: /** Get information about locks supported by this resource.
46: *
47: * @return an Element with tag name D:supportedlock
48: */
49: public Element getSupportedLock();
50:
51: /** Initialize an this LockManager instance.
52: * @param resource the resource to manage locks for
53: * @param namespaceManager its namespace manager
54: * @param propertiesManager its properties manager
55: */
56: public void initialize(ResourceImpl resource,
57: com.ibm.webdav.impl.NamespaceManager namespaceManager,
58: com.ibm.webdav.impl.PropertiesManager propertiesManager);
59:
60: /** Lock this resource Using the given activeLock.
61: *
62: * @param activeLock the lock to activate (i.e., persist)
63: *
64: * @return a MultiStatus containing a lockdiscovery property indicating
65: * the results of the lock operation.
66: * @exception com.ibm.webdav.WebDAVException
67: */
68: public MultiStatus lock(ActiveLock activeLock)
69: throws WebDAVException;
70:
71: /** Refresh the lock on this resource by resetting the lock timeout.
72: * The context must contain the proper authorization for the requesting
73: * principal.
74: *
75: * @param activeLock the lock to refresh. Contains the updated timeout
76: * and expiration date.
77: *
78: * @return updated information about the lock status of this resource
79: * @exception com.ibm.webdav.WebDAVException
80: */
81: public MultiStatus refreshLock(ActiveLock activeLock)
82: throws WebDAVException;
83:
84: /** Unlock the lock identified by the lockToken on this resource
85: *
86: * @param activeLock the lock to unlock
87: *
88: * @return a MultiStatus containing any responses on resources that could not
89: * be unlocked.
90: * @exception com.ibm.webdav.WebDAVException
91: */
92: public MultiStatus unlock(ActiveLock activeLock)
93: throws WebDAVException;
94: }
|