org.objectweb.util.monolog.wrapper.remote.api
Interface MonologFactoryMBean

All Known Subinterfaces:
LoggingMBean
All Known Implementing Classes:
Logging, MonologFactoryMBeanImpl

public interface MonologFactoryMBean

Defines a MBean for managing the 3 Monolog concepts: Logger, Handler and Level

Author:
S.Chassande-Barrioz
See Also:
LoggerInfo

Method Summary
 void addHandlerToLogger(java.lang.String handlerName, java.lang.String loggerName)
          A TopicalLogger manages a list of Handler instances.
 void addTopicToLogger(java.lang.String topic, java.lang.String loggerName)
          This method allows adding a topic to a TopicalLogger.
 int compareTo(java.lang.String levelname1, java.lang.String levelname2)
          Compares two levels.
 boolean createHandler(java.lang.String hn, java.lang.String handlertype)
          Creates a new handler
 boolean defineLevel(java.lang.String name, int value)
          It defines a new Level with a name and an integer value.
 boolean defineLevel(java.lang.String name, java.lang.String value)
          It defines a new Level with a name and a string value.
 java.util.Map getAllHandlerAttributes()
          It retrieves the attributes of all handlers
 java.util.Map getHandlerAttributes(java.lang.String handlername)
          It retrieves the attributes of an handler
 java.lang.String[] getHandlerNames()
          It retrieves name of all handler managed by this factory.
 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.
 LoggerInfo getLogger(java.lang.String loggername)
          Creates a logger if it does not exist.
 LoggerInfo getLogger(java.lang.String key, java.lang.String resourceBundleName)
          Creates a logger if it does not exist.
 LoggerInfo[] getLoggers()
          It retrieves a list of all loggers.
 java.util.Properties getMonologProperties()
          Retrieves the properties corresponding to the current configuration.
 java.lang.String getResourceBundleName()
          Accessors to a resource bundle name associated to a LoggerFactory.
 void removeAllHandlersFromLogger(java.lang.String loggerName)
          A TopicalLogger manages a list of Handler instances.
 boolean removeHandler(java.lang.String handlername)
          It removes the handler which the name is specified by the parameter
 void removeHandlerFromLogger(java.lang.String handlerName, java.lang.String loggerName)
          A TopicalLogger manages a list of Handler instances.
 void removeLevel(java.lang.String name)
          It removes a Level instance to this manager.
 void removeTopicFromLogger(java.lang.String topic, java.lang.String loggerName)
          This method allows removing a topic to a TopicalLogger.
 void setAdditivity(boolean a, java.lang.String loggerName)
          It assigns the additivity flag for this logger instance.
 void setHandlerAttribute(java.lang.String handlername, java.lang.String attributeName, java.lang.String value)
          Assignes a value to an handler attribute.
 void setLoggerLevel(int level, java.lang.String loggerName)
          It assigns a level to a logger.
 void setLoggerLevel(java.lang.String levelName, java.lang.String loggerName)
          It assigns a level to a logger.
 void setMonologProperties(java.util.Properties p)
          Configure Monolog with properties.
 void setResourceBundleName(java.lang.String resourceBundleName)
          Accessors to a resource bundle name associated to a LoggerFactory.
 

Method Detail

defineLevel

boolean 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:
true if the level has been created.

defineLevel

boolean 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:
true if the level has been created.

removeLevel

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


getLevel

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

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

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


compareTo

int compareTo(java.lang.String levelname1,
              java.lang.String levelname2)
Compares two levels.

Parameters:
levelname1 - is the name of the first level
levelname2 - is the name of the second level

createHandler

boolean createHandler(java.lang.String hn,
                      java.lang.String handlertype)
Creates a new handler

Parameters:
hn - is the name of the handler to create
handlertype - is the type of the parameter. The possible value are defined in this interface by the XXX_HANDLER_TYPE constants.
Returns:
true if the handler has been created

removeHandler

boolean removeHandler(java.lang.String handlername)
It removes the handler which the name is specified by the parameter

