1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
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 }