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
Modifier and TypeFieldDescriptionstatic final String
Used as propertyName when a propertyChangeEvent is fired because the memory was updatedstatic final String
Used as propertyName when a propertyChangeEvent is fired because a message was setstatic final String
Used as name when no one is logged in.static final String
Used as name when the name is not available.static final String
Used as propertyName when a propertyChangeEvent is fired because the speed was updatedstatic final String
Used as propertyName when a propertyChangeEvent is fired because the user name was updated -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
action()
This method starts sending the SNMP request.Returns the date of the moment when this bean was last updated.long
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
Returns the update interval.Returns the login name of the user that is logged in.void
This method is called when a new value of the speed, memory, user or message is available.void
setUpdateInterval
(int i) Sets the update interval.void
Sets 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:
propertyChange
in interfacePropertyChangeListener
- See Also:
-