1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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 }