View Javadoc

1   /*
2    * <cvs:source>$Source: /devel/astrogrid/filestore/common/src/java/org/astrogrid/filestore/common/FileStore.java,v $</cvs:source>
3    * <cvs:author>$Author: jdt $</cvs:author>
4    * <cvs:date>$Date: 2004/11/25 00:19:19 $</cvs:date>
5    * <cvs:version>$Revision: 1.7 $</cvs:version>
6    * <cvs:log>
7    *   $Log: FileStore.java,v $
8    *   Revision 1.7  2004/11/25 00:19:19  jdt
9    *   Merge from dave-dev-200410061224-200411221626
10   *
11   *   Revision 1.6.34.2  2004/10/29 15:54:50  dave
12   *   Added exportInit to mock implementation ...
13   *   Added UrlGetRequest to pass into exportInit ...
14   *   Added test for exportInit and UrlGetRequest ...
15   *
16   *   Revision 1.6.34.1  2004/10/21 21:00:13  dave
17   *   Added mock://xyz URL handler to enable testing of transfer.
18   *   Implemented importInit to the mock service and created transfer tests.
19   *
20   *   Revision 1.6  2004/08/27 22:43:15  dave
21   *   Updated filestore and myspace to report file size correctly.
22   *
23   *   Revision 1.5.38.1  2004/08/26 19:06:50  dave
24   *   Modified filestore to return file size in properties.
25   *
26   *   Revision 1.5  2004/07/23 09:11:16  dave
27   *   Merged development branch, dave-dev-200407221513, into HEAD
28   *
29   *   Revision 1.4.6.1  2004/07/23 02:10:58  dave
30   *   Added IvornFactory and IvornParser
31   *
32   *   Revision 1.4  2004/07/21 18:11:55  dave
33   *   Merged development branch, dave-dev-200407201059, into HEAD
34   *
35   *   Revision 1.3.2.1  2004/07/20 19:10:40  dave
36   *   Refactored to implement URL import
37   *
38   *   Revision 1.3  2004/07/19 23:42:07  dave
39   *   Merged development branch, dave-dev-200407151443, into HEAD
40   *
41   *   Revision 1.2.4.1  2004/07/19 19:40:28  dave
42   *   Debugged and worked around Axis Exception handling
43   *
44   *   Revision 1.2  2004/07/14 13:50:29  dave
45   *   Merged development branch, dave-dev-200406301228, into HEAD
46   *
47   *   Revision 1.1.2.7  2004/07/14 10:34:08  dave
48   *   Reafctored server to use array of properties
49   *
50   *   Revision 1.1.2.6  2004/07/13 16:37:29  dave
51   *   Refactored common and client to use an array of FileProperties (more SOAP friendly)
52   *
53   *   Revision 1.1.2.5  2004/07/12 14:39:03  dave
54   *   Added server repository classes
55   *
56   *   Revision 1.1.2.4  2004/07/08 07:31:30  dave
57   *   Added container impl and tests
58   *
59   *   Revision 1.1.2.3  2004/07/07 14:54:35  dave
60   *   Changed DataInfo to File Info (leaves room to use DataInfo for the more abstract VoStore interface).
61   *
62   *   Revision 1.1.2.2  2004/07/06 09:16:12  dave
63   *   Added delegate interface and mock implementation
64   *
65   *   Revision 1.1.2.1  2004/07/05 04:50:29  dave
66   *   Created initial FileStore components
67   *
68   * </cvs:log>
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