View Javadoc

1   /*
2    * $Id: SourceIdentifier.java,v 1.3 2005/01/26 17:31:57 mch Exp $
3    *
4    * (C) Copyright Astrogrid...
5    */
6   
7   package org.astrogrid.slinger.sources;
8   
9   
10  import java.io.IOException;
11  import java.io.InputStream;
12  import java.io.Reader;
13  import java.security.Principal;
14  
15  /***
16   * Indicates anything that can be resolved into an inputstream, or an input reader
17   * <p>
18   * Essentially TargetIndicators provide a suitably typed and validated way of
19   * passing around where things might come from, rather than having to pass around
20   * Strings to indicate Identifiers, and separate methods to handle Readers/Streams.
21   *
22   */
23  
24  public interface SourceIdentifier  {
25  
26  
27     /*** All targets must be able to resolve to a reader. The user is required
28      * for permissions */
29     public Reader resolveReader(Principal user) throws IOException;
30     
31     /*** All targets must be able to resolve to a stream.  The user is required
32      * for permissioning. */
33     public InputStream resolveInputStream(Principal user) throws IOException;
34     
35     /*** Used to get the mime type of the data about to be read.  Note that many
36      * implementations (such as disk files?) do not have this
37      * capability, and so often this will
38      * do nothing. */
39     public String getMimeType(Principal user) throws IOException;
40  }
41  /*
42   $Log: SourceIdentifier.java,v $
43   Revision 1.3  2005/01/26 17:31:57  mch
44   Split slinger out to scapi, swib, etc.
45  
46   Revision 1.1.2.2  2004/12/03 11:50:19  mch
47   renamed Msrl etc to separate from storeclient ones.  Prepared for SRB
48  
49   Revision 1.1.2.1  2004/11/22 00:46:28  mch
50   New Slinger Package
51  
52   */
53  
54  
55