1 /** 2 * Copyright (C) 2001-2003 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 package org.objectweb.util.monolog.api; 20 21 /** 22 * It manages Level instances. 23 * 24 * @author Sebastien Chassande-Barrioz 25 */ 26 public interface LevelFactory { 27 28 /** 29 * It defines a new Level with a name and an integer value. 30 * @param name is the name of the new level 31 * @param value is the integer value of the new level 32 * @return a Level instance or a null value if It exists a Level with the 33 * same name but with another integer value. 34 */ 35 Level defineLevel(String name, int value); 36 37 /** 38 * It defines a new Level with a name and a string value. The string value 39 * is analyzed to obtain the integer value. 40 * @param name is the name of the new level 41 * @param value is the string value of the new level 42 * @return a Level instance or a null value if It exists a Level with the 43 * same name but with another integer value. 44 */ 45 Level defineLevel(String name, String value); 46 47 /** 48 * It retrieves a Level instance which the name is equals to the parameter. 49 * @param name is the name of request Level 50 * @return a Leve instance or a null value if the level does not exist. 51 */ 52 Level getLevel(String name); 53 54 /** 55 * It retrieves a Level instance which the integer value is equals to the 56 * parameter. 57 * @param value is the integer value of request Level 58 * @return a Leve instance or a null value if the level does not exist. As 59 * it is possible to define several Levels which have the same integer value 60 * this methods returns the Level instance of first name found in the list. 61 */ 62 Level getLevel(int value); 63 64 /** 65 * It retrieves all Level instances defined in this manager. 66 */ 67 Level[] getLevels(); 68 69 /** 70 * It removes a Level instance to this manager. 71 */ 72 void removeLevel(String name); 73 74 } 75