Package 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:
 PropertyChangeListener,EventListener
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringUsed as propertyName when a propertyChangeEvent is fired because the memory was updatedstatic final StringUsed as propertyName when a propertyChangeEvent is fired because a message was setstatic final StringUsed as name when no one is logged in.static final StringUsed as name when the name is not available.static final StringUsed as propertyName when a propertyChangeEvent is fired because the speed was updatedstatic final StringUsed as propertyName when a propertyChangeEvent is fired because the user name was updated - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaction()This method starts sending the SNMP request.Returns the date of the moment when this bean was last updated.longReturns the amount of RAM memory in bytes which is currently available.longgetSpeed()Returns the speed (bits per second) of the ethernet card interface.intReturns the update interval.Returns the login name of the user that is logged in.voidThis method is called when a new value of the speed, memory, user or message is available.voidsetUpdateInterval(int i) Sets the update interval.voidSets the update interval as String.Methods inherited from class uk.co.westhawk.snmp.beans.SNMPBean
addPropertyChangeListener, getBindAddress, getCommunityName, getHost, getMessage, getPort, getSocketType, removePropertyChangeListener, setBindAddress, setCommunityName, setHost, setPort, setPort, setSocketType 
- 
Field Details
- 
speedPropertyName
Used as propertyName when a propertyChangeEvent is fired because the speed was updated- See Also:
 
 - 
memoryPropertyName
Used as propertyName when a propertyChangeEvent is fired because the memory was updated- See Also:
 
 - 
userPropertyName
Used as propertyName when a propertyChangeEvent is fired because the user name was updated- See Also:
 
 - 
messagePropertyName
Used as propertyName when a propertyChangeEvent is fired because a message was set- See Also:
 
 - 
noLogin
Used as name when no one is logged in.- See Also:
 
 - 
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
Returns the login name of the user that is logged in. - 
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
Sets the update interval as String.- Parameters:
 i- the interval in msec as String- See Also:
 
 - 
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. - 
propertyChange
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:
 propertyChangein interfacePropertyChangeListener- See Also:
 
 
 -