View Javadoc

1   /*
2    * <cvs:source>$Source: /devel/astrogrid/filemanager/common/src/java/org/astrogrid/filemanager/common/FileManagerStore.java,v $</cvs:source>
3    * <cvs:author>$Author: jdt $</cvs:author>
4    * <cvs:date>$Date: 2005/01/13 17:23:15 $</cvs:date>
5    * <cvs:version>$Revision: 1.2 $</cvs:version>
6    * <cvs:log>
7    *   $Log: FileManagerStore.java,v $
8    *   Revision 1.2  2005/01/13 17:23:15  jdt
9    *   merges from dave-dev-200412201250
10   *
11   *   Revision 1.1.2.4  2005/01/12 13:16:27  dave
12   *   Changed tabs to spaces ...
13   *
14   *   Revision 1.1.2.3  2005/01/12 12:40:08  dave
15   *   Added account handling to store ...
16   *
17   *   Revision 1.1.2.2  2005/01/10 21:27:47  dave
18   *   Refactores NodeMock as FileManagerStoreNode ...
19   *
20   *   Revision 1.1.2.1  2005/01/10 15:36:28  dave
21   *   Refactored store into a separate interface and mock impl ...
22   *
23   * </cvs:log>
24   *
25   */
26  package org.astrogrid.filemanager.common ;
27  
28  import org.astrogrid.store.Ivorn ;
29  
30  import org.astrogrid.filemanager.common.exception.NodeNotFoundException ;
31  import org.astrogrid.filemanager.common.exception.DuplicateNodeException ;
32  import org.astrogrid.filemanager.common.exception.FileManagerServiceException ;
33  
34  /*
35   * Public interface for a FileManager data store.
36   *
37   */
38  public interface FileManagerStore
39      {
40      /***
41       * Check if the store contains an account.
42       * @param indent The account identifier.
43       * @return true if the store contains the account.
44       * @throws FileManagerServiceException If a problem occurs when handling the request.
45       *
46       */
47      public boolean hasAccount(String ident)
48          throws FileManagerServiceException;
49  
50      /***
51       * Add a new account to our store.
52       * @param ident The account identifier.
53       * @param node  The root node for the account.
54       * @return A new root node for the account.
55       * @throws DuplicateNodeException If the the node already exists.
56       * @throws FileManagerServiceException If a problem occurs when handling the request.
57       *
58       */
59      public void addAccount(String ident, FileManagerStoreNode root)
60          throws DuplicateNodeException, FileManagerServiceException ;
61  
62      /***
63       * Get the root node for an account.
64       * @param ident  The account identifier.
65       * @return The root node for the account.
66       * @throws NodeNotFoundException If the account does not exist.
67       * @throws FileManagerServiceException If a problem occurs when handling the request.
68       *
69       */
70      public FileManagerStoreNode getAccount(String ident)
71          throws NodeNotFoundException, FileManagerServiceException ;
72  
73      /***
74       * Remove an account from our store.
75       * @param ident  The account identifier.
76       * @throws NodeNotFoundException If the node does not exist.
77       * @throws FileManagerServiceException If a problem occurs when handling the request.
78       *
79       */
80      public void delAccount(String ident)
81          throws NodeNotFoundException, FileManagerServiceException ;
82  
83      /***
84       * Check if the store contains a node.
85       * @param indent The node identifier.
86       * @return true if the store contains the identifier.
87       * @throws FileManagerServiceException If a problem occurs when handling the request.
88       *
89       */
90      public boolean hasNode(String ident)
91          throws FileManagerServiceException;
92  
93      /***
94       * Add a new node to our store.
95       * @param parent The parent node identifier.
96       * @param ivorn  The node identifier.
97       * @param name   The node name.
98       * @param type   The node type.
99       * @throws DuplicateNodeException If the the node already exists.
100      * @throws FileManagerServiceException If a problem occurs when handling the request.
101      *
102      */
103     public FileManagerStoreNode addNode(Ivorn parent, Ivorn ivorn, String name, String type)
104         throws DuplicateNodeException, FileManagerServiceException ;
105 
106     /***
107      * Get a node, based on the identifier.
108      * @param  ident The node identifier.
109      * @return The matching node.
110      * @throws NodeNotFoundException If the node does not exist.
111      * @throws FileManagerServiceException If a problem occurs when handling the request.
112      *
113      */
114     public FileManagerStoreNode getNode(String ident)
115         throws NodeNotFoundException, FileManagerServiceException ;
116 
117     /***
118      * Remove an existing node from our store.
119      * @param node The node to store.
120      * @throws NodeNotFoundException If the node does not exist.
121      * @throws FileManagerServiceException If a problem occurs when handling the request.
122      *
123      */
124     public void delNode(FileManagerStoreNode node)
125         throws NodeNotFoundException, FileManagerServiceException ;
126 
127     }