net.logAnalyzer.config
Class ConfigurationManager

java.lang.Object
  extended bynet.logAnalyzer.config.ConfigurationManager

public class ConfigurationManager
extends java.lang.Object

This class contains the current configuration :

Version:
0.1
Author:
Karim REFEYTON

Constructor Summary
protected ConfigurationManager(java.util.Hashtable patternsDef, java.util.Hashtable convertersDef, java.util.Hashtable analyzersDef, java.util.Hashtable renderersDef, java.util.Hashtable viewsDef)
          Default constructor.
 
Method Summary
 LAAnalyzer createAnalyzer(java.lang.String name)
          Creates an instance of the analyzer identified by the specified name.
 LAConverter createConverter(java.lang.String key)
          Creates an instance of the converter identified by the specified key.
 LAConverter createConverter(java.lang.String key, java.lang.String option)
          Creates an instance of the converter identified by the specified key and the option.
 LAConverter createLiteralConverter(java.lang.String literal)
          Creates a literal converter instance to use it as a pattern parts separator.
 LAReportRenderer createRenderer(java.lang.String name, LAAnalyzer[] analyzers)
          Creates an instance of the renderer identified by the specified name.
 LAView createView(java.lang.String name)
          Creates an instance of the view identified by the specified name.
 AnalyzerDefinition getAnalyzerDefinition(java.lang.String name)
          Returns the specified analyzer definition.
 java.util.Enumeration getAnalyzersDefinitions()
          Returns the analyzers definitions.
 ConverterDefinition getConverterDefinition(java.lang.String name)
          Returns the specified converter definition.
 java.util.Enumeration getConvertersDefinitions()
          Returns the converters definitions.
static ConfigurationManager getInstance()
          Creates or returns the single instance of the configuration manager.
 java.lang.Class getLiteralClass()
          Returns ths class used to handle literals.
 java.lang.String getPattern(java.lang.String name)
          Returns the pattern string associated to the specified name.
 PatternDefinition getPatternDefinition(java.lang.String name)
          Returns the specified pattern definition.
 java.util.Enumeration getPatternsDefinitions()
          Returns the patterns definitions.
 RendererDefinition getRendererDefinition(java.lang.String name)
          Returns the specified renderer definition.
 java.util.Enumeration getRenderersDefinitions()
          Returns the renderers definitions.
 ViewDefinition getViewsDefinition(java.lang.String name)
          Returns the specified view definition.
 java.util.Enumeration getViewsDefinitions()
          Returns the views definitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationManager

protected ConfigurationManager(java.util.Hashtable patternsDef,
                               java.util.Hashtable convertersDef,
                               java.util.Hashtable analyzersDef,
                               java.util.Hashtable renderersDef,
                               java.util.Hashtable viewsDef)
Default constructor.

Parameters:
patternsDef - Patterns definitions.
convertersDef - Converters definitions.
analyzersDef - Analyzers definitions.
renderersDef - Renderers definitions.
viewsDef - View definitions.
Method Detail

getInstance

public static ConfigurationManager getInstance()
Creates or returns the single instance of the configuration manager.

Returns:
Singleton.

createAnalyzer

public final LAAnalyzer createAnalyzer(java.lang.String name)
                                throws PatternParsingException
Creates an instance of the analyzer identified by the specified name.

Parameters:
name - Name of the analyzer.
Returns:
Instance of the analyzer.
Throws:
PatternParsingException - If unknown analyzer.

getAnalyzerDefinition

public final AnalyzerDefinition getAnalyzerDefinition(java.lang.String name)
Returns the specified analyzer definition.

Parameters:
name - Name of the analyzer to retreive.
Returns:
Analyzer definition; null if unknown.

getAnalyzersDefinitions

public final java.util.Enumeration getAnalyzersDefinitions()
Returns the analyzers definitions.

Returns:
Analyzers definitions.

createConverter

public final LAConverter createConverter(java.lang.String key)
                                  throws PatternParsingException
Creates an instance of the converter identified by the specified key. I

Parameters:
key - Key of the converter in the Log4J pattern.
Returns:
Instance of the converter.
Throws:
PatternParsingException - If unknown converter.

createConverter

public final LAConverter createConverter(java.lang.String key,
                                         java.lang.String option)
                                  throws PatternParsingException
Creates an instance of the converter identified by the specified key and the option. Tries to found the group identified py the specified char and a grouped converter identified by the option. If not found, creates a basic converter.

Parameters:
key - Key of the converter in the Log4J pattern.
option - Option of the converter, or grouped converter.
Returns:
Instance of the converter.
Throws:
PatternParsingException - If unknown converter.

createLiteralConverter

public final LAConverter createLiteralConverter(java.lang.String literal)
                                         throws PatternParsingException
Creates a literal converter instance to use it as a pattern parts separator.

Parameters:
literal - Literal for which to create a new converter.
Returns:
Instance of the converter.
Throws:
PatternParsingException - If a parsing error occures.

getLiteralClass

public final java.lang.Class getLiteralClass()
                                      throws PatternParsingException
Returns ths class used to handle literals.

Returns:
Literals converter class.
Throws:
PatternParsingException - If a parsing error occures.

getConverterDefinition

public final ConverterDefinition getConverterDefinition(java.lang.String name)
Returns the specified converter definition.

Parameters:
name - Name of the converter to retrieve.
Returns:
Converter definition; null if unknown.

getConvertersDefinitions

public final java.util.Enumeration getConvertersDefinitions()
Returns the converters definitions.

Returns:
Converters definitions.

getPattern

public final java.lang.String getPattern(java.lang.String name)
                                  throws PatternParsingException
Returns the pattern string associated to the specified name.

Parameters:
name - Pattern name.
Returns:
Pattern string; null if unknown.
Throws:
PatternParsingException - If unknown pattern.

getPatternDefinition

public final PatternDefinition getPatternDefinition(java.lang.String name)
Returns the specified pattern definition.

Parameters:
name - Name of the pattern to retrieve.
Returns:
Pattern definition; null if unknown.

getPatternsDefinitions

public final java.util.Enumeration getPatternsDefinitions()
Returns the patterns definitions.

Returns:
Patterns definitions.

createRenderer

public final LAReportRenderer createRenderer(java.lang.String name,
                                             LAAnalyzer[] analyzers)
                                      throws PatternParsingException
Creates an instance of the renderer identified by the specified name.

Parameters:
name - Name of the renderer.
analyzers - Analyzers to render.
Returns:
Instance of the renderer.
Throws:
PatternParsingException - If unknown renderer.

getRendererDefinition

public final RendererDefinition getRendererDefinition(java.lang.String name)
Returns the specified renderer definition.

Parameters:
name - Name of the renderer to retrieve.
Returns:
Renderer definition; null if unknown.

getRenderersDefinitions

public final java.util.Enumeration getRenderersDefinitions()
Returns the renderers definitions.

Returns:
Renderers definitions.

createView

public final LAView createView(java.lang.String name)
                        throws PatternParsingException
Creates an instance of the view identified by the specified name.

Parameters:
name - Name of the view.
Returns:
Instance of the view.
Throws:
PatternParsingException - If unknown renderer.

getViewsDefinition

public final ViewDefinition getViewsDefinition(java.lang.String name)
Returns the specified view definition.

Parameters:
name - Name of the view to retrieve.
Returns:
View definition; null if unknown.

getViewsDefinitions

public final java.util.Enumeration getViewsDefinitions()
Returns the views definitions.

Returns:
Views definitions.


Copyright © 2006 null. All Rights Reserved.