Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes

com.cosylab.logging.LoggingClient Class Reference

Inheritance diagram for com.cosylab.logging.LoggingClient:
com.cosylab.logging.engine.ACS.ACSRemoteLogListener com.cosylab.logging.engine.ACS.ACSLogConnectionListener com.cosylab.logging.engine.ACS.ACSRemoteErrorListener com.cosylab.logging.MessageWidget.MessageWidgetListener

List of all members.

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

Detailed Description

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:


Constructor & Destructor Documentation

com.cosylab.logging.LoggingClient.LoggingClient (  ) 
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.

Parameters:
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().


Member Function Documentation

void com.cosylab.logging.LoggingClient.acsLogConnConnecting (  ) 

Notify that an attempt to connect to ACS NC is in progress

See also:
com.cosylab.logging.engine.ACS.ACSLogConnectionListener
void com.cosylab.logging.LoggingClient.acsLogConnEstablished (  ) 
void com.cosylab.logging.LoggingClient.acsLogConnLost (  ) 
void com.cosylab.logging.LoggingClient.acsLogConnSuspended (  ) 

Notify that the service is suspended

See also:
com.cosylab.logging.engine.ACS.ACSLogConnectionListener
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

See also:
com.cosylab.logging.engine.ACS.ACSRemoteLogListener
void com.cosylab.logging.LoggingClient.addErrorTab ( final String  stackID  ) 

Add a new error stack to the error browser dialog

Parameters:
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

Parameters:
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

Parameters:
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.connect ( boolean  connectEngine  ) 
void com.cosylab.logging.LoggingClient.connLCEngDisconnect ( WindowEvent  arg1  ) 

Disconnects the LCEngine.

Parameters:
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  ) 
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)

Parameters:
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.

See also:
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  ) 
See also:
ACSRemoteErrorListener

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 (  ) 
Returns:
the containerServices

References com.cosylab.logging.LoggingClient.containerServices.

int com.cosylab.logging.LoggingClient.getDiscardLevel (  ) 
Returns:
The discard log level
See also:
LoggingClient.discardLevelCB

References alma.acs.logging.dialogs.main.LogToolBar.getDiscardLevelCB().

ErrorBrowserDlg com.cosylab.logging.LoggingClient.getErrorDialog (  ) 
JScrollPane com.cosylab.logging.LoggingClient.getLogDetailScrollPane (  ) 

Returns the scroll pane with the details of the logs

Returns:
JScrollPane
JScrollPane com.cosylab.logging.LoggingClient.getLogTableScroolP (  ) 

Returns the scroll panel with the table of logs

Returns:
the scroll panel with the table of logs

References com.cosylab.logging.LoggingClient.getLogEntryTable().

UserPreferences com.cosylab.logging.LoggingClient.getPrefs (  ) 
Returns:
A reference to the preferences
StatsDlg com.cosylab.logging.LoggingClient.getStatisticDialog (  ) 

Return a dialog showing the statistics

Returns:
The dialog showing the statistic

Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed().

LogToolBar com.cosylab.logging.LoggingClient.getToolBar (  ) 
Returns:
the toolBar
void com.cosylab.logging.LoggingClient.hideExitMenu ( boolean  hide  ) 

Hide the Exit menu item

Parameters:
hide If true the menu is set to invisible

References alma.acs.logging.dialogs.main.LogMenuBar.hideExitMenu().

boolean com.cosylab.logging.LoggingClient.inDebugMode (  ) 
Returns:
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.

Parameters:
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 (  ) 
boolean com.cosylab.logging.LoggingClient.isPaused (  ) 

Return true if the application is paused

Returns:

References alma.acs.logging.dialogs.main.LogToolBar.isPaused().

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

Parameters:
newPos 
void com.cosylab.logging.LoggingClient.pause (  )  throws Exception

Method used by the plugin interface in EXEC. Pause the application (scroll lock enabled)

See also:
alma.exec.extension.subsystemplugin.IPauseResume
Exceptions:
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

See also:
com.cosylab.logging.engine.ACS.ACSRemoteLogListener
void com.cosylab.logging.LoggingClient.resume (  )  throws Exception

Method used by the plugin interface in EXEC. Unpause the application (scroll lock disabled)

See also:
alma.exec.extension.subsystemplugin.IPauseResume
Exceptions:
Exception 

References com.cosylab.logging.engine.ACS.LCEngine.setPaused(), and alma.acs.logging.dialogs.main.LogToolBar.unpause().

void com.cosylab.logging.LoggingClient.setLogDetailContent ( ILogEntry  log  ) 

Set the content of the detailed info table from the given log

Parameters:
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

Parameters:
icon The icon
msg A message to show as tooltip
void com.cosylab.logging.LoggingClient.showDetailedLogInfo (  ) 
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:

  1. this method shows the error widget and set the glass pane so that it will catch all the events but those directed the error widget's ACK button. What this method does not do, is to make the glass pane visible. This is done by the connection listener methods. If, in future, you want to show the glass pane even here, you should do it explicitly.
  2. when the connection with ACS is again available, the 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).

Parameters:
shortDescription The description of the error
t The throwable that caused the error (can be null).
Returns:

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

See also:
alma.exec.extension.subsystemplugin.SubsystemPlugin
Exceptions:
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

See also:
alma.exec.extension.subsystemplugin.SubsystemPlugin
Exceptions:
Exception 

References com.cosylab.logging.LoggingClient.close().


Member Data Documentation

containerServices is always set while running as OMC plugin.

It is used to avoid creating a new ORB when one is already available.

See also:
connect()

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().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties