View Javadoc

1   /*$Id: ExternalValue.java,v 1.4 2004/11/27 13:20:02 pah Exp $
2    * Created on 16-Jun-2004
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
9    *
10  **/
11  package org.astrogrid.applications.parameter.protocol;
12  
13  import java.io.File;
14  import java.io.InputStream;
15  import java.io.OutputStream;
16  
17  /*** Interface for working with a value that is 'external' - ie probably not in this JVM. May be in local storage, may be remote.
18   * <p>
19   * Because of this vagueness, the interface provides the bare minimum for working with the external value.
20   * @TODO rename the methods in this interface so that the imply opening a stream rather than reading and writing...
21   * @TODO add method to copyto local file - to take advantage of any any secialization that the protocol might have to do this...then the paramter adapters should be rewritten to use this. (also exportFrom & getURL)
22   * @TODO would be nice to have a string returning the "location" value also
23   * @author Noel Winstanley nw@jb.man.ac.uk 16-Jun-2004
24   * @author Paul Harrison (pah@jb.man.ac.uk)
25   *
26   */
27  public interface ExternalValue {
28      /*** access a stream to read the contents of the external value from 
29       * @return an input stream containing the content of the external value
30       * @throws InaccessibleExternalValueException*/
31      InputStream read() throws InaccessibleExternalValueException;
32      /*** access a stream to write the contents of the external value to 
33       * @return an output stream.
34       * @throws InaccessibleExternalValueException*/
35      OutputStream write() throws InaccessibleExternalValueException;
36      
37      /***
38       * Copy the contents of the external value to a file. This method can take advantage of any specializations that the protocol might have.
39      * @param f The file to which the contents of the externalValue should be copied.
40      * @return file that it has copied to - this might not be the file requested for efficiencies' sake 
41      * @throws InaccessibleExternalValueException
42     
43     File importTo(File f) throws InaccessibleExternalValueException;
44      */
45  }
46  
47  
48  /* 
49  $Log: ExternalValue.java,v $
50  Revision 1.4  2004/11/27 13:20:02  pah
51  result of merge of pah_cea_bz561 branch
52  
53  Revision 1.3.6.2  2004/11/25 15:36:20  pah
54  another idea in a comment
55  
56  Revision 1.3.6.1  2004/11/04 16:56:13  pah
57  new comment
58  
59  Revision 1.3  2004/09/30 15:12:25  pah
60  comment on future enhancement
61  
62  Revision 1.2  2004/08/24 11:45:00  pah
63  added todo comment
64  
65  Revision 1.1  2004/07/26 12:07:38  nw
66  renamed indirect package to protocol,
67  renamed classes and methods within protocol package
68  javadocs
69  
70  Revision 1.2  2004/07/01 11:16:22  nw
71  merged in branch
72  nww-itn06-componentization
73  
74  Revision 1.1.2.2  2004/07/01 01:42:46  nw
75  final version, before merge
76  
77  Revision 1.1.2.1  2004/06/17 09:21:23  nw
78  finished all major functionality additions to core
79   
80  */