01: /**
02: * Copyright (C) 2001-2003 France Telecom R&D
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * 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: */package org.objectweb.util.monolog.api;
18:
19: /**
20: * It manages Level instances.
21: *
22: * @author Sebastien Chassande-Barrioz
23: */
24: public interface LevelFactory {
25:
26: /**
27: * It defines a new Level with a name and an integer value.
28: * @param name is the name of the new level
29: * @param value is the integer value of the new level
30: * @return a Level instance or a null value if It exists a Level with the
31: * same name but with another integer value.
32: */
33: Level defineLevel(String name, int value);
34:
35: /**
36: * It defines a new Level with a name and a string value. The string value
37: * is analyzed to obtain the integer value.
38: * @param name is the name of the new level
39: * @param value is the string value of the new level
40: * @return a Level instance or a null value if It exists a Level with the
41: * same name but with another integer value.
42: */
43: Level defineLevel(String name, String value);
44:
45: /**
46: * It retrieves a Level instance which the name is equals to the parameter.
47: * @param name is the name of request Level
48: * @return a Leve instance or a null value if the level does not exist.
49: */
50: Level getLevel(String name);
51:
52: /**
53: * It retrieves a Level instance which the integer value is equals to the
54: * parameter.
55: * @param value is the integer value of request Level
56: * @return a Leve instance or a null value if the level does not exist. As
57: * it is possible to define several Levels which have the same integer value
58: * this methods returns the Level instance of first name found in the list.
59: */
60: Level getLevel(int value);
61:
62: /**
63: * It retrieves all Level instances defined in this manager.
64: */
65: Level[] getLevels();
66:
67: /**
68: * It removes a Level instance to this manager.
69: */
70: void removeLevel(String name);
71:
72: }
|