pl.edu.agh.cast.importer.base.logging
Class ImportLoggerPatternLayout

java.lang.Object
  extended by org.apache.log4j.Layout
      extended by org.apache.log4j.PatternLayout
          extended by pl.edu.agh.cast.importer.base.logging.ImportLoggerPatternLayout
All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler

public class ImportLoggerPatternLayout
extends org.apache.log4j.PatternLayout

The layout for the logger files, containing the import process logs, implementing the basic PatternLayout. Overrides the getHeader() method.

Author:
AGH CAST Team

Field Summary
 
Fields inherited from class org.apache.log4j.PatternLayout
BUF_SIZE, DEFAULT_CONVERSION_PATTERN, MAX_CAPACITY, TTCC_CONVERSION_PATTERN
 
Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
ImportLoggerPatternLayout(String importedFilePath, String templateName)
          The constructor for data with single data sheet.
ImportLoggerPatternLayout(String pattern, String importedFilePath, String templateName, String sheetName)
          The default constructor.
 
Method Summary
 String getFooter()
          
 String getHeader()
          
 void setFooterData(int rowsImported, int rowsNotImported, int rowsRemoved, int errors, String dataSet)
          Sets the data for the logger footer.
 
Methods inherited from class org.apache.log4j.PatternLayout
activateOptions, createPatternParser, format, getConversionPattern, ignoresThrowable, setConversionPattern
 
Methods inherited from class org.apache.log4j.Layout
getContentType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportLoggerPatternLayout

public ImportLoggerPatternLayout(String pattern,
                                 String importedFilePath,
                                 String templateName,
                                 String sheetName)
The default constructor.

Parameters:
pattern - the logging pattern
importedFilePath - the path to the imported file
templateName - the template name used by the import operation
sheetName - the name of the sheet for data with multiple sheets

ImportLoggerPatternLayout

public ImportLoggerPatternLayout(String importedFilePath,
                                 String templateName)
The constructor for data with single data sheet.

Parameters:
importedFilePath - the path to the imported file
templateName - the template name used by the import operation
Method Detail

getHeader

public String getHeader()

Overrides:
getHeader in class org.apache.log4j.Layout
See Also:
Layout.getHeader()

getFooter

public String getFooter()

Overrides:
getFooter in class org.apache.log4j.Layout
See Also:
Layout.getFooter()

setFooterData

public void setFooterData(int rowsImported,
                          int rowsNotImported,
                          int rowsRemoved,
                          int errors,
                          String dataSet)
Sets the data for the logger footer.

Parameters:
rowsImported - the number of rows imported
rowsNotImported - the number of rows not imported
rowsRemoved - the number of rows removed
errors - the number of errors
dataSet - the data set name


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.