KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > monolog > wrapper > remote > api > MonologFactoryProxy


1 /**
2  * Copyright (C) 2001-2004 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 /**
19  * Copyright (C) 2001-2005 France Telecom R&D
20  *
21  * This library is free software; you can redistribute it and/or
22  * modify it under the terms of the GNU Lesser General Public
23  * License as published by the Free Software Foundation; either
24  * version 2 of the License, or (at your option) any later version.
25  *
26  * This library is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29  * Lesser General Public License for more details.
30  *
31  * You should have received a copy of the GNU Lesser General Public
32  * License along with this library; if not, write to the Free Software
33  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34  */

35 package org.objectweb.util.monolog.wrapper.remote.api;
36
37 import org.objectweb.util.monolog.api.Level;
38
39 import java.rmi.RemoteException JavaDoc;
40 import java.util.Map JavaDoc;
41 import java.util.Properties JavaDoc;
42
43 /**
44  * Defines a MBean for managing the 3 Monolog concepts: Logger, Handler and
45  * Level
46  *
47  * @see org.objectweb.util.monolog.wrapper.remote.api.LoggerInfo
48  * @author S.Chassande-Barrioz
49  */

50 public interface MonologFactoryProxy {
51
52     /**
53      * It defines a new Level with a name and an integer value.
54      * @param name is the name of the new level
55      * @param value is the integer value of the new level
56      * @return true if the level has been created.
57      */

58     boolean defineLevel(String JavaDoc name, int value) throws RemoteException JavaDoc;
59
60     /**
61      * It defines a new Level with a name and a string value. The string value
62      * is analyzed to obtain the integer value.
63      * @param name is the name of the new level
64      * @param value is the string value of the new level
65      * @return true if the level has been created.
66      */

67     boolean defineLevel(String JavaDoc name, String JavaDoc value) throws RemoteException JavaDoc;
68
69     /**
70      * It removes a Level instance to this manager.
71      */

72     void removeLevel(String JavaDoc name) throws RemoteException JavaDoc;
73
74     /**
75      * It retrieves a Level instance which the name is equals to the parameter.
76      * @param name is the name of request Level
77      * @return a Leve instance or a null value if the level does not exist.
78      */

79     Level getLevel(String JavaDoc name) throws RemoteException JavaDoc;
80
81     /**
82      * It retrieves a Level instance which the integer value is equals to the
83      * parameter.
84      * @param value is the integer value of request Level
85      * @return a Leve instance or a null value if the level does not exist. As
86      * it is possible to define several Levels which have the same integer value
87      * this methods returns the Level instance of first name found in the list.
88      */

89     Level getLevel(int value) throws RemoteException JavaDoc;
90
91     /**
92      * It retrieves all Level instances defined in this manager.
93      */

94     Level[] getLevels() throws RemoteException JavaDoc;
95
96     /**
97      * Compares two levels.
98      * @param levelname1 is the name of the first level
99      * @param levelname2 is the name of the second level
100      * @returns a
101      * negative integer, zero, or a positive integer as the first level is less than,
102      * equal to, or greater than the second level.
103      */

104     int compareTo(String JavaDoc levelname1, String JavaDoc levelname2) throws RemoteException JavaDoc;
105
106     /**
107      * Creates a new handler
108      * @param hn is the name of the handler to create
109      * @param handlertype is the type of the parameter. The possible value are
110      * defined in this interface by the XXX_HANDLER_TYPE constants.
111      * @return true if the handler has been created
112      */

113     boolean createHandler(String JavaDoc hn, String JavaDoc handlertype) throws RemoteException JavaDoc;
114
115     /**
116      * It removes the handler which the name is specified by the parameter
117      * @param handlername is the name of the handler
118      * @return true if the handler has been removed.
119      */

120     boolean removeHandler(String JavaDoc handlername) throws RemoteException JavaDoc;
121
122     /**
123      * It retrieves name of all handler managed by this factory.
124      */

125     String JavaDoc[] getHandlerNames() throws RemoteException JavaDoc;
126
127     /**
128      * It retrieves the attributes of an handler
129      * @param handlername is the name of the handler
130      * @return a map containing the association between an attribute name
131      * (String) and an attribute value (String).
132      */

133     Map JavaDoc getHandlerAttributes(String JavaDoc handlername) throws RemoteException JavaDoc;
134
135     /**
136      * It retrieves the attributes of all handlers
137      * @return Map(
138      * String handlername,
139      * Map(String attributename, String attributevalue)
140      * )
141      */

142     Map JavaDoc getAllHandlerAttributes() throws RemoteException JavaDoc;
143     
144     /**
145      * Assignes a value to an handler attribute.
146      * @param handlername is the name of the handler
147      * @param attributeName is the name of the attribute
148      * @param value is the new value of the attribute
149      */

150     void setHandlerAttribute(String JavaDoc handlername,
151             String JavaDoc attributeName,
152             String JavaDoc value) throws RemoteException JavaDoc;
153     
154     
155     /**
156      * Creates a logger if it does not exist.
157      * @param loggername is the name of the logger
158      */

159     LoggerInfo getLogger(String JavaDoc loggername) throws RemoteException JavaDoc;
160     
161     /**
162      * Creates a logger if it does not exist.
163      * @param loggername is the name of the logger
164      * @param resourceBundleName allows specifying the name of a
165      * resource bundle in order to internationalise the logging.
166      */

167     LoggerInfo getLogger(String JavaDoc key, String JavaDoc resourceBundleName) throws RemoteException JavaDoc;
168     
169     /**
170      * Accessors to a resource bundle name associated to a LoggerFactory.
171      */

172     String JavaDoc getResourceBundleName() throws RemoteException JavaDoc;
173     
174     /**
175      * Accessors to a resource bundle name associated to a LoggerFactory.
176      */

177     void setResourceBundleName(String JavaDoc resourceBundleName) throws RemoteException JavaDoc;
178
179     /**
180      * It retrieves a list of all loggers.
181      */

182     LoggerInfo[] getLoggers() throws RemoteException JavaDoc;
183
184     /**
185      * A TopicalLogger manages a list of Handler instances. This method
186      * allows adding a handler to this list. The addHandler method returns
187      * true only if the Handler did not exist
188      */

189     void addHandlerToLogger(String JavaDoc handlerName, String JavaDoc loggerName) throws RemoteException JavaDoc;
190
191     /**
192     * A TopicalLogger manages a list of Handler instances. This method
193     * allows removing a handler to this list.
194     */

195     void removeHandlerFromLogger(String JavaDoc handlerName, String JavaDoc loggerName) throws RemoteException JavaDoc;
196
197     /**
198     * A TopicalLogger manages a list of Handler instances. This method
199     * allows removing all handler.
200     */

201    void removeAllHandlersFromLogger(String JavaDoc loggerName) throws RemoteException JavaDoc;
202
203     /**
204      * It assigns the additivity flag for this logger instance.
205      */

206     void setAdditivity(boolean a, String JavaDoc loggerName) throws RemoteException JavaDoc;
207
208     /**
209      * It assigns a level to a logger.
210      * @param level is an int value corresponding to a level
211      * @param loggerName is the name of logger which the level must be set.
212      */

213     void setLoggerLevel(int level, String JavaDoc loggerName) throws RemoteException JavaDoc;
214
215     /**
216      * It assigns a level to a logger. If the level name does not match any
217      * existing level, the level is not set on the logger.
218      * @param level is a string value corresponding to a level defined into the
219      * LevelFactory
220      * @param loggerName is the name of logger which the level must be set.
221      */

222     void setLoggerLevel(String JavaDoc levelName, String JavaDoc loggerName) throws RemoteException JavaDoc;
223
224     /**
225      * This method allows adding a topic to a TopicalLogger. This actions change
226      * the hierarchical structure, but also the list of handlers. The list of handlers
227      * of a TopicalLogger is composed of its handlers and all handlers inherited
228      * from its parents. Adding a topic changes the inherited handlers list.
229      */

230     void addTopicToLogger(String JavaDoc topic, String JavaDoc loggerName) throws RemoteException JavaDoc ;
231
232     /**
233      *This method allows removing a topic to a TopicalLogger. This actions change
234      * the hierarchical structure, but also the list of handlers. The list of handlers
235      * of a TopicalLogger is composed of its handlers and all handlers inherited
236      * from its parents. Removing a topic changes the inherited handlers list.
237      */

238     void removeTopicFromLogger(String JavaDoc topic, String JavaDoc loggerName) throws RemoteException JavaDoc ;
239     
240     /**
241      * Retrieves the properties corresponding to the current configuration.
242      */

243     Properties JavaDoc getMonologProperties() throws RemoteException JavaDoc;
244
245     /**
246      * Configure Monolog with properties.
247      */

248     void setMonologProperties(Properties JavaDoc p) throws RemoteException JavaDoc;
249 }
250
Popular Tags