Class NcdPerfDataBean

java.lang.Object
uk.co.westhawk.snmp.beans.SNMPBean
uk.co.westhawk.snmp.beans.NcdPerfDataBean
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class NcdPerfDataBean extends SNMPBean implements PropertyChangeListener

This bean collects information about a IBM Network Computer.

It provide the following data:

  • the speed of the Ethernet Card
  • the available memory in bytes
  • the name of the user that is logged in

A message will be set if some of the data is not available

This class uses the NCDware v3.2 MIB, which was very kindly provided to me by Network Computing Devices, inc (NCD). This MIB is an extention of the older versions of the MIB

The properties in the parent classes should be set, before calling the action() method. Via a PropertyChangeEvent the application/applet will be notified.

Version:
$Revision: 1.12 $ $Date: 2006/01/17 17:43:53 $
Author:
Birgit Arkesteijn
See Also:
  • Field Details

    • speedPropertyName

      public static final String speedPropertyName
      Used as propertyName when a propertyChangeEvent is fired because the speed was updated
      See Also:
    • memoryPropertyName

      public static final String memoryPropertyName
      Used as propertyName when a propertyChangeEvent is fired because the memory was updated
      See Also:
    • userPropertyName

      public static final String userPropertyName
      Used as propertyName when a propertyChangeEvent is fired because the user name was updated
      See Also:
    • messagePropertyName

      public static final String messagePropertyName
      Used as propertyName when a propertyChangeEvent is fired because a message was set
      See Also:
    • noLogin

      public static final String noLogin
      Used as name when no one is logged in.
      See Also:
    • noName

      public static final String noName
      Used as name when the name is not available.
      See Also:
  • Constructor Details

    • NcdPerfDataBean

      public NcdPerfDataBean()
      The default constructor.
  • Method Details

    • getSpeed

      public long getSpeed()
      Returns the speed (bits per second) of the ethernet card interface.
      Returns:
      the speed (b/s)
    • getMemory

      public long getMemory()
      Returns the amount of RAM memory in bytes which is currently available.
      Returns:
      the memory in bytes
    • getUserName

      public String getUserName()
      Returns the login name of the user that is logged in.
      Returns:
      the user name
      See Also:
    • getUpdateInterval

      public int getUpdateInterval()
      Returns the update interval. This is the interval that the bean will sleep between 2 requests.
      Returns:
      the update interval in msec
      See Also:
    • setUpdateInterval

      public void setUpdateInterval(int i)
      Sets the update interval. This is the interval that the bean will sleep between 2 requests. The default will be 3000 (= 3 sec).
      Parameters:
      i - the interval in msec
      See Also:
    • setUpdateInterval

      public void setUpdateInterval(String i)
      Sets the update interval as String.
      Parameters:
      i - the interval in msec as String
      See Also:
    • getLastUpdateDate

      public Date getLastUpdateDate()
      Returns the date of the moment when this bean was last updated. This might be null when the first time the update was not finished.
      Returns:
      the last update date
    • action

      public void action()
      This method starts sending the SNMP request. All properties should be set before this method is called. The actual sending will take place in the run method. It makes a new snmp context and initialises all variables before starting.
      Specified by:
      action in class SNMPBean
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      This method is called when a new value of the speed, memory, user or message is available. It will propagate this event to any listeners.
      Specified by:
      propertyChange in interface PropertyChangeListener
      See Also: