View Javadoc

1   /*
2    * <cvs:source>$Source: /devel/astrogrid/filemanager/common/src/java/org/astrogrid/filemanager/common/FileManager.java,v $</cvs:source>
3    * <cvs:author>$Author: clq2 $</cvs:author>
4    * <cvs:date>$Date: 2005/01/28 10:43:58 $</cvs:date>
5    * <cvs:version>$Revision: 1.5 $</cvs:version>
6    * <cvs:log>
7    *   $Log: FileManager.java,v $
8    *   Revision 1.5  2005/01/28 10:43:58  clq2
9    *   dave_dev_200501141257 (filemanager)
10   *
11   *   Revision 1.4.2.2  2005/01/21 14:42:27  dave
12   *   Changed tabs to spaces ..
13   *
14   *   Revision 1.4.2.1  2005/01/20 07:17:14  dave
15   *   Added import data from URL to server side logic ....
16   *   Tidied up tabs in some files.
17   *
18   *   Revision 1.4  2005/01/13 17:23:15  jdt
19   *   merges from dave-dev-200412201250
20   *
21   *   Revision 1.3.4.4  2005/01/12 13:16:27  dave
22   *   Changed tabs to spaces ...
23   *
24   *   Revision 1.3.4.3  2005/01/07 12:18:00  dave
25   *   Added StoreClientWrapperTest
26   *   Added StoreFileWrapper
27   *
28   *   Revision 1.3.4.2  2004/12/24 02:42:45  dave
29   *   Changed delete to use ivorn ...
30   *
31   *   Revision 1.3.4.1  2004/12/24 02:05:05  dave
32   *   Refactored exception handling, removing IdentifierException from the public API ...
33   *
34   *   Revision 1.3  2004/12/16 17:25:49  jdt
35   *   merge from dave-dev-200410061224-200412161312
36   *
37   *   Revision 1.1.2.24  2004/12/14 14:11:56  dave
38   *   Added delete to the server API ....
39   *
40   *   Revision 1.1.2.23  2004/12/11 05:59:17  dave
41   *   Added internal copy for nodes ...
42   *   Added local copy for data ...
43   *
44   *   Revision 1.1.2.22  2004/12/08 17:54:55  dave
45   *   Added update to FileManager client and server side ...
46   *
47   *   Revision 1.1.2.21  2004/12/02 19:11:54  dave
48   *   Added move name and parent to manager ...
49   *
50   *   Revision 1.1.2.20  2004/11/16 06:23:38  dave
51   *   Updated commetnts and todo ...
52   *
53   *   Revision 1.1.2.19  2004/11/16 03:25:37  dave
54   *   Updated API to use full ivorn rather than ident ...
55   *
56   *   Revision 1.1.2.18  2004/11/13 01:39:03  dave
57   *   Modifications to support the new client API ...
58   *
59   *   Revision 1.1.2.17  2004/11/11 16:36:19  dave
60   *   Changed getChildren to retunr array of names ...
61   *
62   *   Revision 1.1.2.16  2004/11/11 15:41:44  dave
63   *   Renamed importInitEx and exportInitEx back to the original names ...
64   *
65   *   Revision 1.1.2.15  2004/11/11 15:30:37  dave
66   *   Moving manager API to property[] rather than Node.
67   *
68   *   Revision 1.1.2.14  2004/11/10 18:32:57  dave
69   *   Moved getAccount API to use properties ...
70   *
71   *   Revision 1.1.2.13  2004/11/10 17:00:11  dave
72   *   Moving the manager API towards property based rather than node based ...
73   *
74   *   Revision 1.1.2.12  2004/11/06 20:03:17  dave
75   *   Implemented ImportInit and ExportInit using properties
76   *
77   *   Revision 1.1.2.11  2004/11/05 05:58:31  dave
78   *   Refactored the properties handling in importInitEx() ..
79   *
80   *   Revision 1.1.2.10  2004/11/05 02:23:45  dave
81   *   Refactored identifiers are properties ...
82   *
83   *   Revision 1.1.2.9  2004/11/04 04:15:34  dave
84   *   Sketched out the new business logic for import init ....
85   *
86   *   Revision 1.1.2.8  2004/11/04 02:33:38  dave
87   *   Refactored test to include multiple filestores ...
88   *
89   *   Revision 1.1.2.7  2004/11/01 16:23:22  dave
90   *   Started integrating import and export with FileStore ...
91   *
92   *   Revision 1.1.2.6  2004/10/21 21:08:52  dave
93   *   Added config interface and mock implementation.
94   *   Partial implementation of data import into FileStore via direct URL transfer.
95   *
96   *   Revision 1.1.2.5  2004/10/19 14:52:36  dave
97   *   Refactored container and file into just node.
98   *
99   * </cvs:log>
100  *
101  */
102 package org.astrogrid.filemanager.common ;
103 
104 import java.rmi.Remote ;
105 import java.rmi.RemoteException ;
106 
107 import org.astrogrid.filestore.common.file.FileProperty;
108 import org.astrogrid.filestore.common.transfer.TransferProperties;
109 
110 import org.astrogrid.filemanager.common.exception.NodeNotFoundException;
111 import org.astrogrid.filemanager.common.exception.DuplicateNodeException;
112 import org.astrogrid.filemanager.common.exception.FileManagerServiceException;
113 
114 /***
115  * The public interface for a file manager service.
116  *
117  */
118 public interface FileManager
119     extends java.rmi.Remote
120     {
121     /***
122      * Get the manager identifier.
123      * @return The manager identifier (ivorn).
124      * @throws FileManagerServiceException If a problem occurs when handling the request.
125      * @throws RemoteException If the WebService call fails.
126      *
127      */
128     public String getIdentifier()
129         throws
130             RemoteException,
131             FileManagerServiceException;
132 
133     /***
134      * Create a root node for a new account.
135      * @param account The identifier for the account.
136      * @return An array of properties for the new account node.
137      * @throws DuplicateNodeException If the the account already exists.
138      * @throws FileManagerServiceException If a problem occurs when handling the request.
139      * @throws RemoteException If the WebService call fails.
140      *
141      */
142     public FileProperty[] addAccount(String account)
143         throws
144             RemoteException,
145             DuplicateNodeException,
146             FileManagerServiceException;
147 
148     /***
149      * Get the root node for an account
150      * @param account The identifier of the account.
151      * @return An array of properties for the account node.
152      * @throws NodeNotFoundException If the node does not exist.
153      * @throws FileManagerServiceException If a problem occurs when handling the request.
154      * @throws RemoteException If the WebService call fails.
155      *
156      */
157     public FileProperty[] getAccount(String account)
158         throws
159             RemoteException,
160             NodeNotFoundException,
161             FileManagerServiceException;
162 
163     /***
164      * Get a specific node, indexed by ivorn identifier.
165      * @param ivorn The node (ivorn) identifier.
166      * @return The node specified by the identifier.
167      * @throws NodeNotFoundException If the node does not exist.
168      * @throws FileManagerServiceException If a problem occurs when handling the request.
169      * @throws RemoteException If the WebService call fails.
170      * @todo Refactor this as getNode(ivorn, [path])
171      *
172      */
173     public FileProperty[] getNode(String ivorn)
174         throws
175             RemoteException,
176             NodeNotFoundException,
177             FileManagerServiceException;
178 
179     /***
180      * Refresh the properties for a node, indexed by ivorn identifier.
181      * If this node has stored data, this will trigger a call to the FileStore to update the data properties.
182      * @param ivorn The node (ivorn) identifier.
183      * @return The node properties.
184      * @throws NodeNotFoundException If the node does not exist.
185      * @throws FileManagerServiceException If a problem occurs when handling the request.
186      * @throws RemoteException If the WebService call fails.
187      *
188      */
189     public FileProperty[] refresh(String ivorn)
190         throws
191             RemoteException,
192             NodeNotFoundException,
193             FileManagerServiceException;
194 
195     /***
196      * Get a specific child node, indexed by path.
197      * @param ivorn The parent node (ivorn) identifier.
198      * @param path  The target node path, from the parent node.
199      * @return The node specified by the parent and path.
200      * @throws NodeNotFoundException If the node does not exist.
201      * @throws FileManagerServiceException If a problem occurs when handling the request.
202      * @throws RemoteException If the WebService call fails.
203      * @todo Refactor this as getNode(ivorn, [path])
204      *
205      */
206     public FileProperty[] getChild(String ivorn, String path)
207         throws
208             RemoteException,
209             NodeNotFoundException,
210             FileManagerServiceException;
211 
212     /***
213      * Add a new child node.
214      * @param ivorn The (ivorn) identifier of the parent node.
215      * @param path  The new node name (and path).
216      * @param type  The new node type.
217      * @return The new node.
218      * @throws DuplicateNodeException If a node with the same name already exists.
219      * @throws NodeNotFoundException If the parent node does not exist.
220      * @throws FileManagerServiceException If a problem occurs when handling the request.
221      * @throws RemoteException If the WebService call fails.
222      *
223      */
224     public FileProperty[] addNode(String ivorn, String path, String type)
225         throws
226             RemoteException,
227             DuplicateNodeException,
228             NodeNotFoundException,
229             FileManagerServiceException;
230 
231     /***
232      * Get a list of the children of a specific node.
233      * @param ivorn The parent node (ivorn) identifier.
234      * @return An array of ivorn(s) for the child node(s).
235      * @throws NodeNotFoundException If the parent node does not exist.
236      * @throws FileManagerServiceException If a problem occurs when handling the request.
237      * @throws RemoteException If the WebService call fails.
238      * @todo Refactor this to listNodes(ivorn, [path])
239      *
240      */
241     public String[] getChildren(String ivorn)
242         throws
243             RemoteException,
244             NodeNotFoundException,
245             FileManagerServiceException;
246 
247     /***
248      * Initialise a data transfer into a FileStore.
249      * @param request The request properties.
250      * @throws NodeNotFoundException If the target node does not exist.
251      * @throws FileManagerServiceException If a problem occurs when handling the request.
252      * @throws RemoteException If the WebService call fails.
253      * @todo Refactor this to handle path, and create missing folders.
254      *
255      */
256     public TransferProperties importInit(FileProperty[] request)
257         throws
258             RemoteException,
259             NodeNotFoundException,
260             FileManagerServiceException;
261 
262     /***
263      * Initialise a data transfer from a FileStore.
264      * This calls the FileStore to request the HTTP (GET) URL to read the data from the FileStore.
265      * @param request The request properties.
266      * @throws NodeNotFoundException If the target node does not exist.
267      * @throws FileManagerServiceException If a problem occurs when handling the request.
268      * @throws RemoteException If the WebService call fails.
269      *
270      */
271     public TransferProperties exportInit(FileProperty[] request)
272         throws
273             RemoteException,
274             NodeNotFoundException,
275             FileManagerServiceException;
276 
277     /***
278      * Transfer data from a source URL into a node.
279      * @param request The transfer request properties.
280      * @return The updated file properties for the node, after the transfer.
281      * @throws NodeNotFoundException If the target node does not exist.
282      * @throws FileManagerServiceException If a problem occurs when handling the request.
283      * @throws RemoteException If the WebService call fails.
284      * @todo Refactor this to handle path, and create missing folders.
285      *
286      */
287     public FileProperty[] importData(TransferProperties request)
288         throws
289             RemoteException,
290             NodeNotFoundException,
291             FileManagerServiceException;
292 
293     /***
294      * Transfer data transfer from a node into destination URL.
295      * @param request The request properties.
296      * @throws NodeNotFoundException If the target node does not exist.
297      * @throws FileManagerServiceException If a problem occurs when handling the request.
298      * @throws RemoteException If the WebService call fails.
299      *
300      */
301     public TransferProperties exportData(FileProperty[] request)
302         throws
303             RemoteException,
304             NodeNotFoundException,
305             FileManagerServiceException;
306 
307     /***
308      * Move a node to a new location.
309      * If the node already has stored data, then this may involve transfering the data to a new location.
310      * @param  request The request properties.
311      * @return A new set of properties for the node.
312      * @throws DuplicateNodeException If a node with the same name already exists in the metadata tree.
313      * @throws NodeNotFoundException If the current node is no longer in the database.
314      * @throws NodeNotFoundException If the new parent node is no longer in the database.
315      * @throws FileManagerServiceException If a problem occurs when handling the request.
316      * @throws RemoteException If the WebService call fails.
317      *
318      */
319     public FileProperty[] move(FileProperty[] request)
320         throws
321             RemoteException,
322             NodeNotFoundException,
323             DuplicateNodeException,
324             FileManagerServiceException;
325 
326     /***
327      * Create a copy of a node.
328      * If the node already has stored data, then this will create a new copy of the data.
329      * @param  request The request properties.
330      * @return A set of properties for the new node.
331      * @throws DuplicateNodeException If a node with the same name already exists in the metadata tree.
332      * @throws NodeNotFoundException If the current node is no longer in the database.
333      * @throws NodeNotFoundException If the new parent node is no longer in the database.
334      * @throws FileManagerServiceException If a problem occurs when handling the request.
335      * @throws RemoteException If the WebService call fails.
336      *
337      */
338     public FileProperty[] copy(FileProperty[] request)
339         throws
340             RemoteException,
341             NodeNotFoundException,
342             DuplicateNodeException,
343             FileManagerServiceException;
344 
345     /***
346      * Delete a node.
347      * @param ivorn The node (ivorn) identifier.
348      * @throws NodeNotFoundException If the node does not exist.
349      * @throws FileManagerServiceException If a problem occurs when handling the request.
350      * @throws RemoteException If the WebService call fails.
351      * @todo Refactor this to take an ivorn.
352      *
353      */
354     public void delete(String ivorn)
355         throws
356             RemoteException,
357             NodeNotFoundException,
358             FileManagerServiceException;
359 
360     }