WEB4J Development Tools 4.10.0.0

hirondelle.web4jtools.logview.simpleview
Class LogFileDAO

Object
  extended by hirondelle.web4jtools.logview.simpleview.LogFileDAO

public final class LogFileDAO
extends Object

Data Access Object for log files.

This class is used both for viewing log files as plain text, and for parsing log files into LoggerRecords.


Constructor Summary
LogFileDAO(HttpServletRequest aRequest)
          Full constructor.
 
Method Summary
 String getLogFileContents(File aFile, SimpleCriteria aCriteria)
          Return the contents of a log file as a String.
 File getMostRecentLogFile(LogFor aLogFor)
          Return the most recent log file in a given directory.
 List<LoggerRecord> getParsedLogFile(File aFile, ParsedCriteria aCriteria)
          Return the entire content of a log file as a List<LoggerRecord>.
 List<File> listAllAppLogFiles()
          Return a List of all application log files.
 List<LoggerRecord> listFirstRecordsFor(List<File> aAllLogFiles)
          Return a List containing the first LoggerRecord in each of the given log files.
static void readConfig(ServletConfig aConfig)
          Read in config from web.xml.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFileDAO

public LogFileDAO(HttpServletRequest aRequest)
Full constructor.

Method Detail

readConfig

public static void readConfig(ServletConfig aConfig)
Read in config from web.xml.


getMostRecentLogFile

public File getMostRecentLogFile(LogFor aLogFor)
                          throws DAOException
Return the most recent log file in a given directory. Returns null if no file found in the logging directory.

Throws:
DAOException

getLogFileContents

public String getLogFileContents(File aFile,
                                 SimpleCriteria aCriteria)
                          throws DAOException
Return the contents of a log file as a String.

If the given criteria desire only a section of the file, then only the first or last section is returned; otherwise, the contents of the entire file is returned.

Throws:
DAOException

getParsedLogFile

public List<LoggerRecord> getParsedLogFile(File aFile,
                                           ParsedCriteria aCriteria)
                                    throws DAOException
Return the entire content of a log file as a List<LoggerRecord>.

Throws:
DAOException

listAllAppLogFiles

public List<File> listAllAppLogFiles()
Return a List of all application log files. Any files having zero size (such as lock files) are ignored. The files are returned in order of increasing 'last-modified' date, such that the oldest log is first. This method is used when calculating down-times from logs.


listFirstRecordsFor

public List<LoggerRecord> listFirstRecordsFor(List<File> aAllLogFiles)
                                       throws DAOException
Return a List containing the first LoggerRecord in each of the given log files. This method is used when calculating down times from logs.

Throws:
DAOException

WEB4J Development Tools 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26