Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 5_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.co.westhawk.snmp.beans
Class NcdPerfDataBean

    java.lang.Object
      |
      +--uk.co.westhawk.snmp.beans.SNMPBean
            |
            +--uk.co.westhawk.snmp.beans.NcdPerfDataBean

All Implemented Interfaces:
  java.util.EventListener, java.beans.PropertyChangeListener

public class NcdPerfDataBean
extends SNMPBean
implements java.beans.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:
  `SNMPBean.setHost(java.lang.String)`, `SNMPBean.setPort(int)`, `SNMPBean.setCommunityName(java.lang.String)`, `setUpdateInterval(int)`, `setUpdateInterval(String)`, `SNMPBean.addPropertyChangeListener(java.beans.PropertyChangeListener)`, `SNMPBean.action()`

Field Summary
`static java.lang.String` | `memoryPropertyName` Used as propertyName when a propertyChangeEvent is fired because the memory was updated
`static java.lang.String` | `messagePropertyName` Used as propertyName when a propertyChangeEvent is fired because a message was set
`static java.lang.String` | `noLogin` Used as name when no one is logged in.
`static java.lang.String` | `noName` Used as name when the name is not available.
`static java.lang.String` | `speedPropertyName` Used as propertyName when a propertyChangeEvent is fired because the speed was updated
`static java.lang.String` | `userPropertyName` Used as propertyName when a propertyChangeEvent is fired because the user name was updated

Fields inherited from class uk.co.westhawk.snmp.beans.SNMPBean
`bindAddr, community, context, host, message, port, propertyChangeListener, socketType`

Constructor Summary
`NcdPerfDataBean()` The default constructor.

Method Summary
`void` | `action()` This method starts sending the SNMP request.
`java.util.Date` | `getLastUpdateDate()` Returns the date of the moment when this bean was last updated.
`long` | `getMemory()` Returns the amount of RAM memory in bytes which is currently available.
`long` | `getSpeed()` Returns the speed (bits per second) of the ethernet card interface.
`int` | `getUpdateInterval()` Returns the update interval.
`java.lang.String` | `getUserName()` Returns the login name of the user that is logged in.
`void` | `propertyChange(java.beans.PropertyChangeEvent e)` This method is called when a new value of the speed, memory, user or message is available.
`protected void` | `setMessage(java.lang.String st)` Returns the message (if any).
`void` | `setUpdateInterval(int i)` Sets the update interval.
`void` | `setUpdateInterval(java.lang.String i)` Sets the update interval as String.

Methods inherited from class uk.co.westhawk.snmp.beans.SNMPBean
`addPropertyChangeListener, firePropertyChange, getBindAddress, getCommunityName, getHost, getMessage, getPort, getSocketType, isHostPortReachable, removePropertyChangeListener, setBindAddress, setCommunityName, setHost, setPort, setPort, setSocketType`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### speedPropertyName

    public static final java.lang.String speedPropertyName

  Used as propertyName when a propertyChangeEvent is fired because the speed was updated

  See Also:
    Constant Field Values

### memoryPropertyName

    public static final java.lang.String memoryPropertyName

  Used as propertyName when a propertyChangeEvent is fired because the memory was updated

  See Also:
    Constant Field Values

### userPropertyName

    public static final java.lang.String userPropertyName

  Used as propertyName when a propertyChangeEvent is fired because the user name was updated

  See Also:
    Constant Field Values

### messagePropertyName

    public static final java.lang.String messagePropertyName

  Used as propertyName when a propertyChangeEvent is fired because a message was set

  See Also:
    Constant Field Values

### noLogin

    public static final java.lang.String noLogin

  Used as name when no one is logged in.

  See Also:
    Constant Field Values

### noName

    public static final java.lang.String noName

  Used as name when the name is not available.

  See Also:
    Constant Field Values

Constructor Detail

### NcdPerfDataBean

    public NcdPerfDataBean()

  The default constructor.

Method Detail

### 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 java.lang.String getUserName()

  Returns the login name of the user that is logged in.

  Returns:
    the user name
  See Also:
    `noLogin`, `noName`

### 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(int)`, `setUpdateInterval(String)`

### 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:
    `getUpdateInterval()`, `setUpdateInterval(String)`

### setUpdateInterval

    public void setUpdateInterval(java.lang.String i)

  Sets the update interval as String.

  Parameters:
    `i` - the interval in msec as String
  See Also:
    `getUpdateInterval()`, `setUpdateInterval(int)`

### getLastUpdateDate

    public java.util.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`

### setMessage

    protected void setMessage(java.lang.String st)

  Description copied from class: `SNMPBean`
  Returns the message (if any). The message is used to give the user feedback if anything is happened (usually when something went wrong) with the connection.

  Overrides:
    `setMessage` in class `SNMPBean`
  Parameters:
    `st` - the message string
  See Also:
    `SNMPBean.getMessage()`

### propertyChange

    public void propertyChange(java.beans.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 `java.beans.PropertyChangeListener`
  See Also:
    `speedPropertyName`, `memoryPropertyName`, `userPropertyName`, `messagePropertyName`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 5_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD