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 package org.astrogrid.filestore.common ;
72
73 import java.rmi.Remote ;
74 import java.rmi.RemoteException ;
75
76 import org.astrogrid.filestore.common.file.FileProperty ;
77 import org.astrogrid.filestore.common.transfer.TransferProperties ;
78 import org.astrogrid.filestore.common.exception.FileStoreException ;
79 import org.astrogrid.filestore.common.exception.FileStoreNotFoundException ;
80 import org.astrogrid.filestore.common.exception.FileStoreIdentifierException ;
81 import org.astrogrid.filestore.common.exception.FileStoreServiceException ;
82 import org.astrogrid.filestore.common.exception.FileStoreTransferException ;
83
84 /***
85 * Public interface for the file store service.
86 *
87 */
88 public interface FileStore
89 extends java.rmi.Remote
90 {
91 /***
92 * Get the service identifier - used for testing.
93 * @return The ivo identifier for this service.
94 * @throws FileStoreServiceException If there is an error in the service.
95 * @throws FileStoreServiceException if unable handle the request.
96 * @throws RemoteException If the WebService call fails.
97 *
98 */
99 public String identifier()
100 throws RemoteException, FileStoreServiceException, FileStoreServiceException ;
101
102 /***
103 * Import (store) a string of data.
104 * @param properties An array of FileProperties describing the imported data.
105 * @param data The string of data to store.
106 * @return An array of FileProperties describing the imported data.
107 * @throws FileStoreException if the data string is null.
108 * @throws FileStoreServiceException if unable handle the request.
109 * @throws RemoteException If the WebService call fails.
110 *
111 */
112 public FileProperty[] importString(FileProperty[] properties, String data)
113 throws RemoteException, FileStoreServiceException, FileStoreException ;
114
115 /***
116 * Import (store) a byte array of data.
117 * @param properties An array of FileProperties describing the imported data.
118 * @param data The byte array of data to store.
119 * @return An array of FileProperties describing the imported data.
120 * @throws FileStoreException if the data string is null.
121 * @throws FileStoreServiceException if unable handle the request.
122 * @throws RemoteException If the WebService call fails.
123 *
124 */
125 public FileProperty[] importBytes(FileProperty[] properties, byte[] data)
126 throws RemoteException, FileStoreServiceException, FileStoreException ;
127
128 /***
129 * Append a string to existing file.
130 * @param ident The internal identifier of the target.
131 * @param data The string to append.
132 * @return An array of FileProperties describing the imported data.
133 * @throws FileStoreIdentifierException if the identifier is null or not valid.
134 * @throws FileStoreNotFoundException if unable to locate the file.
135 * @throws FileStoreException if the string is null.
136 * @throws FileStoreServiceException if unable handle the request.
137 * @throws RemoteException If the WebService call fails.
138 *
139 */
140 public FileProperty[] appendString(String ident, String data)
141 throws RemoteException, FileStoreServiceException, FileStoreIdentifierException, FileStoreNotFoundException, FileStoreException ;
142
143 /***
144 * Append an array of bytes to existing data.
145 * @param ident The internal identifier of the target.
146 * @param data The bytes to append.
147 * @return An array of FileProperties describing the imported data.
148 * @throws FileStoreIdentifierException if the identifier is null or not valid.
149 * @throws FileStoreNotFoundException if unable to locate the file.
150 * @throws FileStoreException if the array is null.
151 * @throws FileStoreServiceException if unable handle the request.
152 * @throws RemoteException If the WebService call fails.
153 *
154 */
155 public FileProperty[] appendBytes(String ident, byte[] data)
156 throws RemoteException, FileStoreServiceException, FileStoreIdentifierException, FileStoreNotFoundException, FileStoreException ;
157
158 /***
159 * Export (read) the contents of a file as a string.
160 * @param ident The internal identifier of the target file.
161 * @return The contents of a data object as a string.
162 * @throws FileStoreIdentifierException if the identifier is null or not valid.
163 * @throws FileStoreNotFoundException if unable to locate the file.
164 * @throws FileStoreServiceException if unable handle the request.
165 * @throws RemoteException If the WebService call fails.
166 *
167 */
168 public String exportString(String ident)
169 throws RemoteException, FileStoreServiceException, FileStoreIdentifierException, FileStoreNotFoundException ;
170
171 /***
172 * Export (read) the contents of a file as an array of bytes.
173 * @param ident The internal identifier of the target file.
174 * @return The contents of a data object as a string.
175 * @throws FileStoreIdentifierException if the identifier is null or not valid.
176 * @throws FileStoreNotFoundException if unable to locate the file.
177 * @throws FileStoreServiceException if unable handle the request.
178 * @throws RemoteException If the WebService call fails.
179 *
180 */
181 public byte[] exportBytes(String ident)
182 throws RemoteException, FileStoreServiceException, FileStoreIdentifierException, FileStoreNotFoundException ;
183
184 /***
185 * Create a local duplicate (copy) of a file.
186 * @param ident The internal identifier of the target file.
187 * @param properties An optional array of FileProperties describing the copy.
188 * @return An array of FileProperties describing the copied data.
189 * @throws FileStoreTransferException if unable to transfer the data.
190 * @throws FileStoreIdentifierException if the identifier is null or not valid.
191 * @throws FileStoreNotFoundException if unable to locate the file.
192 * @throws FileStoreServiceException if unable handle the request.
193 * @throws RemoteException If the WebService call fails.
194 *
195 */
196 public FileProperty[] duplicate(String ident, FileProperty[] properties)
197 throws RemoteException, FileStoreServiceException, FileStoreIdentifierException, FileStoreNotFoundException, FileStoreTransferException ;
198
199 /***
200 * Delete a file.
201 * @param ident The internal identifier of the target file.
202 * @return An array of FileProperties describing the deleted data.
203 * @throws FileStoreIdentifierException if the identifier is null or not valid.
204 * @throws FileStoreNotFoundException if unable to locate the file.
205 * @throws FileStoreServiceException if unable handle the request.
206 * @throws RemoteException If the WebService call fails.
207 *
208 */
209 public FileProperty[] delete(String ident)
210 throws RemoteException, FileStoreServiceException, FileStoreIdentifierException, FileStoreNotFoundException ;
211
212 /***
213 * Get the local meta data information for a file.
214 * @param ident The internal identifier of the target file.
215 * @return An array of FileProperties describing the data.
216 * @throws FileStoreIdentifierException if the identifier is null or not valid.
217 * @throws FileStoreNotFoundException if unable to locate the file.
218 * @throws FileStoreServiceException if unable handle the request.
219 * @throws RemoteException If the WebService call fails.
220 *
221 */
222 public FileProperty[] properties(String ident)
223 throws RemoteException, FileStoreServiceException, FileStoreIdentifierException, FileStoreNotFoundException ;
224
225 /***
226 * Prepare to receive a file from a remote source.
227 * @param transfer A TransferProperties object describing the transfer.
228 * @return A new TransferProperties describing the transfer.
229 * @throws FileStoreTransferException If the input transfer properties are not valid.
230 * @throws FileStoreServiceException if unable handle the request.
231 * @throws RemoteException If the WebService call fails.
232 *
233 */
234 public TransferProperties importInit(TransferProperties transfer)
235 throws RemoteException, FileStoreServiceException, FileStoreTransferException ;
236
237 /***
238 * Import a file from a remote source.
239 * @param transfer A TransferProperties object describing the transfer.
240 * @return A new TransferProperties describing the transfer.
241 * @throws FileStoreTransferException if the transfer properties are null.
242 * @throws FileStoreServiceException if unable handle the request.
243 * @throws RemoteException If the WebService call fails.
244 *
245 */
246 public TransferProperties importData(TransferProperties transfer)
247 throws RemoteException, FileStoreTransferException, FileStoreServiceException ;
248
249 /***
250 * Prepare to send a file to a remote destination.
251 * @param transfer A TransferProperties object describing the transfer.
252 * @return A new TransferProperties describing the transfer.
253 * @throws FileStoreTransferException if the transfer properties are null.
254 * @throws FileStoreNotFoundException If unable to locate the target object.
255 * @throws FileStoreServiceException if unable handle the request.
256 * @throws RemoteException If the WebService call fails.
257 *
258 */
259 public TransferProperties exportInit(TransferProperties transfer)
260 throws RemoteException, FileStoreNotFoundException, FileStoreTransferException, FileStoreServiceException ;
261
262 /***
263 * Export a file to a remote destination.
264 * @param transfer A TransferProperties object describing the transfer.
265 * @return A new TransferProperties describing the transfer.
266 * @throws FileStoreServiceException if unable handle the request.
267 * @throws RemoteException If the WebService call fails.
268 *
269 */
270 public TransferProperties exportData(TransferProperties transfer)
271 throws RemoteException, FileStoreServiceException ;
272
273 /***
274 * Throw a FileStoreIdentifierException, useful for debugging the transfer of Exceptions via SOAP.
275 * @throws FileStoreIdentifierException as requested.
276 * @throws FileStoreServiceException if the service was unable to handle the request.
277 * @throws RemoteException If the WebService call fails.
278 *
279 */
280 public void throwIdentifierException()
281 throws RemoteException, FileStoreIdentifierException, FileStoreServiceException ;
282
283
284 }
285