001: package com.ibm.webdav.impl;
002:
003: /*
004: * (C) Copyright IBM Corp. 2000 All rights reserved.
005: *
006: * The program is provided "AS IS" without any warranty express or
007: * implied, including the warranty of non-infringement and the implied
008: * warranties of merchantibility and fitness for a particular purpose.
009: * IBM will not be liable for any damages suffered by you as a result
010: * of using the Program. In no event will IBM be liable for any
011: * special, indirect or consequential damages or lost profits even if
012: * IBM has been advised of the possibility of their occurrence. IBM
013: * will not be liable for any third party claims against you.
014: */
015: import java.util.*;
016:
017: import org.w3c.dom.*;
018:
019: import com.ibm.webdav.*;
020:
021: /** A Collection is a Resource that contains other
022: * resources including other Collections following the composite pattern.
023: * It is useful for managing logically
024: * related groups of resources for authorization, permissions, move, copy, group properties,
025: * location, etc. by clients.
026: * @see com.ibm.webdav.CollectionP
027: * @see com.ibm.webdav.ResourceP
028: * @see com.ibm.webdav.Precondition#addStateTokenCondition
029: * @author Jim Amsden <jamsden@us.ibm.com>
030: */
031: public interface IRCollection extends IRResource {
032: /** Copy this resource to the destination URL.
033: * Partial results are possible, check the returned status for details.
034: *
035: * @param destinationURL the destination
036: * @param depth an indicator for immediate members or recursively all children.
037: * <ul>
038: * <li>shallow: copy only this resource</li>
039: * <li>deep: copy this resource and recursively all of its children</li>
040: * </ul>
041: * @param overwrite true implies overrite the destination if it exists
042: * @param propertiesToCopy a collection of properties that must be copied or
043: * the method will fail. propertiesToCopy may have one of the following values:
044: * <ul>
045: * <li>null - ignore properties that cannot be copied</li>
046: * <li>empty collection - all properties must be copied or the method will fail</li>
047: * <li>a collection of URIs - a list of the properties that must be copied
048: * or the method will fail</li>
049: * </ul>
050: *
051: * @return the status of the copy operation for each resource copied
052: * @exception com.ibm.webdav.WebDAVException
053: */
054: public MultiStatus copy(ResourceContext context,
055: String destinationURL, boolean overwrite,
056: Vector propertiesToCopy, String depth)
057: throws WebDAVException;
058:
059: /** Actually create the collection in the repository. The resource indicated
060: * by the URL must not already exist. All ancestors of this URL must already
061: * exist.
062: *
063: * @param contents an XML Document describing the members of this collection, bodies
064: * of members, and properties on the collections or members. Not completely defined in
065: * version 10 of the WebDAV specification
066: *
067: * @return Multistatus describing the result
068: * of the operation
069: * @exception com.ibm.webdav.WebDAVException
070: */
071: public MultiStatus createCollection(ResourceContext context,
072: Document contents) throws WebDAVException;
073:
074: /** Delete this resouce collection and all its members from the server.
075: * The actual effect of the delete operation is determined by the underlying
076: * repository manager. The visible effect to WebDAV is that the resource
077: * is no longer available.
078: *
079: * @return a MultiStatus containing the status of the delete method on each
080: * effected resource.
081: * @exception com.ibm.webdav.WebDAVException
082: */
083: public MultiStatus delete(ResourceContext context)
084: throws WebDAVException;
085:
086: /** Get the named properties for this resource and (potentially) its children.
087: *
088: * @param names an arrary of property names to retrieve.
089: * @param depth an indicator for immediate members or recursively all children.
090: * <ul>
091: * <li>immediateMembers: propeprties of this resource and its immediate children</li>
092: * <li>allMembers: properties of this resource and recursively all its children</li>
093: * </ul>
094: *
095: * @return a MultiStatus of PropertyResponses
096: * @exception com.ibm.webdav.WebDAVException
097: */
098: public MultiStatus getProperties(ResourceContext context,
099: PropertyName names[], String depth) throws WebDAVException;
100:
101: /** Get all the properties for this resource and (potentially) its children.
102: *
103: * @param depth an indicator for immediate members or recursively all children.
104: * <ul>
105: * <li>thisResource: propeprties of this resource</li>
106: * <li>immediateMembers: propeprties of this resource and its immediate children</li>
107: * <li>allMembers: properties of this resource and recursively all its children</li>
108: * </ul>
109: *
110: * @return a MultiStatus of PropertyResponses
111: * @exception com.ibm.webdav.WebDAVException
112: */
113: public MultiStatus getProperties(ResourceContext context,
114: String depth) throws WebDAVException;
115:
116: /** Get the names of all properties for this resource and (potentially) its children.
117: *
118: * @param depth an indicator for immediate members or recursively all children.
119: * <ul>
120: * <li>thisResource: propeprties of this resource</li>
121: * <li>immediateMembers: propeprties of this resource and its immediate children</li>
122: * <li>allMembers: properties of this resource and recursively all its children</li>
123: * </ul>
124: *
125: * @return a MultiStatus of PropertyResponses
126: * (PropertyValue.value is always null, PropertyValue.status contains the status)
127: * @exception com.ibm.webdav.WebDAVException
128: */
129: public MultiStatus getPropertyNames(ResourceContext context,
130: String depth) throws WebDAVException;
131:
132: /** Lock this resource collection and potentially all its members
133: * based on the given parameters. This allows control of the lock
134: * scope (exclusive or shared) the lock type (write), owner information, etc.
135: *
136: * @param scope the scope of the lock, exclusive or shared
137: * @param type the type of the lock, currently only write
138: * @param depth
139: * <ul>
140: * <li>shallow lock only this resource</li>
141: * <li>deep lock this resource and all its children</li>
142: * </ul>
143: * @param timeout the number of seconds before the lock times out or
144: * 0 for infinite timeout.
145: * @param owner an XML element containing useful information that can be
146: * used to identify the owner of the lock. An href to a home page, an
147: * email address, phone number, etc. Can be null if no owner information
148: * is provided.
149: *
150: * @return a MultiStatus containing a lockdiscovery property indicating
151: * the results of the lock operation.
152: * @exception com.ibm.webdav.WebDAVException
153: */
154: public MultiStatus lock(ResourceContext context, String scope,
155: String type, int timeout, Element owner, String depth)
156: throws WebDAVException;
157: }
|