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 InterfaceIndexesBean

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

All Implemented Interfaces:
  java.util.Observer, java.lang.Runnable

public class InterfaceIndexesBean
extends SNMPRunBean
implements java.util.Observer

This bean collects information about the number of interfaces on a system and their index.

The number is the number of network interfaces (regardless of their current state) present on this system. The number will remain the same untill the next time the SNMP server is restarted. The interfaces may go up and down while running.

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.13 $ $Date: 2006/01/25 18:08:55 $
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()`, `InterfaceGetNextPdu`

Field Summary

Fields inherited from class uk.co.westhawk.snmp.beans.SNMPRunBean
`interval, me, running`

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

Constructor Summary
`InterfaceIndexesBean()` The default constructor.
`InterfaceIndexesBean(java.lang.String h, int p)` The constructor that will set the host and the port no.
`InterfaceIndexesBean(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.

Method Summary
`void` | `action()` This method starts the action of the bean.
`int` | `getInterfaceCount()` Returns the number of current interfaces.
`java.util.Enumeration` | `getInterfaceIndexes()` Returns the indexes (as Strings) of the current interfaces (the list of ifIndex).
`java.util.Set` | `getInterfaceIndexSet()` Returns the indexes (as Strings) of the current interfaces (the list of ifIndex).
`java.util.Date` | `getLastUpdateDate()` Returns the date of the moment when this bean was last updated.
`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.SNMPRunBean
`getUpdateInterval, isRunning, setRunning, setUpdateInterval, setUpdateInterval`

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

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

Constructor Detail

### InterfaceIndexesBean

    public InterfaceIndexesBean()

  The default constructor.

### InterfaceIndexesBean

    public InterfaceIndexesBean(java.lang.String h,
                                int p)

  The constructor that will set the host and the port no.

Parameters:
  `h` - the hostname
  `p` - the port no
See Also:
  `SNMPBean.setHost(java.lang.String)`, `SNMPBean.setPort(int)`

### InterfaceIndexesBean

    public InterfaceIndexesBean(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.

Parameters:
  `h` - the hostname
  `p` - the port no
  `b` - the local bind address
Since:
  4_14
See Also:
  `SNMPBean.setHost(java.lang.String)`, `SNMPBean.setPort(int)`, `SNMPBean.setBindAddress(java.lang.String)`

Method Detail

### 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

### getInterfaceIndexes

    public java.util.Enumeration getInterfaceIndexes()

  Returns the indexes (as Strings) of the current interfaces (the list of ifIndex).

### getInterfaceIndexSet

    public java.util.Set getInterfaceIndexSet()

  Returns the indexes (as Strings) of the current interfaces (the list of ifIndex).

  Since:
    4_14

### getInterfaceCount

    public int getInterfaceCount()

  Returns the number of current interfaces.

### action

    public void action()

  This method starts the action of the bean. It will initialises all variables before starting.

  Specified by:
    `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.

  Specified by:
    `run` in interface `java.lang.Runnable`
  Specified by:
    `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)`

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