View Javadoc

1   /*
2    * $Id: IRepository.java,v 1.1 2008/10/07 13:09:20 oeuillot Exp $
3    * 
4    */
5   package org.rcfaces.core.internal.repository;
6   
7   import java.io.IOException;
8   import java.io.InputStream;
9   import java.io.Serializable;
10  import java.util.Locale;
11  
12  /**
13   * 
14   * @author Olivier Oeuillot (latest modification by $Author: oeuillot $)
15   * @version $Revision: 1.1 $ $Date: 2008/10/07 13:09:20 $
16   */
17  public interface IRepository extends Serializable {
18  
19      String getVersion();
20  
21      IContext createContext(Locale locale);
22  
23      IFile getFileByName(String filename);
24  
25      IFile getFileByURI(String uri);
26  
27      /**
28       * 
29       * @author Olivier Oeuillot (latest modification by $Author: oeuillot $)
30       * @version $Revision: 1.1 $ $Date: 2008/10/07 13:09:20 $
31       */
32      public interface IFile extends Serializable {
33          IRepository getRepository();
34  
35          IContentProvider getContentProvider();
36  
37          String getFilename();
38  
39          Object[] getContentReferences(Locale locale);
40  
41          String getURI(Locale locale);
42      }
43  
44      /**
45       * 
46       * @author Olivier Oeuillot (latest modification by $Author: oeuillot $)
47       * @version $Revision: 1.1 $ $Date: 2008/10/07 13:09:20 $
48       */
49      public interface IContext {
50          Locale getLocale();
51  
52          boolean contains(IFile file);
53  
54          boolean add(IFile file);
55  
56          IContext copy();
57  
58          Object saveState();
59  
60          void restoreState(IRepository repository, Object state);
61      }
62  
63      /**
64       * 
65       * @author Olivier Oeuillot (latest modification by $Author: oeuillot $)
66       * @version $Revision: 1.1 $ $Date: 2008/10/07 13:09:20 $
67       */
68      public interface IContentProvider {
69          IContent getContent(Object contentReference, Locale locale);
70  
71          Object searchLocalizedContentReference(Object contentReference,
72                  Locale locale);
73      }
74  
75      /**
76       * 
77       * @author Olivier Oeuillot (latest modification by $Author: oeuillot $)
78       * @version $Revision: 1.1 $ $Date: 2008/10/07 13:09:20 $
79       */
80      public interface IContent {
81          InputStream getInputStream() throws IOException;
82  
83          long getLastModified() throws IOException;
84  
85          long getLength() throws IOException;
86  
87          void release();
88      }
89  }