View Javadoc

1   /*
2    * <cvs:source>$Source: /devel/astrogrid/filemanager/common/src/java/org/astrogrid/filemanager/common/FileManagerStoreNode.java,v $</cvs:source>
3    * <cvs:author>$Author: clq2 $</cvs:author>
4    * <cvs:date>$Date: 2005/01/28 10:43:58 $</cvs:date>
5    * <cvs:version>$Revision: 1.3 $</cvs:version>
6    * <cvs:log>
7    *   $Log: FileManagerStoreNode.java,v $
8    *   Revision 1.3  2005/01/28 10:43:58  clq2
9    *   dave_dev_200501141257 (filemanager)
10   *
11   *   Revision 1.2.2.1  2005/01/15 08:25:20  dave
12   *   Added file create and modify dates to manager and client API ...
13   *
14   *   Revision 1.2  2005/01/13 17:23:15  jdt
15   *   merges from dave-dev-200412201250
16   *
17   *   Revision 1.1.2.2  2005/01/12 13:16:27  dave
18   *   Changed tabs to spaces ...
19   *
20   *   Revision 1.1.2.1  2005/01/10 21:27:47  dave
21   *   Refactores NodeMock as FileManagerStoreNode ...
22   *
23   *   Revision 1.1.2.1  2005/01/10 15:36:28  dave
24   *   Refactored store into a separate interface and mock impl ...
25   *
26   * </cvs:log>
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   * Public interface for a FileManager store node.
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     }