
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 |
A coommand line tool to perform some helpful operation with the files of logs
| alma::acs::logging::tools::LogAssistant::LogAssistant | ( | String[] | args | ) | [inline] |
Constructor
| args | The command line params |
References checkState(), command, extractLogs(), parseCommandLine(), splitFile(), and usage().
Referenced by main().
| 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
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
| date | The string representing the date |
| 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] |
| 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.
| params | The parameters in the command line |
| 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] |
String alma::acs::logging::tools::LogAssistant::cols = null [private] |
The index and order of the cols to write if the output is not XML
Referenced by parseCommandLine().
char alma::acs::logging::tools::LogAssistant::command [private] |
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().
String alma::acs::logging::tools::LogAssistant::destFileName = null [private] |
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().
Date alma::acs::logging::tools::LogAssistant::endDate = null [private] |
Referenced by checkState(), extractLogs(), and parseCommandLine().
String alma::acs::logging::tools::LogAssistant::filterFileName = null [private] |
The name of the filter file for extraction
Referenced by checkState(), extractLogs(), and parseCommandLine().
Integer alma::acs::logging::tools::LogAssistant::minutes = null [private] |
The number of minutes per file while splitting
Referenced by checkState(), parseCommandLine(), and splitFile().
Integer alma::acs::logging::tools::LogAssistant::num = null [private] |
The number of logs per file for splitting
Referenced by checkState(), parseCommandLine(), and splitFile().
String [] alma::acs::logging::tools::LogAssistant::sourceFileNames = null [private] |
The name of the source file
Referenced by checkState(), extractLogs(), parseCommandLine(), and splitFile().
Date alma::acs::logging::tools::LogAssistant::startDate = null [private] |
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().
1.6.2