KickJava   Java API By Example, From Geeks To Geeks.

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


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
22 /** A Collection is a Resource that contains other
23  * resources including other Collections following the composite pattern.
24  * It is useful for managing logically
25  * related groups of resources for authorization, permissions, move, copy, group properties,
26  * location, etc. by clients.
27  * @see com.ibm.webdav.CollectionP
28  * @see com.ibm.webdav.ResourceP
29  * @see com.ibm.webdav.Precondition#addStateTokenCondition
30  * @author Jim Amsden <jamsden@us.ibm.com>
31  */

32 public interface IRCollection extends IRResource {
33 /** Copy this resource to the destination URL.
34 * Partial results are possible, check the returned status for details.
35 *
36 * @param destinationURL the destination
37 * @param depth an indicator for immediate members or recursively all children.
38 * <ul>
39 * <li>shallow: copy only this resource</li>
40 * <li>deep: copy this resource and recursively all of its children</li>
41 * </ul>
42 * @param overwrite true implies overrite the destination if it exists
43 * @param propertiesToCopy a collection of properties that must be copied or
44 * the method will fail. propertiesToCopy may have one of the following values:
45 * <ul>
46 * <li>null - ignore properties that cannot be copied</li>
47 * <li>empty collection - all properties must be copied or the method will fail</li>
48 * <li>a collection of URIs - a list of the properties that must be copied
49 * or the method will fail</li>
50 * </ul>
51 *
52 * @return the status of the copy operation for each resource copied
53 * @exception com.ibm.webdav.WebDAVException
54 */

55 public MultiStatus copy(ResourceContext context, String JavaDoc destinationURL, boolean overwrite, Vector propertiesToCopy, String JavaDoc depth) throws WebDAVException;
56 /** Actually create the collection in the repository. The resource indicated
57 * by the URL must not already exist. All ancestors of this URL must already
58 * exist.
59 *
60 * @param contents an XML Document describing the members of this collection, bodies
61 * of members, and properties on the collections or members. Not completely defined in
62 * version 10 of the WebDAV specification
63 *
64 * @return Multistatus describing the result
65 * of the operation
66 * @exception com.ibm.webdav.WebDAVException
67 */

68 public MultiStatus createCollection(ResourceContext context, Document contents) throws WebDAVException;
69 /** Delete this resouce collection and all its members from the server.
70  * The actual effect of the delete operation is determined by the underlying
71  * repository manager. The visible effect to WebDAV is that the resource
72  * is no longer available.
73  *
74  * @return a MultiStatus containing the status of the delete method on each
75  * effected resource.
76  * @exception com.ibm.webdav.WebDAVException
77  */

78 public MultiStatus delete(ResourceContext context) throws WebDAVException;
79 /** Get the named properties for this resource and (potentially) its children.
80 *
81 * @param names an arrary of property names to retrieve.
82 * @param depth an indicator for immediate members or recursively all children.
83 * <ul>
84 * <li>immediateMembers: propeprties of this resource and its immediate children</li>
85 * <li>allMembers: properties of this resource and recursively all its children</li>
86 * </ul>
87 *
88 * @return a MultiStatus of PropertyResponses
89 * @exception com.ibm.webdav.WebDAVException
90 */

91 public MultiStatus getProperties(ResourceContext context, PropertyName names[], String JavaDoc depth) throws WebDAVException;
92 /** Get all the properties for this resource and (potentially) its children.
93 *
94 * @param depth an indicator for immediate members or recursively all children.
95 * <ul>
96 * <li>thisResource: propeprties of this resource</li>
97 * <li>immediateMembers: propeprties of this resource and its immediate children</li>
98 * <li>allMembers: properties of this resource and recursively all its children</li>
99 * </ul>
100 *
101 * @return a MultiStatus of PropertyResponses
102 * @exception com.ibm.webdav.WebDAVException
103 */

104 public MultiStatus getProperties(ResourceContext context, String JavaDoc depth) throws WebDAVException;
105 /** Get the names of all properties for this resource and (potentially) its children.
106 *
107 * @param depth an indicator for immediate members or recursively all children.
108 * <ul>
109 * <li>thisResource: propeprties of this resource</li>
110 * <li>immediateMembers: propeprties of this resource and its immediate children</li>
111 * <li>allMembers: properties of this resource and recursively all its children</li>
112 * </ul>
113 *
114 * @return a MultiStatus of PropertyResponses
115 * (PropertyValue.value is always null, PropertyValue.status contains the status)
116 * @exception com.ibm.webdav.WebDAVException
117 */

118 public MultiStatus getPropertyNames(ResourceContext context, String JavaDoc depth) throws WebDAVException;
119 /** Lock this resource collection and potentially all its members
120 * based on the given parameters. This allows control of the lock
121 * scope (exclusive or shared) the lock type (write), owner information, etc.
122 *
123 * @param scope the scope of the lock, exclusive or shared
124 * @param type the type of the lock, currently only write
125 * @param depth
126 * <ul>
127 * <li>shallow lock only this resource</li>
128 * <li>deep lock this resource and all its children</li>
129 * </ul>
130 * @param timeout the number of seconds before the lock times out or
131 * 0 for infinite timeout.
132 * @param owner an XML element containing useful information that can be
133 * used to identify the owner of the lock. An href to a home page, an
134 * email address, phone number, etc. Can be null if no owner information
135 * is provided.
136 *
137 * @return a MultiStatus containing a lockdiscovery property indicating
138 * the results of the lock operation.
139 * @exception com.ibm.webdav.WebDAVException
140 */

141 public MultiStatus lock(ResourceContext context, String JavaDoc scope, String JavaDoc type, int timeout, Element owner, String JavaDoc depth) throws WebDAVException;
142 }
143
Popular Tags