View Javadoc

1   package org.astrogrid.portal.myspace.acting.framework;
2   
3   import java.io.IOException;
4   import java.io.InputStream;
5   
6   import org.astrogrid.community.User;
7   import org.astrogrid.store.Agsl;
8   import org.astrogrid.store.delegate.StoreClient;
9   import org.astrogrid.store.delegate.StoreFile;
10  
11  /***
12   * Wraps the environment context for use by <code>MySpaceHandler</code>
13   * implementations.
14   * 
15   * @author peter.shillan
16   * @see org.astrogrid.portal.myspace.acting.framework.MySpaceHandler
17   */
18  public interface ContextWrapper {
19    public static final String PARAM_PROTOCOL = "myspace-context-protocol";
20    public static final String PARAM_END_POINT = "myspace-end-point";
21  
22    public static final String DEFAULT_PARAM_PROTOCOL = "none";
23    public static final String DEFAULT_END_POINT = "file://astrogrid-myspace-file";
24  
25    /***
26     * Return a named parameter.
27     * 
28     * @param param parameter name
29     * @return value of named parameter
30     */
31    public String getParameter(String param);
32  
33    /***
34     * Return a named parameter or the default value.
35     * 
36     * @param param parameter name
37     * @return value of named parameter or default value
38     */
39    public String getParameter(String param, String defaultValue);
40  
41    /***
42     * Return the current user.
43     * 
44     * @return current user
45     */
46    public User getUser();
47  
48    /***
49     * Return the AstroGrid storage location.
50     * 
51     * @return AstroGrid storage location
52     * @throws IOException
53     */
54    public Agsl getAgsl() throws IOException;
55  
56    /***
57     * Return the AstroGrid storage client.
58     * 
59     * @return AstroGrid storage client
60     */
61    public StoreClient getStoreClient();
62  
63    /***
64     * Set an attribute for global use.
65     * 
66     * @param attribute attribute name
67     * @param value attribute value
68     */
69    public void setGlobalAttribute(String attribute, Object value);
70  
71    /***
72     * Set an attribute for local use.
73     * 
74     * @param attribute attribute name
75     * @param value attribute value
76     */
77    public void setLocalAttribute(String attribute, Object value);
78  
79    /***
80     * Return an <code>InputStream</code> for a given file name.
81     * 
82     * @param fileName file name
83     * @return <code>InputStream</code> for a given file name
84     * @throws Exception
85     */
86    public InputStream getFileInputStream(String fileName) throws Exception;
87    
88    /***
89     * Return the cache of MySpace files for a user.
90     * 
91     * 
92     * @return <code>StoreFile</code> for a user
93     *
94     */
95    public StoreFile getMySpaceCache() ;
96    
97    
98    /***
99     * Set the cache of MySpace files for a user.
100    * 
101    * 
102    */
103   public void setMySpaceCache( StoreFile cache ) ;
104   
105   
106   
107   
108   
109   
110   
111 }