org.objectweb.util.monolog.api
Interface LevelFactory

All Known Subinterfaces:
Configurable, MonologFactory
All Known Implementing Classes:
AbstractFactory, BasicFactory, LoggerImpl, MonologComponent, MonologLoggerFactory

public interface LevelFactory

It manages Level instances.

Author:
Sebastien Chassande-Barrioz

Method Summary
 Level defineLevel(java.lang.String name, int value)
          It defines a new Level with a name and an integer value.
 Level defineLevel(java.lang.String name, java.lang.String value)
          It defines a new Level with a name and a string value.
 Level getLevel(int value)
          It retrieves a Level instance which the integer value is equals to the parameter.
 Level getLevel(java.lang.String name)
          It retrieves a Level instance which the name is equals to the parameter.
 Level[] getLevels()
          It retrieves all Level instances defined in this manager.
 void removeLevel(java.lang.String name)
          It removes a Level instance to this manager.
 

Method Detail

defineLevel

public Level defineLevel(java.lang.String name,
                         int value)
It defines a new Level with a name and an integer value.

Parameters:
name - is the name of the new level
value - is the integer value of the new level
Returns:
a Level instance or a null value if It exists a Level with the same name but with another integer value.

defineLevel

public Level defineLevel(java.lang.String name,
                         java.lang.String value)
It defines a new Level with a name and a string value. The string value is analyzed to obtain the integer value.

Parameters:
name - is the name of the new level
value - is the string value of the new level
Returns:
a Level instance or a null value if It exists a Level with the same name but with another integer value.

getLevel

public Level getLevel(java.lang.String name)
It retrieves a Level instance which the name is equals to the parameter.

Parameters:
name - is the name of request Level
Returns:
a Leve instance or a null value if the level does not exist.

getLevel

public Level getLevel(int value)
It retrieves a Level instance which the integer value is equals to the parameter.

Parameters:
value - is the integer value of request Level
Returns:
a Leve instance or a null value if the level does not exist. As it is possible to define several Levels which have the same integer value this methods returns the Level instance of first name found in the list.

getLevels

public Level[] getLevels()
It retrieves all Level instances defined in this manager.


removeLevel

public void removeLevel(java.lang.String name)
It removes a Level instance to this manager.