KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > spdm > ManagementNode


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.syncclient.spdm;
20
21 import java.util.Hashtable JavaDoc;
22
23 /**
24  * This interface models a device management node. A management not can be either
25  * a configuration context (a tree element that contains other nodes) or a
26  * configuration node (which instead contains configuration properties).
27  *
28  * @author Fabio Maggi @ Funambol
29  *
30  * @version $Id: ManagementNode.java,v 1.3 2005/03/29 08:16:29 nichele Exp $
31  */

32 public interface ManagementNode {
33
34     /**
35      * Returns the node's context
36      *
37      * @return the node's context
38      */

39     public String JavaDoc getContext();
40
41     /**
42      * Returns the entire node's context path (concatenation of all parent
43      * context paths).
44      *
45      * @return the entire node's context path
46      */

47     public String JavaDoc getFullContext();
48
49     /**
50      * Returns the given config parameter
51      *
52      * @param name the configration parameter name
53      * @return this node value
54      *
55      * @throws DMException in case of errors.
56      */

57     public Object JavaDoc getValue(String JavaDoc name)
58     throws DMException;
59
60
61     /**
62      * @return hashtable of values
63      *
64      * @throws DMException in case of errors.
65      */

66     public Hashtable JavaDoc getValues()
67     throws DMException;
68
69
70     /**
71      * Retrieves a value from the given management subnode name.
72      *
73      * @param node the subnode containing the config value specified by name
74      * @param name the name of the configuration value to return
75      *
76      * @return the node value
77      *
78      * @throws DMException in case of errors.
79      */

80     public Object JavaDoc getNodeValue(String JavaDoc node, String JavaDoc name)
81     throws DMException;
82
83     /**
84      * Retrieves all values in the given management subnode name.
85      *
86      * @param node the subnode containing the required config values
87      *
88      * @return the node values
89      *
90      * @throws DMException in case of errors.
91      */

92     public Hashtable JavaDoc getNodeValues(String JavaDoc node)
93     throws DMException;
94
95    /**
96     * Reads the properties of the given node and creates an object with the
97     * values read.
98     * @param node the subnode containing the required config values
99     * @return the object
100     * @throws DMException in case of errors.
101     */

102     public Object JavaDoc getManagementObject(String JavaDoc node)
103     throws DMException;
104
105     /**
106      * Retrieves the children subnodes of the current node.
107      *
108      * @return an array of <i>ManagementNode</i> containing this node's children
109      *
110      * @throws DMException in case of errors.
111      */

112     public ManagementNode[] getChildren()
113     throws DMException;
114
115     /**
116      * Retrieves the subnode with the given name
117      *
118      * @return context the subnode context (name)
119      *
120      * @throws DMException in case of errors.
121      */

122     public ManagementNode getChildNode(String JavaDoc context)
123     throws DMException;
124
125
126     /**
127      * Retrieves this node's parent.
128      *
129      * @return the node's parent
130      *
131      * @throws DMException in case of errors.
132      */

133     public ManagementNode getParent()
134     throws DMException;
135
136
137     /**
138      * Sets the node value as a whole object.
139      *
140      * @param name the configuration parameter name
141      * @param value the value
142      *
143      * @throws DMException in case of errors.
144      */

145     void setValue(String JavaDoc name, Object JavaDoc value) throws DMException;
146
147
148     /**
149      * Sets a subnode specific value.
150      *
151      * @param node subnode to set
152      * @param name configuration parameter to set
153      * @param value
154      *
155      * @throws DMException in case of errors.
156      */

157     void setValue(String JavaDoc node, String JavaDoc name, Object JavaDoc value) throws DMException;
158
159
160     /**
161      * Remove subnode from configuration three.
162      *
163      * @param node subnode to reomove
164      *
165      * @throws DMException in case of errors.
166      */

167     void removeNode(String JavaDoc node) throws DMException;
168
169
170 }
171
Popular Tags