Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::logging::tools::LogFileSplitter Class Reference

Collaboration diagram for alma::acs::logging::tools::LogFileSplitter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LogFileSplitter (String inputFile, String outputFiles, Integer num, Integer mins, boolean csvFormat, String cols)
void split () throws Exception
Override void xmlEntryReceived (String xmlLogString)
Override void bytesRead (long bytes)
Override void bytesWritten (long bytes)
Override void logsRead (int numOfLogs)
Override void logsWritten (int numOfLogs)
Override void errorReceived (String xml)

Private Member Functions

BufferedWriter getOutputFile (String dest, int idx, Date startingDate)
void closeOutputFile (BufferedWriter file)

Private Attributes

String inFileName
String destFileName
int index = 0
Integer number = null
Integer time = null
int logsRead = 0
long firstLogDate = -1
ACSLogParser parser = null
final int OUTPUT_BUFFER_SIZE = 8192
BufferedWriter outF = null
SimpleDateFormat dateFormat = new IsoDateFormat()
boolean writeAsCSV = false
CSVConverter csv
String cols = null

Detailed Description

An object to split a log file in several other shorter file. The criteria is the number of logs or the time (in minutes)

A progressive number is appended to the name of the destination for each created file. If the time is the criteria to split the input file, the the date of the first log is appended to the name of the file too.

Author:
acaproni


Constructor & Destructor Documentation

alma::acs::logging::tools::LogFileSplitter::LogFileSplitter String  inputFile,
String  outputFiles,
Integer  num,
Integer  mins,
boolean  csvFormat,
String  cols
[inline]
 

Constructor

Parameters:
inputFile The file of log to read
outputFiles The names of the files created splitting
num The number of logs per file (can be null)
mins The minutes of the logs per file (can be null)
csvFormat if true the output is written as CSV instead of XML
cols The fields to write in the CSV


Member Function Documentation

Override void alma::acs::logging::tools::LogFileSplitter::bytesRead long  bytes  )  [inline]
 

Override void alma::acs::logging::tools::LogFileSplitter::bytesWritten long  bytes  )  [inline]
 

void alma::acs::logging::tools::LogFileSplitter::closeOutputFile BufferedWriter  file  )  [inline, private]
 

Flush and close the file

Parameters:
file The file to close

Override void alma::acs::logging::tools::LogFileSplitter::errorReceived String  xml  )  [inline]
 

BufferedWriter alma::acs::logging::tools::LogFileSplitter::getOutputFile String  dest,
int  idx,
Date  startingDate
[inline, private]
 

Create a new file for output.

Parameters:
dest The name of the destination file
index The index to append to the name
startingDate The date of the first log to append to the name of the file It can be null.
Returns:
The writer for output

Override void alma::acs::logging::tools::LogFileSplitter::logsRead int  numOfLogs  )  [inline]
 

Override void alma::acs::logging::tools::LogFileSplitter::logsWritten int  numOfLogs  )  [inline]
 

void alma::acs::logging::tools::LogFileSplitter::split  )  throws Exception [inline]
 

Split the input file

Exceptions:
Exception in case of errors while splitting

Override void alma::acs::logging::tools::LogFileSplitter::xmlEntryReceived String  xmlLogString  )  [inline]
 

Exceuted when a new log has been read

Parameters:
xmlLogString The XML log read


Member Data Documentation

String alma::acs::logging::tools::LogFileSplitter::cols = null [private]
 

CSVConverter alma::acs::logging::tools::LogFileSplitter::csv [private]
 

SimpleDateFormat alma::acs::logging::tools::LogFileSplitter::dateFormat = new IsoDateFormat() [private]
 

String alma::acs::logging::tools::LogFileSplitter::destFileName [private]
 

long alma::acs::logging::tools::LogFileSplitter::firstLogDate = -1 [private]
 

int alma::acs::logging::tools::LogFileSplitter::index = 0 [private]
 

String alma::acs::logging::tools::LogFileSplitter::inFileName [private]
 

int alma::acs::logging::tools::LogFileSplitter::logsRead = 0 [private]
 

Integer alma::acs::logging::tools::LogFileSplitter::number = null [private]
 

BufferedWriter alma::acs::logging::tools::LogFileSplitter::outF = null [private]
 

final int alma::acs::logging::tools::LogFileSplitter::OUTPUT_BUFFER_SIZE = 8192 [private]
 

ACSLogParser alma::acs::logging::tools::LogFileSplitter::parser = null [private]
 

Integer alma::acs::logging::tools::LogFileSplitter::time = null [private]
 

boolean alma::acs::logging::tools::LogFileSplitter::writeAsCSV = false [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:54:00 2009 for ACS Java API by doxygen 1.3.8