public class LogFileExtractor extends java.lang.Object implements ACSRemoteLogListener, ACSRemoteErrorListener, IOPorgressListener
| Constructor and Description |
|---|
LogFileExtractor(java.lang.String[] inputFiles,
java.lang.String outputFile,
java.util.Date startDate,
java.util.Date endDate,
java.lang.String filterName,
LogConverter converter)
Constructor
The parameters defines the criteria.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bytesRead(long bytes)
This method notifies about the number of bytes read during a load.
|
void |
bytesWritten(long bytes)
This method notifies about the total number of bytes written during a save.
|
void |
errorReceived(java.lang.String xml)
The method is executed when an error happened building a log
from a string.
|
void |
extract()
Extract the logs from the source to the destination
applying the selection criteria given in the
constructor
|
void |
logEntryReceived(ILogEntry logEntry)
The method is executed when a new log arrives from the NC
|
void |
logsRead(int numOfLogs)
This method notifies about the total number of logs read during a load.
|
void |
logsWritten(int numOfLogs)
This method notifies about the total number of logs written during a save.
|
public LogFileExtractor(java.lang.String[] inputFiles,
java.lang.String outputFile,
java.util.Date startDate,
java.util.Date endDate,
java.lang.String filterName,
LogConverter converter)
throws java.lang.Exception
inputFiles - The name of the files of logs for inputoutputFile - The name of the file with the selected logsstartDate - The start date of logs (can be null)endDate - The end date of the logs (can be null)filterName - The name of a file of filters to apply to select
logs (can be null)converter - The convert to save logs in different output formatsException - In case of errorjava.lang.Exceptionpublic void extract()
throws java.lang.Exception
java.lang.Exceptionpublic void bytesRead(long bytes)
IOPorgressListenerThe value passed as parameter represent the total number of bytes read since the beginning of the load and includes the bytes of the header
bytesRead in interface IOPorgressListenerbytes - The number of bytes read while loadingIOPorgressListener.bytesRead(long)public void bytesWritten(long bytes)
IOPorgressListenerThe value passed as parameter includes the number of the bytes read since the beginning of the save.
bytesWritten in interface IOPorgressListenerbytes - The number of bytes read while loadingIOPorgressListener.bytesWritten(long)public void logsRead(int numOfLogs)
IOPorgressListenerThe value passed as parameter is the number of logs read since the beginning of the save.
logsRead in interface IOPorgressListenerIOPorgressListener.logsRead(int)public void logsWritten(int numOfLogs)
IOPorgressListenerThe value passed as parameter is the number of logs written since the beginning of the save.
logsWritten in interface IOPorgressListenerIOPorgressListener.logsWritten(int)public void errorReceived(java.lang.String xml)
ACSRemoteErrorListenererrorReceived in interface ACSRemoteErrorListenerxml - That string that caused the errorpublic void logEntryReceived(ILogEntry logEntry)
ACSRemoteLogListenerlogEntryReceived in interface ACSRemoteLogListenerlogEntry - The new log just read from the NCACSRemoteLogListener.logEntryReceived(com.cosylab.logging.engine.log.ILogEntry)