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
27
28
29 package org.astrogrid.filemanager.common ;
30
31 import java.util.Collection;
32 import java.util.StringTokenizer ;
33
34 import org.astrogrid.store.Ivorn ;
35
36 import org.astrogrid.filestore.common.file.FileProperty ;
37 import org.astrogrid.filestore.common.file.FileProperties ;
38
39 import org.astrogrid.filemanager.common.exception.NodeNotFoundException ;
40 import org.astrogrid.filemanager.common.exception.DuplicateNodeException ;
41 import org.astrogrid.filemanager.common.exception.FileManagerServiceException ;
42 import org.astrogrid.filemanager.common.exception.FileManagerIdentifierException ;
43
44
45
46
47
48 public interface FileManagerStoreNode
49 {
50
51 /***
52 * Get a Collection of the child nodes.
53 *
54 */
55 public Collection getChildren();
56
57 /***
58 * Add a child node.
59 * @param node The child node to add.
60 * @throws DuplicateNodeException If a node with the same name already exists.
61 *
62 */
63 public void addNode(FileManagerStoreNode node)
64 throws DuplicateNodeException ;
65
66 /***
67 * Remove a child node.
68 * @param name The name of the child node to remove.
69 * @throws NodeNotFoundException If the node does not exist.
70 *
71 */
72 public void delNode(String name)
73 throws NodeNotFoundException ;
74
75 /***
76 * Get a child node, indexed by path/name.
77 * @param path The target node path.
78 * @return The target node.
79 * @throws NodeNotFoundException if the child node does not exist.
80 *
81 */
82 public FileManagerStoreNode getChild(String path)
83 throws NodeNotFoundException ;
84
85 /***
86 * Get a child node, indexed by path/name.
87 * @param tokens A StringTokenizer of the path.
88 * @return The target node.
89 * @throws NodeNotFoundException if the child node does not exist.
90 *
91 */
92 public FileManagerStoreNode getChild(StringTokenizer tokens)
93 throws NodeNotFoundException;
94
95 /***
96 * Public access to the properties.
97 * @return The array of file properties.
98 * @todo Need to make this a clone to prevent changes.
99 *
100 */
101 public FileManagerProperties getProperties();
102
103 /***
104 * Access to our properties.
105 *
106 */
107 public void setProperties(FileProperties properties);
108
109 /***
110 * Access to our properties.
111 *
112 */
113 public void setProperties(FileProperty[] properties);
114
115 /***
116 * Get the node ivorn.
117 *
118 */
119 public Ivorn getIvorn()
120 throws FileManagerIdentifierException;
121
122 /***
123 * Get the node ident.
124 *
125 */
126 public String getIdent();
127
128 /***
129 * Get the parent ivorn.
130 *
131 */
132 public Ivorn getParentIvorn()
133 throws FileManagerIdentifierException;
134
135 /***
136 * Set the parent ivorn.
137 *
138 */
139 public void setParentIvorn(Ivorn ivorn);
140
141 /***
142 * Get the node name.
143 *
144 */
145 public String getName();
146
147 /***
148 * Set the node name.
149 *
150 */
151 public void setName(String name);
152
153 /***
154 * Get the node type.
155 *
156 */
157 public String getType();
158
159 /***
160 * Set the node type.
161 *
162 */
163 public void setType(String type);
164
165 /***
166 * Check if this node is a container.
167 *
168 */
169 public boolean isContainer();
170
171 /***
172 * Check if this node is a data node.
173 *
174 */
175 public boolean isDataNode();
176
177 }