public class LoggingClient extends javax.swing.JRootPane implements ACSRemoteLogListener, ACSLogConnectionListener, ACSRemoteErrorListener, MessageWidget.MessageWidgetListener
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: - by LogFrame - as an EXEC plugin
javax.swing.JRootPane.AccessibleJRootPane, javax.swing.JRootPane.RootLayoutjavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected ContainerServicesBase |
containerServices
containerServices is always set while running as OMC plugin. |
static LogTypeHelper |
DEFAULT_DISCARDLEVEL
The default discard level
|
static LogTypeHelper |
DEFAULT_LOGLEVEL
The default log level
|
COLOR_CHOOSER_DIALOG, contentPane, defaultButton, defaultPressAction, defaultReleaseAction, ERROR_DIALOG, FILE_CHOOSER_DIALOG, FRAME, INFORMATION_DIALOG, layeredPane, NONE, PLAIN_DIALOG, QUESTION_DIALOG, WARNING_DIALOGlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
LoggingClient()
Constructor
|
LoggingClient(LogFrame frame,
LogTypeHelper logLevel,
LogTypeHelper discardLevel,
boolean unlimited,
Audience.AudienceInfo aInfo)
The constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
acsLogConnConnecting()
Notify that an attempt to connect to ACS NC is in progress
|
void |
acsLogConnDisconnected()
Notify that the connection with ACS NC has been disconnected
It can happen as a consequence of an error as well as as consequence
of a request
|
void |
acsLogConnEstablished()
Notify that the connection with ACS NC has been established
|
void |
acsLogConnLost()
Notify that the connection with ACS NC has been lost
|
void |
acsLogConnSuspended()
Notify that the service is suspended
|
void |
acsLogsDelay()
Notify that for some internal reason the service is not able
to follow the flow of the incoming logs
|
void |
addErrorTab(java.lang.String stackID)
Add a new error stack to the error browser dialog
|
void |
animateProgressBar(java.lang.String text)
Show the progress bar as indeterminate
|
void |
animateProgressBar(java.lang.String text,
int min,
int max)
Show the progres bar as determinate with the given min and max
|
void |
close(boolean sync)
Close all the threads and release all the resources
|
void |
connect()
Connects to the remote system
as soon as the item "New" is clicked.
|
void |
connect(boolean connectEngine)
Connect or disconnect the engine to the NC
|
void |
connLCEngDisconnect(java.awt.event.WindowEvent arg1)
Disconnects the LCEngine.
|
void |
enableFiltersWidgets(boolean enable)
Enable/disable the filter menu item and the filter button
in the tool bar.
|
void |
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)
|
void |
errorAcknowledged()
When the user acknowledges the message, we enable the glass pane to forward all the
messages to the content pane.
|
void |
errorReceived(java.lang.String xml)
The method is executed when an error happened building a log
from a string.
|
void |
freezeProgressBar()
Hide the progress bar (i.e.
|
ContainerServicesBase |
getContainerServices() |
int |
getDiscardLevel() |
LCEngine |
getEngine()
Returns the LCEngine property value.
|
ErrorBrowserDlg |
getErrorDialog() |
LogTableDataModel |
getLCModel1()
Returns the LCModel1 property value.
|
javax.swing.JScrollPane |
getLogDetailScrollPane()
Returns the scroll pane with the details of the logs
|
LogEntryTable |
getLogEntryTable()
Returns the table of logs
|
LogFrame |
getLogFrame()
Return
logFrame. |
javax.swing.JScrollPane |
getLogTableScroolP()
Returns the scroll panel with the table of logs
|
UserPreferences |
getPrefs() |
StatsDlg |
getStatisticDialog()
Return a dialog showing the statistics
|
LogToolBar |
getToolBar() |
ViewCoordinator |
getViewCoordinator() |
ZoomManager |
getZoomManager() |
void |
hideExitMenu(boolean hide)
Hide the Exit menu item
|
boolean |
inDebugMode() |
protected void |
initAudience(Audience.AudienceInfo audienceInfo)
Init the audience.
|
boolean |
isConnected() |
boolean |
isPaused()
Return true if the application is paused
|
void |
logEntryReceived(ILogEntry logEntry)
The method is executed when a new log arrives from the NC
|
void |
loggingClient_ComponentResized(java.awt.event.ComponentEvent e)
Sets the height and width generated by user's actions.
|
void |
moveProgressBar(int newPos)
Move the progressbar when in determinate mode
|
void |
pause()
Method used by the plugin interface in EXEC.
|
void |
reportStatus(java.lang.String status)
Append the report status message to the status area
|
void |
resume()
Method used by the plugin interface in EXEC.
|
void |
setEnabled(boolean enabled) |
void |
setLogDetailContent(ILogEntry log)
Set the content of the detailed info table from the given log
|
void |
setTableFilterLbl()
Update the label of the filtering of the table
|
void |
showDBStatus(javax.swing.ImageIcon icon,
java.lang.String msg)
Update the GUI with the status of the DB connection
|
void |
showDetailedLogInfo()
Show a detailed view of the selected log in the right panel
|
void |
showErrorMessage(java.lang.String shortDescription,
java.lang.Throwable t)
Show an error in the error panel displayed on top of the
table of logs.
|
void |
start()
Method used by the plugin interface in EXEC:
it connects the application to the NC
|
void |
stop()
Method used by the plugin interface in EXEC.
|
addImpl, addNotify, createContentPane, createGlassPane, createLayeredPane, createRootLayout, getAccessibleContext, getContentPane, getDefaultButton, getGlassPane, getJMenuBar, getLayeredPane, getMenuBar, getUI, getUIClassID, getWindowDecorationStyle, isOptimizedDrawingEnabled, isValidateRoot, paramString, removeNotify, setContentPane, setDefaultButton, setDoubleBuffered, setGlassPane, setJMenuBar, setLayeredPane, setMenuBar, setUI, setWindowDecorationStyle, updateUIaddAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final LogTypeHelper DEFAULT_LOGLEVEL
public static final LogTypeHelper DEFAULT_DISCARDLEVEL
protected ContainerServicesBase containerServices
containerServices is always set while running as OMC plugin.
It is used to avoid creating a new ORB when one is already available.
connect()public LoggingClient()
The empty constructor is called by the OMC GUI.
public LoggingClient(LogFrame frame, LogTypeHelper logLevel, LogTypeHelper discardLevel, boolean unlimited, Audience.AudienceInfo aInfo)
This constructor is called when this object runs in stand-alone mode i.e outside of the OMC GUI.
frame - The shows this objectlogLevel - The initial log leveldiscardLevel - The initial discard levelunlimited - If true the number of logs in memory is unlimited,
otherwise the default is usedpublic void start()
throws java.lang.Exception
java.lang.Exceptionalma.exec.extension.subsystemplugin.SubsystemPluginpublic void stop()
throws java.lang.Exception
java.lang.Exceptionalma.exec.extension.subsystemplugin.SubsystemPluginpublic void pause()
throws java.lang.Exception
java.lang.Exceptionalma.exec.extension.subsystemplugin.IPauseResumepublic void resume()
throws java.lang.Exception
java.lang.Exceptionalma.exec.extension.subsystemplugin.IPauseResumepublic void connect(boolean connectEngine)
connect - If true the engine is connected
otherwise it is disconnectedpublic void connect()
public void setTableFilterLbl()
public javax.swing.JScrollPane getLogTableScroolP()
public LogEntryTable getLogEntryTable()
public void showDetailedLogInfo()
public void setLogDetailContent(ILogEntry log)
log - The log entry which fields have to be shown in the table
It can be nullpublic void connLCEngDisconnect(java.awt.event.WindowEvent arg1)
arg1 - java.awt.event.WindowEventpublic javax.swing.JScrollPane getLogDetailScrollPane()
public LCEngine getEngine()
public LogTableDataModel getLCModel1()
public void loggingClient_ComponentResized(java.awt.event.ComponentEvent e)
public void enableSearchNext(boolean enable)
enable - true enable the searchNextMenuItempublic void animateProgressBar(java.lang.String text,
int min,
int max)
textThe - text to show in the toolbar
If it is null or empty then no text will be displayedmin - The starting positionmax - The final positionpublic void moveProgressBar(int newPos)
newPos - public void animateProgressBar(java.lang.String text)
text - The text to show in the toolbar
If it is null or empty then no text will be displayedpublic void freezeProgressBar()
public boolean isConnected()
public int getDiscardLevel()
LoggingClient.discardLevelCBpublic void logEntryReceived(ILogEntry logEntry)
ACSRemoteLogListenerlogEntryReceived in interface ACSRemoteLogListenerlogEntry - The new log just read from the NCACSRemoteLogListenerpublic void reportStatus(java.lang.String status)
reportStatus in interface ACSLogConnectionListenerstatus - The status stringACSRemoteLogListenerpublic void acsLogConnEstablished()
acsLogConnEstablished in interface ACSLogConnectionListenerACSLogConnectionListenerpublic void acsLogConnDisconnected()
ACSLogConnectionListeneracsLogConnDisconnected in interface ACSLogConnectionListenerACSLogConnectionListenerpublic void acsLogConnLost()
acsLogConnLost in interface ACSLogConnectionListenerACSLogConnectionListenerpublic void acsLogConnConnecting()
acsLogConnConnecting in interface ACSLogConnectionListenerACSLogConnectionListenerpublic void acsLogConnSuspended()
acsLogConnSuspended in interface ACSLogConnectionListenerACSLogConnectionListenerpublic void acsLogsDelay()
acsLogsDelay in interface ACSLogConnectionListenerACSRemoteLogListenerpublic void showDBStatus(javax.swing.ImageIcon icon,
java.lang.String msg)
icon - The iconmsg - A message to show as tooltippublic UserPreferences getPrefs()
public boolean isPaused()
public void hideExitMenu(boolean hide)
hide - If true the menu is set to invisiblepublic void close(boolean sync)
sync - If it is true wait the termination of the threads before returningpublic void enableFiltersWidgets(boolean enable)
Calling this method overwrites the setting of the tool bar's "filtersBtn"
via LogToolBar.setEnabled(boolean).
This feature is needed to disable this button when jlog runs inside the OMC,
because there we get calls to LogToolBar#setEnabled(true)
for every table update, menu opening etc.
enable - true enables the widgetspublic void errorReceived(java.lang.String xml)
ACSRemoteErrorListenererrorReceived in interface ACSRemoteErrorListenerxml - That string that caused the errorACSRemoteErrorListenerpublic StatsDlg getStatisticDialog()
protected void initAudience(Audience.AudienceInfo audienceInfo)
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.public void setEnabled(boolean enabled)
setEnabled in class javax.swing.JComponentpublic ErrorBrowserDlg getErrorDialog()
public LogFrame getLogFrame()
logFrame.null if jlog runs inside the OMC)public void addErrorTab(java.lang.String stackID)
stackID - The STACKID of the error trace in the tabpublic ZoomManager getZoomManager()
public LogToolBar getToolBar()
public ContainerServicesBase getContainerServices()
public boolean inDebugMode()
true if jlog runs in debug modepublic void showErrorMessage(java.lang.String shortDescription,
java.lang.Throwable t)
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 errort - The throwable that caused the error (can be null).public void errorAcknowledged()
This method is executed when the user presses over the ACK button of the error widget and remove the constraints on the glass pane.
errorAcknowledged in interface MessageWidget.MessageWidgetListenershowErrorMessage for further implementation detailspublic ViewCoordinator getViewCoordinator()