uk.co.westhawk.snmp.beans
Class NTUserNamesBean
java.lang.Object
|
+--uk.co.westhawk.snmp.beans.SNMPBean
|
+--uk.co.westhawk.snmp.beans.SNMPRunBean
|
+--uk.co.westhawk.snmp.beans.NTUserNamesBean
- All Implemented Interfaces:
- java.util.Observer, java.lang.Runnable
- public class NTUserNamesBean
- extends SNMPRunBean
- implements java.util.Observer
This bean collects the names of the network users installed on
a NT server. The NT mib is described in the
LAN Manager MIB II for Windows NT Objects .
You will have to register to the MSDN before accessing this page.
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.10 $ $Date: 2002/10/10 15:13:56 $
- Author:
- Birgit Arkesteijn
- See Also:
SNMPBean.setHost(java.lang.String)
,
SNMPBean.setPort(int)
,
SNMPBean.setCommunityName(java.lang.String)
,
SNMPRunBean.setUpdateInterval(int)
,
SNMPBean.addPropertyChangeListener(java.beans.PropertyChangeListener)
,
SNMPBean.action()
,
GetNextPdu
Constructor Summary |
NTUserNamesBean()
The default constructor. |
NTUserNamesBean(java.lang.String h,
int p)
The constructor that will set the host and the port no. |
Method Summary |
void |
action()
This method starts the action of the bean. |
int |
getCount()
Returns the number of NT network users. |
java.lang.String |
getIndex(java.lang.String name)
Returns the index of one of the users. |
java.util.Enumeration |
getIndices()
Returns the indices of the NT network users. |
java.util.Date |
getLastUpdateDate()
Returns the date of the moment when this bean was last updated. |
java.util.Enumeration |
getNames()
Returns the names of the NT network users (the list
of svUserName). |
void |
run()
Implements the running of the bean. |
void |
update(java.util.Observable obs,
java.lang.Object ov)
This method is called when the Pdu response is received. |
Methods inherited from class uk.co.westhawk.snmp.beans.SNMPBean |
addPropertyChangeListener, firePropertyChange, getCommunityName, getHost, getMessage, getPort, isHostPortReachable, removePropertyChangeListener, setCommunityName, setHost, setMessage, setPort, setPort |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
svUserName
public static final java.lang.String svUserName
NTUserNamesBean
public NTUserNamesBean()
- The default constructor.
NTUserNamesBean
public NTUserNamesBean(java.lang.String h,
int p)
- The constructor that will set the host and the port no.
- Parameters:
h
- the hostnamep
- the port no- See Also:
SNMPBean.setHost(java.lang.String)
,
SNMPBean.setPort(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
getIndices
public java.util.Enumeration getIndices()
- Returns the indices of the NT network users.
The OID of this network user is a concatenation of the
name (svUserName) OID and the network user specific index.
The index should be used to get the other properties of this user.
- See Also:
getIndex(String)
,
svUserName
getIndex
public java.lang.String getIndex(java.lang.String name)
- Returns the index of one of the users.
The OID of this network user is a concatenation of the
name (svUserName) OID and the network user specific index.
The index should be used to get the other properties of this user.
- Parameters:
name
- The name of the user- Returns:
- the user index, might be null if no user with such name
exists
- See Also:
getIndices()
,
getNames()
getNames
public java.util.Enumeration getNames()
- Returns the names of the NT network users (the list
of svUserName).
getCount
public int getCount()
- Returns the number of NT network users.
action
public void action()
- This method starts the action of the bean. It will initialises
all variables before starting.
- Overrides:
action
in class SNMPBean
run
public void run()
- Implements the running of the bean.
It will send the Pdu, if the previous one is not still in flight.
- Overrides:
run
in class SNMPRunBean
- See Also:
SNMPRunBean.isRunning()
update
public void update(java.util.Observable obs,
java.lang.Object ov)
- This method is called when the Pdu response is received. When all
answers are received it will fire the property change event.
The answers are stored in a hashtable, this is done because the speed
can only be calculated with the previous answer.
- Specified by:
update
in interface java.util.Observer
- See Also:
SNMPBean.addPropertyChangeListener(java.beans.PropertyChangeListener)