public class OneInterfaceBean extends SNMPRunBean implements java.util.Observer
This bean collects information about one interface.
The properties in the parent classes should be set, before calling the action() method. Via a PropertyChangeEvent the application/applet will be notified.
SNMPBean.setHost(java.lang.String)
,
SNMPBean.setPort(int)
,
SNMPBean.setCommunityName(java.lang.String)
,
SNMPRunBean.setUpdateInterval(int)
,
setIndex(int)
,
SNMPBean.addPropertyChangeListener(java.beans.PropertyChangeListener)
,
SNMPBean.action()
,
InterfaceGetNextPdu
,
InterfaceIndexesBean
interval, me, running
bindAddr, community, context, host, message, port, propertyChangeListener, socketType
Constructor and Description |
---|
OneInterfaceBean()
The default constructor.
|
OneInterfaceBean(java.lang.String h,
int p)
The constructor that will set the host and the port no.
|
OneInterfaceBean(java.lang.String h,
int p,
java.lang.String b)
The constructor that will set the host, the port no and the local
bind address.
|
Modifier and Type | Method and Description |
---|---|
void |
action()
This method starts sending the SNMP request.
|
java.lang.String |
getDescription()
Returns the description of the interface.
|
int |
getIndex()
Returns the index of the interface.
|
java.util.Date |
getLastUpdateDate()
Returns the date of the moment when this bean was last updated.
|
java.lang.String |
getOperStatusString()
Returns the operation state of the interface.
|
long |
getSpeed()
Returns the speed (bits per second) of the interface.
|
void |
run()
The run method according to the Runnable interface.
|
void |
setIndex(int i)
Sets the index of the interface that will be requested.
|
void |
update(java.util.Observable obs,
java.lang.Object ov)
The update method according to the Observer interface, it will be
called when the Pdu response is received.
|
getUpdateInterval, isRunning, setRunning, setUpdateInterval, setUpdateInterval
addPropertyChangeListener, firePropertyChange, getBindAddress, getCommunityName, getHost, getMessage, getPort, getSocketType, isHostPortReachable, removePropertyChangeListener, setBindAddress, setCommunityName, setHost, setMessage, setPort, setPort, setSocketType
public OneInterfaceBean()
public OneInterfaceBean(java.lang.String h, int p)
h
- the hostnamep
- the port noSNMPBean.setHost(java.lang.String)
,
SNMPBean.setPort(int)
public OneInterfaceBean(java.lang.String h, int p, java.lang.String b)
h
- the hostnamep
- the port nob
- the local bind addressSNMPBean.setHost(java.lang.String)
,
SNMPBean.setPort(int)
,
SNMPBean.setBindAddress(java.lang.String)
public void setIndex(int i)
i
- the indexgetIndex()
public int getIndex()
setIndex(int)
public java.lang.String getDescription()
public java.lang.String getOperStatusString()
public long getSpeed()
public java.util.Date getLastUpdateDate()
public void action()
public void run()
run
in interface java.lang.Runnable
run
in class SNMPRunBean
SNMPRunBean.isRunning()
public void update(java.util.Observable obs, java.lang.Object ov)
update
in interface java.util.Observer
SNMPBean.addPropertyChangeListener(java.beans.PropertyChangeListener)