KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > webdav > impl > LockManager


1 package com.ibm.webdav.impl;
2
3 /*
4  * (C) Copyright IBM Corp. 2000 All rights reserved.
5  *
6  * The program is provided "AS IS" without any warranty express or
7  * implied, including the warranty of non-infringement and the implied
8  * warranties of merchantibility and fitness for a particular purpose.
9  * 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 /** Get the locks that exist on this resource. May be null if the resource
37 * is not locked.
38 *
39 * @return a Vector of ActiveLock objects
40 * @exception com.ibm.webdav.WebDAVException
41 */

42 public Vector getLocks() throws WebDAVException;
43 /** Get information about locks supported by this resource.
44 *
45 * @return an Element with tag name D:supportedlock
46 */

47 public Element getSupportedLock();
48 /** Initialize an this LockManager instance.
49 * @param resource the resource to manage locks for
50 * @param namespaceManager its namespace manager
51 * @param propertiesManager its properties manager
52 */

53 public void initialize(ResourceImpl resource,
54                        com.ibm.webdav.impl.NamespaceManager namespaceManager,
55                        com.ibm.webdav.impl.PropertiesManager propertiesManager);
56 /** Lock this resource Using the given activeLock.
57 *
58 * @param activeLock the lock to activate (i.e., persist)
59 *
60 * @return a MultiStatus containing a lockdiscovery property indicating
61 * the results of the lock operation.
62 * @exception com.ibm.webdav.WebDAVException
63 */

64 public MultiStatus lock(ActiveLock activeLock) throws WebDAVException;
65 /** Refresh the lock on this resource by resetting the lock timeout.
66 * The context must contain the proper authorization for the requesting
67 * principal.
68 *
69 * @param activeLock the lock to refresh. Contains the updated timeout
70 * and expiration date.
71 *
72 * @return updated information about the lock status of this resource
73 * @exception com.ibm.webdav.WebDAVException
74 */

75 public MultiStatus refreshLock(ActiveLock activeLock) throws WebDAVException;
76 /** Unlock the lock identified by the lockToken on this resource
77 *
78 * @param activeLock the lock to unlock
79 *
80 * @return a MultiStatus containing any responses on resources that could not
81 * be unlocked.
82 * @exception com.ibm.webdav.WebDAVException
83 */

84 public MultiStatus unlock(ActiveLock activeLock) throws WebDAVException;
85 }
86
Popular Tags