alma::acs::logging::tools::LogAssistant Class Reference

Collaboration diagram for alma::acs::logging::tools::LogAssistant:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LogAssistant (String[] args)

Static Public Member Functions

static void main (String[] args)

Static Public Attributes

static final String TIME_FORMAT = "yyyy'-'MM'-'dd'T'HH':'mm':'ss"

Private Member Functions

void parseCommandLine (String[] params) throws IllegalStateException
boolean checkState ()
Date getDate (String date) throws ParseException
void extractLogs ()
void splitFile ()

Static Private Member Functions

static void usage (String prgName)

Private Attributes

char command
Date startDate = null
Date endDate = null
String filterFileName = null
Integer num = null
Integer minutes = null
String[] sourceFileNames = null
String destFileName = null
LogConverter converter
String cols = null

Detailed Description

A coommand line tool to perform some helpful operation with the files of logs

Author:
acaproni

Constructor & Destructor Documentation

alma::acs::logging::tools::LogAssistant::LogAssistant ( String[]  args  )  [inline]

Constructor

Parameters:
args The command line params

References checkState(), command, extractLogs(), parseCommandLine(), splitFile(), and usage().

Referenced by main().


Member Function Documentation

boolean alma::acs::logging::tools::LogAssistant::checkState (  )  [inline, private]

Check the state of the variables. This method checks if the internal variables are set in the right way It is usually executed before running a command

Returns:
If the state is correct

References command, endDate, filterFileName, minutes, num, sourceFileNames, and startDate.

Referenced by LogAssistant().

void alma::acs::logging::tools::LogAssistant::extractLogs (  )  [inline, private]

Extract the logs from the source to the destination file

References converter, destFileName, endDate, alma::acs::logging::tools::LogFileExtractor::extract(), filterFileName, sourceFileNames, and startDate.

Referenced by LogAssistant().

Date alma::acs::logging::tools::LogAssistant::getDate ( String  date  )  throws ParseException [inline, private]

Parse the given string into a Date

Parameters:
date The string representing the date
Returns:
A Date obtained parsing the string
Exceptions:
ParseException If an error happen getting the date from the string

References TIME_FORMAT.

Referenced by parseCommandLine().

static void alma::acs::logging::tools::LogAssistant::main ( String[]  args  )  [inline, static]
Parameters:
args 

References LogAssistant().

void alma::acs::logging::tools::LogAssistant::parseCommandLine ( String[]  params  )  throws IllegalStateException [inline, private]

Parse the command line and fill the internal variables Throws an IllegalStateException if an error arises while parsing like for example invalid parameters.

Parameters:
params The parameters in the command line
Exceptions:
IllegalStateException If the parameters in the command line are invalid

References cols, command, converter, destFileName, endDate, filterFileName, getDate(), alma::acs::util::CmdLineArgs::getValues(), alma::acs::util::CmdLineArgs::isSpecified(), minutes, num, alma::acs::util::CmdLineArgs::parseArgs(), alma::acs::util::CmdLineArgs::registerOption(), sourceFileNames, startDate, and TIME_FORMAT.

Referenced by LogAssistant().

void alma::acs::logging::tools::LogAssistant::splitFile (  )  [inline, private]

Split the input log file in several files

References converter, destFileName, minutes, num, sourceFileNames, and alma::acs::logging::tools::LogFileSplitter::split().

Referenced by LogAssistant().

static void alma::acs::logging::tools::LogAssistant::usage ( String  prgName  )  [inline, static, private]

Print a usage message on screen

Parameters:
prgName The program name

Referenced by LogAssistant().


Member Data Documentation

The index and order of the cols to write if the output is not XML

Referenced by parseCommandLine().

The command to execute

Referenced by checkState(), LogAssistant(), and parseCommandLine().

The converter to save the logs in the preferred format.

Referenced by extractLogs(), parseCommandLine(), and splitFile().

The name of the file generated by the process

While splitting the process generates more file appending a sequencial number to this string

Referenced by extractLogs(), parseCommandLine(), and splitFile().

The name of the filter file for extraction

Referenced by checkState(), extractLogs(), and parseCommandLine().

The number of minutes per file while splitting

Referenced by checkState(), parseCommandLine(), and splitFile().

The number of logs per file for splitting

Referenced by checkState(), parseCommandLine(), and splitFile().

The name of the source file

Referenced by checkState(), extractLogs(), parseCommandLine(), and splitFile().

The start and end date for extraction

Referenced by checkState(), extractLogs(), and parseCommandLine().

final String alma::acs::logging::tools::LogAssistant::TIME_FORMAT = "yyyy'-'MM'-'dd'T'HH':'mm':'ss" [static]

The format of the date is the same as the ILogEntry without msecs

Referenced by getDate(), and parseCommandLine().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2