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: * Portions Copyright (C) Simulacra Media Ltd, 2004.
16: */
17: import com.ibm.webdav.*;
18:
19: /** A LiveProperty represents some property whose semantics is controlled
20: * or managed in some way by the server. A live property may be considered
21: * an abstraction of a function call for properties. There are a number of
22: * contributors of live properties including:
23: * <ul>
24: * <li>WebDAV defined live properties that are independent of any repository manager</li>
25: * <li>live properties that are specific to a particular repository manager</li>
26: * <li>user defined live properties</li>
27: * </ul></p>
28: * <p>
29: * Subclasses provide the specifics for each live property.
30: * @author Jim Amsden <jamsden@us.ibm.com>
31: * @see com.ibm.webdav.PropertyValue
32: * @see com.ibm.webdav.impl.ResourceImpl#updateLiveProperties
33: * @see com.ibm.webdav.impl.ResourceImpl#removeLiveProperties
34: * @see com.ibm.webdav.impl.PropertiesManager#updateLiveProperties
35: * @see com.ibm.webdav.impl.PropertiesManager#removeLiveProperties
36: */
37: public abstract class LiveProperty extends Object {
38: /**
39: * Get the name of this live property.
40: * @return the live property name (XML namespace+localpart)
41: */
42: public String getName() {
43: return getNSName() + getNSLocalName();
44: }
45:
46: /**
47: * Get the XML tag name (without a prefix) of this live property.
48: * @return the live property tag name without a prefix
49: */
50: public abstract String getNSLocalName();
51:
52: /**
53: * Get the XML namespace name (not the prefix) of this live property.
54: * The default is "DAV:". Subclasses may want to override this method
55: * with their specific namespace name.
56: * @return the live property namespace name
57: */
58: public String getNSName() {
59: return "DAV:";
60: }
61:
62: /**
63: * Get the preferred namespace prefix for this live property.
64: * @return the XML namespace prefix for this property
65: */
66: public abstract String getPreferredPrefix();
67:
68: /**
69: * Get the value of this live property.
70: * @return the live property value
71: */
72: public abstract PropertyValue getValueFor(ResourceImpl resource);
73:
74: /**
75: * Is this live property updatable by the user?
76: * @return true if the use can update this live property, false if only
77: * the server can update the property.
78: */
79: public abstract boolean isUserUpdatable();
80: }
|