KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * (C) Copyright IBM Corp. 2000 All rights reserved.
3  *
4  * The program is provided "AS IS" without any warranty express or
5  * implied, including the warranty of non-infringement and the implied
6  * warranties of merchantibility and fitness for a particular purpose.
7  * IBM will not be liable for any damages suffered by you as a result
8  * of using the Program. In no event will IBM be liable for any
9  * special, indirect or consequential damages or lost profits even if
10  * IBM has been advised of the possibility of their occurrence. IBM
11  * will not be liable for any third party claims against you.
12  *
13  * Portions Copyright (C) Simulacra Media Ltd, 2004.
14  */

15
16 package com.ibm.webdav.impl;
17
18 import org.w3c.dom.*;
19
20 import com.ibm.webdav.*;
21
22 /** A LockDiscovery is a LiveProperty corresponding to the DAV:lockdiscovery property.
23  * @author Jim Amsden <jamsden@us.ibm.com>
24  * @see com.ibm.webdav.PropertyValue
25  * @see com.ibm.webdav.impl.ResourceImpl#updateLiveProperties
26  * @see com.ibm.webdav.impl.ResourceImpl#removeLiveProperties
27  * @see com.ibm.webdav.impl.PropertiesManager#updateLiveProperties
28  * @see com.ibm.webdav.impl.PropertiesManager#removeLiveProperties
29  */

30 public class LockDiscovery extends LiveProperty {
31 /**
32  * Get the name of this live property.
33  * @return the live property name (XML namespace+localpart)
34  */

35 public String JavaDoc getName() {
36     return "DAV:lockdiscovery";
37 }
38 /**
39  * Get the XML tag name (without a prefix) of this live property.
40  * @return the live property tag name without a prefix
41  */

42 public String JavaDoc getNSLocalName() {
43     return "lockdiscovery";
44 }
45 /**
46  * Get the preferred namespace prefix for this live property.
47  * @return the XML namespace prefix for this property
48  */

49 public String JavaDoc getPreferredPrefix() {
50     return "D";
51 }
52 /**
53  * Get the value of this live property.
54  * @return the live property value
55  */

56 public PropertyValue getValueFor(ResourceImpl resource) {
57     Element lockdiscovery = null;
58     int status = WebDAVStatus.SC_OK;
59     try {
60         lockdiscovery = (Element)((Element)resource.getLockManager().getLockDiscovery()).cloneNode(true);
61     } catch (WebDAVException exc) {
62         status = exc.getStatusCode();
63     } catch (Exception JavaDoc exc) {
64         status = WebDAVStatus.SC_INTERNAL_SERVER_ERROR;
65     }
66     PropertyValue result = new PropertyValue(lockdiscovery, status);
67     return result;
68 }
69 /**
70  * Is this live property updatable by the user?
71  * @return true if the use can update this live property, false if only
72  * the server can update the property.
73  */

74 public boolean isUserUpdatable() {
75     return false;
76 }
77 }
78
Popular Tags