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: * Portions Copyright (C) Simulacra Media Ltd, 2004.
016: */
017: import java.io.*;
018: import java.net.*;
019: import java.util.*;
020:
021: import org.w3c.dom.*;
022:
023: import com.ibm.webdav.*;
024:
025: /** NamespaceManager implements all WebDAV namespace methods that are
026: * dependent on a specific repository manager interface. This manager is
027: * used by ResourceImpl and its subclasses to interface with a particular
028: * repository manager for accessing and controlling resources. Implementing
029: * this interface along with PropertiesManager and LockManager is all that
030: * is needed to provide WebDAV access to a particular repository manager.
031: * @author Jim Amsden <jamsden@us.ibm.com>
032: */
033: public interface NamespaceManager {
034: /** Close any opened OutputStream on the contents of the managed resource.
035: * @exception com.ibm.webdav.WebDAVException
036: */
037: public void closeContentsOutputStream() throws WebDAVException;
038:
039: /** Create a collection with the given local name.
040: * @param localName the repository specific local name for the resource
041: * @exception com.ibm.webdav.WebDAVException
042: */
043: public void createCollection(String localName)
044: throws WebDAVException;
045:
046: /** Create this resource as a lock-null resource, a resource created by locking one that
047: * did not previously exist.
048: * @exception com.ibm.webdav.WebDAVException
049: */
050: public void createLockNullResource() throws WebDAVException;
051:
052: /** Delete the managed resource from the repository.
053: * @exception com.ibm.webdav.WebDAVException
054: */
055: public void delete() throws WebDAVException;
056:
057: /**
058: * Create new binding
059: * @param path
060: * @throws WebDAVException
061: */
062: public void createBinding(String bindName, URL source)
063: throws WebDAVException;
064:
065: /** Move the managed resource
066: * @exception com.ibm.webdav.WebDAVException
067: */
068: public void move(String path) throws WebDAVException;
069:
070: /** See if this resource exists in the repository.
071: *
072: * @return true if the resource exists, false otherwise.
073: * @exception com.ibm.webdav.WebDAVException
074: */
075: public boolean exists() throws WebDAVException;
076:
077: /** Open an InputStream on the contents of the managed resource.
078: *
079: * @return an InputStream on the contents of the managed resource.
080: * @exception com.ibm.webdav.WebDAVException
081: */
082: public InputStream getContentsInputStream() throws WebDAVException;
083:
084: /** Open an OutputStream in order to write the contents of the managed resource.
085: *
086: * @return an OutputStream on the contents of the managed resource.
087: * @exception com.ibm.webdav.WebDAVException
088: */
089: public OutputStream getContentsOutputStream()
090: throws WebDAVException;
091:
092: /** Get the members of a collection.
093: *
094: * @return a Vector of Resources (ResourceImpl or CollectionImpl)
095: * @exception com.ibm.webdav.WebDAVException
096: */
097: public Vector getMembers() throws WebDAVException;
098:
099: /** Initialize this NamespaceManager instance.
100: * @param resource the resource to manage
101: */
102: public void initialize(ResourceImpl resource);
103:
104: /** Is the managed resource a collection?
105: * @return true if this resource is a collection, false otherwise
106: * @exception com.ibm.webdav.WebDAVException
107: */
108: public boolean isCollection() throws WebDAVException;
109:
110: /**
111: * Is the managed resource versionable?
112: *
113: * @return
114: * @throws WebDAVException
115: */
116: public boolean isVersionable() throws WebDAVException;
117:
118: /** Is this resource in the lock-null state?
119: * @return true if this resource is a lock-null resource, false otherwise
120: * @exception com.ibm.webdav.WebDAVException
121: */
122: public boolean isLockNull() throws WebDAVException;
123:
124: /** Treat the managed resource as a method and execute it with the given arguments.
125: * Ths should be done by the host Web server. Executes CGI scripts and Servlets. But
126: * the repository may have some additional capabilities of its own.
127: * @param args the URL query string (text following the ?)
128: * @return the contents of the result
129: * @exception com.ibm.webdav.WebDAVException
130: */
131: public byte[] performWith(String args) throws WebDAVException;
132:
133: /**
134: * Returns a list of methods allowed on this resource
135: *
136: * @return
137: * @throws WebDAVException
138: */
139: public List getAllowedMethods() throws WebDAVException;
140:
141: /**
142: * Sets the ordering of members within collection
143: *
144: * @param orderPatch
145: */
146: public void setOrdering(Document orderPatch) throws WebDAVException;
147:
148: /**
149: * @return
150: */
151: public String getContentType() throws WebDAVException;
152:
153: /**
154: * @param sContentType
155: */
156: public void closeContentsOutputStream(String sContentType)
157: throws WebDAVException;
158:
159: }
|