Parameters:
handlername - is the name of the handler
Returns:
true if the handler has been removed.

getHandlerNames

java.lang.String[] getHandlerNames()
It retrieves name of all handler managed by this factory.


getHandlerAttributes

java.util.Map getHandlerAttributes(java.lang.String handlername)
It retrieves the attributes of an handler

Parameters:
handlername - is the name of the handler
Returns:
a map containing the association between an attribute name (String) and an attribute value (String).

getAllHandlerAttributes

java.util.Map getAllHandlerAttributes()
It retrieves the attributes of all handlers

Returns:
Map( String handlername, Map(String attributename, String attributevalue) )

setHandlerAttribute

void setHandlerAttribute(java.lang.String handlername,
                         java.lang.String attributeName,
                         java.lang.String value)
Assignes a value to an handler attribute.

Parameters:
handlername - is the name of the handler
attributeName - is the name of the attribute
value - is the new value of the attribute

getLogger

LoggerInfo getLogger(java.lang.String loggername)
Creates a logger if it does not exist.

Parameters:
loggername - is the name of the logger

getLogger

LoggerInfo getLogger(java.lang.String key,
                     java.lang.String resourceBundleName)
Creates a logger if it does not exist.

Parameters:
loggername - is the name of the logger
resourceBundleName - allows specifying the name of a resource bundle in order to internationalise the logging.

getResourceBundleName

java.lang.String getResourceBundleName()
Accessors to a resource bundle name associated to a LoggerFactory.


setResourceBundleName

void setResourceBundleName(java.lang.String resourceBundleName)
Accessors to a resource bundle name associated to a LoggerFactory.


getLoggers

LoggerInfo[] getLoggers()
It retrieves a list of all loggers.


addHandlerToLogger

void addHandlerToLogger(java.lang.String handlerName,
                        java.lang.String loggerName)
A TopicalLogger manages a list of Handler instances. This method allows adding a handler to this list. The addHandler method returns true only if the Handler did not exist


removeHandlerFromLogger

void removeHandlerFromLogger(java.lang.String handlerName,
                             java.lang.String loggerName)
A TopicalLogger manages a list of Handler instances. This method allows removing a handler to this list.


removeAllHandlersFromLogger

void removeAllHandlersFromLogger(java.lang.String loggerName)
A TopicalLogger manages a list of Handler instances. This method allows removing all handler.


setAdditivity

void setAdditivity(boolean a,
                   java.lang.String loggerName)
It assigns the additivity flag for this logger instance.


setLoggerLevel

void setLoggerLevel(int level,
                    java.lang.String loggerName)
It assigns a level to a logger.

Parameters:
level - is an int value corresponding to a level
loggerName - is the name of logger which the level must be set.

setLoggerLevel

void setLoggerLevel(java.lang.String levelName,
                    java.lang.String loggerName)
It assigns a level to a logger. If the level name does not match any existing level, the level is not set on the logger.

Parameters:
level - is a string value corresponding to a level defined into the LevelFactory
loggerName - is the name of logger which the level must be set.

addTopicToLogger

void addTopicToLogger(java.lang.String topic,
                      java.lang.String loggerName)
This method allows adding a topic to a TopicalLogger. This actions change the hierarchical structure, but also the list of handlers. The list of handlers of a TopicalLogger is composed of its handlers and all handlers inherited from its parents. Adding a topic changes the inherited handlers list.


removeTopicFromLogger

void removeTopicFromLogger(java.lang.String topic,
                           java.lang.String loggerName)
This method allows removing a topic to a TopicalLogger. This actions change the hierarchical structure, but also the list of handlers. The list of handlers of a TopicalLogger is composed of its handlers and all handlers inherited from its parents. Removing a topic changes the inherited handlers list.


getMonologProperties

java.util.Properties getMonologProperties()
Retrieves the properties corresponding to the current configuration.


setMonologProperties

void setMonologProperties(java.util.Properties p)
Configure Monolog with properties.