uk.org.iscream.cms.conient
Class HostDisplayPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byuk.org.iscream.cms.conient.HostDisplayPanel
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class HostDisplayPanel
extends JPanel

A HostDisplayPanel is simply a JPanel containing DataComponents which relate to various host attributes. Once created, it can be asked to update the data it displays by passing it an XML packet for the host it displaying for. This then updates all the DataComponents with the values in the packet.

Version:
$Id: HostDisplayPanel.java,v 1.53 2005/04/16 15:08:02 tdb Exp $
Author:
$Author: tdb $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  JPanel _center
          The centre panel, where all the data is displayed.
private  HashMap _components
          The components that we already know about connected with the attributes they care about are stored here.
private  PacketTimer _dataTimer
          The countdown timer for normal data packets
private  Thread _dataTimerThread
          A place for the data timer thread
private  JPanel _diskio
          The diskio panel
private  JPanel _disks
          The disks panel
private  JPanel _extra
          The extra panel, used to display unknown data in the packet
private  boolean _extraData
          Whether we a worrying about "extra" data by default we don't, but we look in the configuration in the constructor.
private  String _hostName
          The hostname this instance is keeping data for
private  JPanel _net
          The network panel
private  JPanel _north
          The north panel, currently used for the platform info button.
private  JPanel _services
          The services panel, currently used to display host service information from heartbeat packets.
 String REVISION
          The current CVS revision of this class
 
Fields inherited from class javax.swing.JPanel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HostDisplayPanel(String hostName)
          Creates a new Host Display Panel and adds all the appropriate DataComponents
 
Method Summary
private  void addDataComponent(DataComponent dataComponent)
          Adds a DataComponent to the list of already known data components.
 void addVisibleDataComponent(Container holder, VisibleDataComponent dataComponent)
          Adds a DataComponent to the list of already known data components.
private  void createDiskIOPanel(String attribute, XMLPacket packet)
          Creates the diskio components and adds them do the list of components.
private  void createDiskPanel(String attribute, XMLPacket packet)
          Creates the disk components and adds them do the list of components.
private  void createNetworkPanel(String attribute, XMLPacket packet)
          Creates the netwrok components and adds them do the list of components.
private  void createServicesPanel(String attribute)
          Creates the servicecheck components and adds them do the list of components.
private  boolean processPacket(XMLPacket packet)
          Process an incoming packet, updates the components.
 boolean updateHost(XMLPacket packet)
          This method takes an XMLPacket containing information about the host this HostDisplayPanel is currently displaying.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

_components

private HashMap _components
The components that we already know about connected with the attributes they care about are stored here.


_north

private final JPanel _north
The north panel, currently used for the platform info button.


_center

private final JPanel _center
The centre panel, where all the data is displayed.


_dataTimer

private final PacketTimer _dataTimer
The countdown timer for normal data packets


_dataTimerThread

private Thread _dataTimerThread
A place for the data timer thread


_hostName

private final String _hostName
The hostname this instance is keeping data for


_disks

private final JPanel _disks
The disks panel


_diskio

private final JPanel _diskio
The diskio panel


_net

private final JPanel _net
The network panel


_extra

private final JPanel _extra
The extra panel, used to display unknown data in the packet


_services

private final JPanel _services
The services panel, currently used to display host service information from heartbeat packets.


_extraData

private boolean _extraData
Whether we a worrying about "extra" data by default we don't, but we look in the configuration in the constructor.

Constructor Detail

HostDisplayPanel

public HostDisplayPanel(String hostName)
Creates a new Host Display Panel and adds all the appropriate DataComponents

Method Detail

updateHost

public boolean updateHost(XMLPacket packet)
This method takes an XMLPacket containing information about the host this HostDisplayPanel is currently displaying. It then updates all of the components with the new values. It also adds a standard StringDataComponent, should an attribute come up that there are no DataComponents associated with.

Parameters:
packet - the XML packet
Returns:
if the update was sucessful

processPacket

private boolean processPacket(XMLPacket packet)
Process an incoming packet, updates the components. If extra data is configured to be displayed, it will create a new StringDataComponent to display the data.

Parameters:
packet - the packet to process
Returns:
if the proceesing was successful

addDataComponent

private void addDataComponent(DataComponent dataComponent)
Adds a DataComponent to the list of already known data components. The list is aware of what packet attributes that a DataComponent is looking after.

Parameters:
dataComponent - the actual DataComponent

addVisibleDataComponent

public void addVisibleDataComponent(Container holder,
                                    VisibleDataComponent dataComponent)
Adds a DataComponent to the list of already known data components. The list is aware of what packet attributes that a DataComponent is looking after. Used for VISIBLE data components, as they are added to the display.

Parameters:
dataComponent - the actual DataComponent

createDiskPanel

private void createDiskPanel(String attribute,
                             XMLPacket packet)
Creates the disk components and adds them do the list of components. It also displays any relavant component. When a packet attribute is new to the system and when it starts "packet.disk.p" then this method is called. Thus it then accounts for all attributes relating to that new disk.

Parameters:
attribute - the name of the attribute first encountered
packet - the XMLPacket the data is being pulled from

createDiskIOPanel

private void createDiskIOPanel(String attribute,
                               XMLPacket packet)
Creates the diskio components and adds them do the list of components. When a packet attribute is new to the system and when it starts "packet.diskio.p" then this method is called. Thus it then accounts for all attributes relating to that new diskio.

Parameters:
attribute - the name of the attribute first encountered
packet - the XMLPacket the data is being pulled from

createNetworkPanel

private void createNetworkPanel(String attribute,
                                XMLPacket packet)
Creates the netwrok components and adds them do the list of components. When a packet attribute is new to the system and when it starts "packet.net.p" then this method is called. Thus it then accounts for all attributes relating to that network device.

Parameters:
attribute - the name of the attribute first encountered
packet - the XMLPacket the data is being pulled from

createServicesPanel

private void createServicesPanel(String attribute)
Creates the servicecheck components and adds them do the list of components. It also displays any relavant component. When a packet attribute is new to the system and when it starts "packet.services." then this method is called. Thus it then accounts for all attributes relating to that service.

Parameters:
attribute - the name of the attribute first encountered


Copyright © 2000-2003 i-scream. All Rights Reserved.