

Classes | |
| class | LoadLogs |
| class | SaveLogs |
Public Member Functions | |
| IOLogsHelper (LoggingClient client) | |
| void | loadLogs (BufferedReader br, ACSRemoteLogListener logListener, ACSRemoteErrorListener errorListener, int progressRange) |
| void | saveLogs (String fileName, boolean compress, int level, LogCache cache) throws IOException |
| void | done () |
| void | bytesRead (long bytes) |
| void | bytesWritten (long bytes) |
| void | logsRead (int numOfLogs) |
| void | logsWritten (int numOfLogs) |
| boolean | isPerformingIO () |
Private Member Functions | |
| String | formatErrorMsg (String msg) |
Private Attributes | |
| IOThread | thread = null |
| ProgressMonitor | progressMonitor |
| IOHelper | ioHelper = new IOHelper() |
| LoggingClient | loggingClient = null |
| long | bytesRead |
| int | logsRead |
| int | logsWritten |
This class is intended to support the commons IO operations aiming to keep the LogTableDataModel class shorter and more readable.
This class instantiate a new thread for each load/save. To cleanly close, the done() must be called.
This class allows only one load/save at a time. If an I/O is requested while another one is in progress, an exception is thrown.
This class is not thread safe!
| alma::acs::logging::io::IOLogsHelper::IOLogsHelper | ( | LoggingClient | client | ) | [inline] |
Build an IOCacheHelper object
References loggingClient.
| void alma::acs::logging::io::IOLogsHelper::bytesRead | ( | long | bytes | ) | [inline] |
Moves the progress bar of the progress monitor
Implements alma::acs::logging::engine::io::IOPorgressListener.
References bytesRead, and progressMonitor.
| void alma::acs::logging::io::IOLogsHelper::bytesWritten | ( | long | bytes | ) | [inline] |
| void alma::acs::logging::io::IOLogsHelper::done | ( | ) | [inline] |
Release the resource acquired by this object It terminates the thread so the object can be deleted by the JVM
NOTE: when the thread is terminate it is not possible to request asynchronous services
References alma::acs::logging::io::IOThread::stopThread(), and thread.
Referenced by alma::acs::logging::table::LogTableDataModel::close().
| String alma::acs::logging::io::IOLogsHelper::formatErrorMsg | ( | String | msg | ) | [inline, private] |
Return a string formatted for JOptionPane making a word wrap
| error | The error i.e. the exception | |
| msg | The message to show |
| boolean alma::acs::logging::io::IOLogsHelper::isPerformingIO | ( | ) | [inline] |
Check if a load/save is in progress
true if a load/save is in progress References thread.
Referenced by alma::acs::logging::table::LogTableDataModel::IOInProgress().
| void alma::acs::logging::io::IOLogsHelper::loadLogs | ( | BufferedReader | br, | |
| ACSRemoteLogListener | logListener, | |||
| ACSRemoteErrorListener | errorListener, | |||
| int | progressRange | |||
| ) | [inline] |
Load the logs from the given file in the Cache appending their starting positions in the index vector.
The logs are appended at the end of the cache as well as the new positions are appended at the end of the index vector. The load is performed in a thread as it might be very slow
The filter, discard level and audience of the engine are applied while loading. This is done by applying to ioHelper the same constraints defined in the LCEngine.
| br | The the file to read | |
| logListener | The callback for each new log read from the IO | |
| errorListener | The listener of errors | |
| progressRange | The range of the progress bar (if <=0 the progress bar is undetermined) |
References thread.
Referenced by alma::acs::logging::table::LogTableDataModel::loadFromFile(), and alma::acs::logging::table::LogTableDataModel::loadFromURL().
| void alma::acs::logging::io::IOLogsHelper::logsRead | ( | int | numOfLogs | ) | [inline] |
Change the label of the progress monitor
Implements alma::acs::logging::engine::io::IOPorgressListener.
References ioHelper, logsRead, progressMonitor, and alma::acs::logging::engine::io::IOHelper::stopIO().
| void alma::acs::logging::io::IOLogsHelper::logsWritten | ( | int | numOfLogs | ) | [inline] |
| void alma::acs::logging::io::IOLogsHelper::saveLogs | ( | String | fileName, | |
| boolean | compress, | |||
| int | level, | |||
| LogCache | cache | |||
| ) | throws IOException [inline] |
Save the logs in a file.
| fileName | The name of the file to save | |
| compress | true if the file must be compressed (GZIP) | |
| level | The level of compression (ignored if compress is false) | |
| cache | The cache that contains the logs |
| IOException |
References thread.
Referenced by alma::acs::logging::table::LogTableDataModel::saveFile().
long alma::acs::logging::io::IOLogsHelper::bytesRead [private] |
The bytes read during a load
Referenced by bytesRead(), and alma::acs::logging::io::IOLogsHelper::LoadLogs::run().
IOHelper alma::acs::logging::io::IOLogsHelper::ioHelper = new IOHelper() [private] |
The IOHelper performing load and save
Referenced by logsRead(), logsWritten(), alma::acs::logging::io::IOLogsHelper::SaveLogs::run(), and alma::acs::logging::io::IOLogsHelper::LoadLogs::run().
LoggingClient alma::acs::logging::io::IOLogsHelper::loggingClient = null [private] |
The logging client
Referenced by IOLogsHelper(), alma::acs::logging::io::IOLogsHelper::SaveLogs::run(), and alma::acs::logging::io::IOLogsHelper::LoadLogs::run().
int alma::acs::logging::io::IOLogsHelper::logsRead [private] |
The number of logs read while loading
Referenced by logsRead(), and alma::acs::logging::io::IOLogsHelper::LoadLogs::run().
int alma::acs::logging::io::IOLogsHelper::logsWritten [private] |
The number of logs read while saving
Referenced by logsWritten(), and alma::acs::logging::io::IOLogsHelper::SaveLogs::run().
ProgressMonitor alma::acs::logging::io::IOLogsHelper::progressMonitor [private] |
The dialog
Referenced by bytesRead(), logsRead(), logsWritten(), alma::acs::logging::io::IOLogsHelper::SaveLogs::run(), and alma::acs::logging::io::IOLogsHelper::LoadLogs::run().
IOThread alma::acs::logging::io::IOLogsHelper::thread = null [private] |
The Thread executing I/O
Referenced by done(), isPerformingIO(), loadLogs(), and saveLogs().
1.6.2