public class LogFileSplitter extends java.lang.Object implements ACSRemoteLogListener, ACSRemoteErrorListener, IOPorgressListener
| Constructor and Description |
|---|
LogFileSplitter(java.lang.String[] inputFiles,
java.lang.String outputFiles,
java.lang.Integer num,
java.lang.Integer mins,
LogConverter converter)
Constructor
|
| 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 |
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.
|
void |
split()
Split the input file
|
public LogFileSplitter(java.lang.String[] inputFiles,
java.lang.String outputFiles,
java.lang.Integer num,
java.lang.Integer mins,
LogConverter converter)
inputFiles - The files of log to readoutputFiles - The names of the files created splittingnum - The number of logs per file (can be null)mins - The minutes of the logs per file (can be null)converter - The converter to format the logs before savingpublic void split()
throws java.lang.Exception
java.lang.Exception - in case of errors while splittingpublic 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 loading} catch (IOException e) {
System.err.print("Error closing output file: ");
System.err.print(e.getMessage());
System.exit(-1);
}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 errorACSRemoteErrorListener.errorReceived(java.lang.String)public void logEntryReceived(ILogEntry logEntry)
ACSRemoteLogListenerlogEntryReceived in interface ACSRemoteLogListenerlogEntry - The new log just read from the NCACSRemoteLogListener.logEntryReceived(com.cosylab.logging.engine.log.ILogEntry)