Classes | |
class | CustomColumnListener |
class | EventHandler |
Public Member Functions | |
LoggingClient () | |
LoggingClient (LogFrame frame, LogTypeHelper logLevel, LogTypeHelper discardLevel, boolean unlimited, AudienceInfo aInfo) | |
void | start () throws Exception |
void | stop () throws Exception |
void | pause () throws Exception |
void | resume () throws Exception |
void | connect (boolean connectEngine) |
void | connect () |
JScrollPane | getLogTableScroolP () |
LogEntryTable | getLogEntryTable () |
void | showDetailedLogInfo () |
void | setLogDetailContent (ILogEntry log) |
void | connLCEngDisconnect (WindowEvent arg1) |
JScrollPane | getLogDetailScrollPane () |
LCEngine | getEngine () |
LogTableDataModel | getLCModel1 () |
void | loggingClient_ComponentResized (ComponentEvent e) |
void | enableSearchNext (boolean enable) |
void | animateProgressBar (final String text, final int min, final int max) |
void | moveProgressBar (final int newPos) |
void | animateProgressBar (final String text) |
void | freezeProgressBar () |
boolean | isConnected () |
int | getDiscardLevel () |
void | logEntryReceived (ILogEntry logEntry) |
void | reportStatus (String status) |
void | acsLogConnEstablished () |
void | acsLogConnDisconnected () |
void | acsLogConnLost () |
void | acsLogConnConnecting () |
void | acsLogConnSuspended () |
void | acsLogsDelay () |
void | showDBStatus (ImageIcon icon, String msg) |
UserPreferences | getPrefs () |
boolean | isPaused () |
void | hideExitMenu (boolean hide) |
void | close (boolean sync) |
void | enableFiltersWidgets (boolean enable) |
void | errorReceived (String xml) |
StatsDlg | getStatisticDialog () |
void | setEnabled (boolean enabled) |
ErrorBrowserDlg | getErrorDialog () |
void | addErrorTab (final String stackID) |
ZoomManager | getZoomManager () |
LogToolBar | getToolBar () |
ContainerServicesBase | getContainerServices () |
boolean | inDebugMode () |
void | showErrorMessage (String shortDescription, Throwable t) |
void | errorAcknowledged () |
Static Public Attributes | |
static final LogTypeHelper | DEFAULT_LOGLEVEL = LogTypeHelper.INFO |
static final LogTypeHelper | DEFAULT_DISCARDLEVEL = LogTypeHelper.DEBUG |
Protected Member Functions | |
void | initAudience (AudienceInfo audienceInfo) |
Protected Attributes | |
ContainerServicesBase | containerServices = null |
Defines a JRootPane Application LoggingClient for displaying event logs received through the CORBA protocol for the purpose of monitoring and reviewing of the logs. It contains of a JScrollPane scrollLogTable for the logs and a LogEntryTable logEntryTable for displaying the status as well as a JPanel ivjJFrameContentPane. Multiple listeners handle user's input. Based on the current code and our understanding of it one could describe the information flow as follows. User's input triggers events which are caught by the listeners attached to each one of the available GUI object representations defined in the LoggingClient class. Independent of that there are messages available at the logging system generated by the other services running in the framework. These messages are parsed by the ACSStructuredPushConsumer class using the SAX parser and are then passed on using the LogTableDataModel's appendLog method for putting the logs to the log table. In particular, we are interested in the saving and loading of files to be implemented by the LoggingClient. While saveFile and loadFromFile are defined in LogTabledataModel, the LogImportTask file makes use of the the LogTabledataModel's appendLog method as well. The use of the DocumentBuilderFactory in the LogImportTask defines a way for transforming a DOM tree into XML.
An important issue is the format of the Log Entry Message produced by the Logging Service. Certain characters ('<', '>', '&', ''', '"') need to be escaped because they delineate markup data from character data and cause the following exception in ACSLogParserDOM class: org.xml.sax.SAXParseException: The content beginning with '<' is not legal markup. One solution is replacing the character with the appropriate html substitute <. Another solution is keeping it in a CDATA section: <[!CDATA[the log entry message]]>.
The panel can be instantiated:
com.cosylab.logging.LoggingClient.LoggingClient | ( | ) |
Constructor
The empty constructor is called by the OMC GUI.
References com.cosylab.logging.LoggingClient.DEFAULT_DISCARDLEVEL, com.cosylab.logging.LoggingClient.DEFAULT_LOGLEVEL, and com.cosylab.logging.LoggingClient.initAudience().
com.cosylab.logging.LoggingClient.LoggingClient | ( | LogFrame | frame, | |
LogTypeHelper | logLevel, | |||
LogTypeHelper | discardLevel, | |||
boolean | unlimited, | |||
AudienceInfo | aInfo | |||
) |
The constructor
This constructor is called when this object runs in stand-alone mode i.e outside of the OMC GUI.
frame | The shows this object | |
logLevel | The initial log level | |
discardLevel | The initial discard level | |
unlimited | If true the number of logs in memory is unlimited, otherwise the default is used |
References com.cosylab.logging.LoggingClient.initAudience().
void com.cosylab.logging.LoggingClient.acsLogConnConnecting | ( | ) |
Notify that an attempt to connect to ACS NC is in progress
void com.cosylab.logging.LoggingClient.acsLogConnDisconnected | ( | ) |
void com.cosylab.logging.LoggingClient.acsLogConnEstablished | ( | ) |
Notify that the connection with ACS NC has been established
References com.cosylab.logging.MessageWidget.getAckButton(), com.cosylab.logging.LoggingClient.isConnected(), and com.cosylab.logging.TransparentGlassPane.setVisible().
void com.cosylab.logging.LoggingClient.acsLogConnLost | ( | ) |
Notify that the connection with ACS NC has been lost
References com.cosylab.logging.LoggingClient.isConnected(), com.cosylab.logging.TransparentGlassPane.setVisible(), and com.cosylab.logging.LoggingClient.showErrorMessage().
void com.cosylab.logging.LoggingClient.acsLogConnSuspended | ( | ) |
Notify that the service is suspended
void com.cosylab.logging.LoggingClient.acsLogsDelay | ( | ) |
Notify that for some internal reason the service is not able to follow the flow of the incoming logs
void com.cosylab.logging.LoggingClient.addErrorTab | ( | final String | stackID | ) |
Add a new error stack to the error browser dialog
stackID | The STACKID of the error trace in the tab |
References alma.acs.logging.errorbrowser.ErrorBrowserDlg.addErrorTab(), com.cosylab.logging.LoggingClient.getErrorDialog(), and com.cosylab.logging.LoggingClient.getLCModel1().
Referenced by alma.acs.logging.table.TablePopupMenu.actionPerformed().
void com.cosylab.logging.LoggingClient.animateProgressBar | ( | final String | text | ) |
Show the progress bar as indeterminate
text | The text to show in the toolbar If it is null or empty then no text will be displayed |
void com.cosylab.logging.LoggingClient.animateProgressBar | ( | final String | text, | |
final int | min, | |||
final int | max | |||
) |
Show the progres bar as determinate with the given min and max
textThe | text to show in the toolbar If it is null or empty then no text will be displayed | |
min | The starting position | |
max | The final position |
Referenced by alma.acs.logging.archive.QueryDlg.actionPerformed(), and alma.acs.logging.table.LogEntryTable.sorterChanged().
void com.cosylab.logging.LoggingClient.close | ( | boolean | sync | ) |
Close all the threads and release all the resources
sync | If it is true wait the termination of the threads before returning |
References alma.acs.logging.archive.zoom.ManualZoomDlg.close(), alma.acs.logging.archive.QueryDlg.close(), alma.acs.logging.errorbrowser.ErrorBrowserDlg.close(), com.cosylab.logging.engine.ACS.LCEngine.close(), alma.acs.logging.table.LogEntryTable.close(), alma.acs.logging.table.LogTableDataModel.close(), alma.acs.logging.dialogs.error.ErrorLogDialog.dispose(), com.cosylab.logging.settings.FilterChooserDialog.setVisible(), com.cosylab.logging.search.SearchDialog.setVisible(), com.cosylab.logging.stats.StatsDlg.setVisible(), and alma.acs.logging.dialogs.error.ErrorLogDialog.setVisible().
Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed(), and com.cosylab.logging.LoggingClient.stop().
void com.cosylab.logging.LoggingClient.connect | ( | boolean | connectEngine | ) |
Connect or disconnect the engine to the NC
connect | If true the engine is connected otherwise it is disconnected |
References com.cosylab.logging.LoggingClient.connect(), alma.acs.logging.dialogs.main.LogMenuBar.getAutoReconnectMenuItem(), com.cosylab.logging.LoggingClient.getEngine(), alma.acs.logging.dialogs.main.LogMenuBar.getSuspendMenuItem(), and com.cosylab.logging.engine.ACS.LCEngine.setSupended().
Referenced by alma.acs.logging.io.LoadSwitchesPanel.execute(), and alma.acs.logging.dialogs.main.LogFrame.LogFrame().
void com.cosylab.logging.LoggingClient.connect | ( | ) |
Connects to the remote system as soon as the item "New" is clicked.
References com.cosylab.logging.engine.ACS.LCEngine.connect(), com.cosylab.logging.LoggingClient.containerServices, alma.acs.container.ContainerServicesBase.getAdvancedContainerServices(), com.cosylab.logging.LoggingClient.getEngine(), alma.acs.container.AdvancedContainerServices.getORB(), and com.cosylab.logging.engine.ACS.LCEngine.setConnectionParams().
Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed(), com.cosylab.logging.LoggingClient.connect(), and com.cosylab.logging.LoggingClient.start().
void com.cosylab.logging.LoggingClient.connLCEngDisconnect | ( | WindowEvent | arg1 | ) |
Disconnects the LCEngine.
arg1 | java.awt.event.WindowEvent |
References com.cosylab.logging.engine.ACS.LCEngine.disconnect(), and com.cosylab.logging.LoggingClient.getEngine().
void com.cosylab.logging.LoggingClient.enableFiltersWidgets | ( | boolean | enable | ) |
Enable/disable the filter menu item and the filter button in the tool bar
enable | true enables the widgets |
References alma.acs.logging.dialogs.main.LogMenuBar.getEngineFiltersMenuItem(), alma.acs.logging.dialogs.main.LogToolBar.getFiltersBtn(), and alma.acs.logging.dialogs.main.LogMenuBar.getFiltersMenuItem().
Referenced by com.cosylab.logging.settings.FilterChooserDialog.FilterChooserDialog().
void com.cosylab.logging.LoggingClient.enableSearchNext | ( | boolean | enable | ) |
Enable or disable the Search next menu item (tipically this action is preformed by the SearchDialog when a valid search is performed)
enable | true enable the searchNextMenuItem |
References alma.acs.logging.dialogs.main.LogMenuBar.getSearchNextMenuItem().
Referenced by com.cosylab.logging.search.SearchDialog.search().
void com.cosylab.logging.LoggingClient.errorAcknowledged | ( | ) |
When the user acknowledges the message, we enable the glass pane to forward all the messages to the content pane.
This method is executed when the user presses over the ACK button of the error widget and remove the constraints on the glass pane.
showErrorMessage
for further implementation details Implements com.cosylab.logging.MessageWidget.MessageWidgetListener.
References alma.acs.logging.dialogs.main.LogMenuBar.setEnabled(), alma.acs.logging.dialogs.main.LogNavigationBar.setEnabled(), alma.acs.logging.dialogs.main.LogToolBar.setEnabled(), and com.cosylab.logging.TransparentGlassPane.setEventComponent().
void com.cosylab.logging.LoggingClient.errorReceived | ( | String | xml | ) |
References alma.acs.logging.dialogs.error.ErrorLogDialog.appendText().
void com.cosylab.logging.LoggingClient.freezeProgressBar | ( | ) |
Hide the progress bar (i.e. a long operation has terminated)
Referenced by alma.acs.logging.archive.QueryDlg.actionPerformed(), and alma.acs.logging.table.LogEntryTable.sorterChanged().
ContainerServicesBase com.cosylab.logging.LoggingClient.getContainerServices | ( | ) |
References com.cosylab.logging.LoggingClient.containerServices.
int com.cosylab.logging.LoggingClient.getDiscardLevel | ( | ) |
References alma.acs.logging.dialogs.main.LogToolBar.getDiscardLevelCB().
LCEngine com.cosylab.logging.LoggingClient.getEngine | ( | ) |
Returns the LCEngine property value.
References com.cosylab.logging.engine.ACS.LCEngine.addLogConnectionListener(), com.cosylab.logging.engine.ACS.LCEngine.addLogErrorListener(), com.cosylab.logging.engine.ACS.LCEngine.addLogListener(), alma.acs.logging.dialogs.main.LogToolBar.getDiscardLevelCB(), and com.cosylab.logging.engine.ACS.LCEngine.setDiscardLevel().
Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed(), com.cosylab.logging.LoggingClient.connect(), com.cosylab.logging.LoggingClient.connLCEngDisconnect(), alma.acs.logging.dialogs.main.LogFrame.LogFrame(), and com.cosylab.logging.LoggingClient.EventHandler.menuSelected().
ErrorBrowserDlg com.cosylab.logging.LoggingClient.getErrorDialog | ( | ) |
Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed(), and com.cosylab.logging.LoggingClient.addErrorTab().
LogTableDataModel com.cosylab.logging.LoggingClient.getLCModel1 | ( | ) |
Returns the LCModel1 property value.
Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed(), com.cosylab.logging.LoggingClient.addErrorTab(), alma.acs.logging.io.LoadSwitchesPanel.checkControlsState(), alma.acs.logging.io.LoadSwitchesPanel.execute(), alma.acs.logging.dialogs.main.LogFrame.LogFrame(), and com.cosylab.logging.LoggingClient.EventHandler.menuSelected().
JScrollPane com.cosylab.logging.LoggingClient.getLogDetailScrollPane | ( | ) |
Returns the scroll pane with the details of the logs
LogEntryTable com.cosylab.logging.LoggingClient.getLogEntryTable | ( | ) |
Returns the table of logs
References alma.acs.logging.table.LogEntryTable.getLCModel(), alma.acs.logging.dialogs.main.LogMenuBar.getLogTypeDescriptionViewMenuItem(), and alma.acs.logging.dialogs.main.LogMenuBar.getShortDateViewMenuItem().
Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed(), com.cosylab.logging.LoggingClient.getLogTableScroolP(), alma.acs.logging.table.LogTableDataModel.loadFromFile(), com.cosylab.logging.LoggingClient.logEntryReceived(), alma.acs.logging.dialogs.main.LogFrame.LogFrame(), com.cosylab.logging.LoggingClient.loggingClient_ComponentResized(), com.cosylab.logging.search.SearchDialog.search(), com.cosylab.logging.search.SearchDialog.SearchDialog(), and com.cosylab.logging.LoggingClient.showDetailedLogInfo().
JScrollPane com.cosylab.logging.LoggingClient.getLogTableScroolP | ( | ) |
Returns the scroll panel with the table of logs
References com.cosylab.logging.LoggingClient.getLogEntryTable().
UserPreferences com.cosylab.logging.LoggingClient.getPrefs | ( | ) |
StatsDlg com.cosylab.logging.LoggingClient.getStatisticDialog | ( | ) |
Return a dialog showing the statistics
Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed().
LogToolBar com.cosylab.logging.LoggingClient.getToolBar | ( | ) |
ZoomManager com.cosylab.logging.LoggingClient.getZoomManager | ( | ) |
Referenced by alma.acs.logging.table.TablePopupMenu.show(), alma.acs.logging.table.LogEntryTable.zoom(), and alma.acs.logging.table.LogEntryTable.zoomReadingFile().
void com.cosylab.logging.LoggingClient.hideExitMenu | ( | boolean | hide | ) |
Hide the Exit menu item
hide | If true the menu is set to invisible |
References alma.acs.logging.dialogs.main.LogMenuBar.hideExitMenu().
boolean com.cosylab.logging.LoggingClient.inDebugMode | ( | ) |
true
if jlog runs in debug mode Referenced by alma.acs.logging.archive.ArchiveConnectionManager.getDBStatus().
void com.cosylab.logging.LoggingClient.initAudience | ( | AudienceInfo | audienceInfo | ) | [protected] |
Init the audience.
If an audience has been specified in the command line then it will be used otherwise it tries to check if a java property has been set.
The audience dafaults to ENGINEER.
audienceInfo | The audience: it can be null . |
References alma.acs.logging.dialogs.main.LogMenuBar.getEngineeringMode(), alma.acs.logging.dialogs.main.LogMenuBar.getOperatorMode(), and alma.acs.logging.dialogs.main.LogMenuBar.getSciLogMode().
Referenced by com.cosylab.logging.LoggingClient.LoggingClient().
boolean com.cosylab.logging.LoggingClient.isConnected | ( | ) |
Referenced by com.cosylab.logging.LoggingClient.acsLogConnDisconnected(), com.cosylab.logging.LoggingClient.acsLogConnEstablished(), com.cosylab.logging.LoggingClient.acsLogConnLost(), and com.cosylab.logging.LoggingClient.EventHandler.menuSelected().
boolean com.cosylab.logging.LoggingClient.isPaused | ( | ) |
Return true if the application is paused
References alma.acs.logging.dialogs.main.LogToolBar.isPaused().
void com.cosylab.logging.LoggingClient.logEntryReceived | ( | ILogEntry | logEntry | ) |
void com.cosylab.logging.LoggingClient.loggingClient_ComponentResized | ( | ComponentEvent | e | ) |
Sets the height and width generated by user's actions.
References com.cosylab.logging.LoggingClient.getLogEntryTable().
void com.cosylab.logging.LoggingClient.moveProgressBar | ( | final int | newPos | ) |
Move the progressbar when in determinate mode
newPos |
void com.cosylab.logging.LoggingClient.pause | ( | ) | throws Exception |
Method used by the plugin interface in EXEC. Pause the application (scroll lock enabled)
Exception |
References alma.acs.logging.dialogs.main.LogToolBar.pause(), and com.cosylab.logging.engine.ACS.LCEngine.setPaused().
void com.cosylab.logging.LoggingClient.reportStatus | ( | String | status | ) |
Append the report status message to the status area
void com.cosylab.logging.LoggingClient.resume | ( | ) | throws Exception |
Method used by the plugin interface in EXEC. Unpause the application (scroll lock disabled)
Exception |
References com.cosylab.logging.engine.ACS.LCEngine.setPaused(), and alma.acs.logging.dialogs.main.LogToolBar.unpause().
void com.cosylab.logging.LoggingClient.setEnabled | ( | boolean | enabled | ) |
void com.cosylab.logging.LoggingClient.setLogDetailContent | ( | ILogEntry | log | ) |
Set the content of the detailed info table from the given log
log | The log entry which fields have to be shown in the table It can be null |
Referenced by alma.acs.logging.table.TablePopupMenu.actionPerformed(), and alma.acs.logging.table.LogEntryTable.changeSelection().
void com.cosylab.logging.LoggingClient.showDBStatus | ( | ImageIcon | icon, | |
String | msg | |||
) |
Update the GUI with the status of the DB connection
icon | The icon | |
msg | A message to show as tooltip |
void com.cosylab.logging.LoggingClient.showDetailedLogInfo | ( | ) |
Show a detailed view of the selected log in the right panel
References alma.acs.logging.table.LogEntryTable.getLCModel(), com.cosylab.logging.LoggingClient.getLogEntryTable(), alma.acs.logging.table.LogEntryTableModelBase.getVisibleLogEntry(), and com.cosylab.logging.client.DetailedLogTable.setupContent().
void com.cosylab.logging.LoggingClient.showErrorMessage | ( | String | shortDescription, | |
Throwable | t | |||
) |
Show an error in the error panel displayed on top of the table of logs.
Implementation notes:
acsLogConnEstablished
programmatically pushes the ACS button of the error widget causing the widget to disappear without any intervention from the user. This is very useful when the auto reconnect option is enabled. However, note that if showErrorMessage
is used for notifying other abnormal situations then a different strategy must be used to avoid the error widget to disappear at the wrong time (i.e. without the user acknowledge the problem). showErrorMessage
prints a message in the stderr too in case the glass pane can't be made visible (for example if an error occurs while building the LoggingClient
object).
shortDescription | The description of the error | |
t | The throwable that caused the error (can be null ). |
References com.cosylab.logging.MessageWidget.getAckButton(), alma.acs.logging.dialogs.main.LogMenuBar.setEnabled(), alma.acs.logging.dialogs.main.LogNavigationBar.setEnabled(), alma.acs.logging.dialogs.main.LogToolBar.setEnabled(), com.cosylab.logging.TransparentGlassPane.setEventComponent(), and com.cosylab.logging.MessageWidget.showMessage().
Referenced by com.cosylab.logging.LoggingClient.acsLogConnLost().
void com.cosylab.logging.LoggingClient.start | ( | ) | throws Exception |
Method used by the plugin interface in EXEC: it connects the application to the NC
Exception |
References com.cosylab.logging.LoggingClient.connect(), and com.cosylab.logging.LoggingClient.containerServices.
void com.cosylab.logging.LoggingClient.stop | ( | ) | throws Exception |
Method used by the plugin interface in EXEC. Stop the application disconnecting from the NC
Exception |
References com.cosylab.logging.LoggingClient.close().
ContainerServicesBase com.cosylab.logging.LoggingClient.containerServices = null [protected] |
containerServices
is always set while running as OMC plugin.
It is used to avoid creating a new ORB when one is already available.
Referenced by com.cosylab.logging.LoggingClient.connect(), com.cosylab.logging.LoggingClient.getContainerServices(), and com.cosylab.logging.LoggingClient.start().
final LogTypeHelper com.cosylab.logging.LoggingClient.DEFAULT_DISCARDLEVEL = LogTypeHelper.DEBUG [static] |
The default discard level
Referenced by com.cosylab.logging.LoggingClient.LoggingClient().
final LogTypeHelper com.cosylab.logging.LoggingClient.DEFAULT_LOGLEVEL = LogTypeHelper.INFO [static] |
The default log level
Referenced by com.cosylab.logging.LoggingClient.LoggingClient().