Package uk.co.westhawk.snmp.pdu
Class InterfacePdu
java.lang.Object
java.util.Observable
uk.co.westhawk.snmp.stack.Pdu
uk.co.westhawk.snmp.stack.GetPdu
uk.co.westhawk.snmp.pdu.InterfacePdu
- Direct Known Subclasses:
InterfacesPdu
The InterfacePdu class asks one interface for information, useful for admin
purposes.
See IF-MIB.
- Version:
- $Revision: 3.19 $ $Date: 2006/11/29 16:12:50 $
- Author:
- Tim Panton
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInterfacePdu
(SnmpContextBasisFace con, Observer o, int interf) Constructor that will send the request immediately. -
Method Summary
Modifier and TypeMethodDescriptionReturns the description of the interface.int
getIndex()
Returns the index of the interface.long
Returns the total number of octets received on the interface, including framing characters.static int
Returns how many interfaces are present.int
Returns the operational state of the interface.Returns the string representation of the operational state of the interface.getOperStatusString
(int status) Returns the string representation of a operational state.long
Returns the total number of octets transmitted outOctets of the interface, including framing characters.long
getSpeed
(InterfacePdu old) Calculates the speed of the interface.long
Returns the time (in hundredths of a second) since the network management portion of the system was last re-initialized.Methods inherited from class uk.co.westhawk.snmp.stack.Pdu
addOid, addOid, addOid, addOid, addOid, getContext, getErrorIndex, getErrorStatus, getErrorStatusString, getMsgType, getReqId, getRequestVarbinds, getResponseVarbinds, getRetryIntervals, isTimedOut, notifyObservers, send, send, setRetryIntervals, toString, waitForSelf
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers
-
Field Details
-
UP
The current operational state is up- See Also:
-
DOWN
The current operational state is down- See Also:
-
TESTING
The current operational state is testing- See Also:
-
UNKNOWN
The current operational state is unknown- See Also:
-
-
Constructor Details
-
InterfacePdu
public InterfacePdu(SnmpContextBasisFace con, Observer o, int interf) throws PduException, IOException Constructor that will send the request immediately.- Parameters:
con
- the SnmpContextBasisFaceo
- the Observer that will be notified when the answer is receivedinterf
- the index of the requested interface- Throws:
PduException
IOException
-
-
Method Details
-
getIndex
public int getIndex()Returns the index of the interface.- Returns:
- the index
-
getSysUpTime
public long getSysUpTime()Returns the time (in hundredths of a second) since the network management portion of the system was last re-initialized. -
getDescription
Returns the description of the interface.- Returns:
- the description
-
getOperStatus
public int getOperStatus()Returns the operational state of the interface.- Returns:
- the operational state
-
getOperStatusString
Returns the string representation of the operational state of the interface.- Returns:
- the operational state as string
- See Also:
-
getOperStatusString
Returns the string representation of a operational state.- See Also:
-
getInOctet
public long getInOctet()Returns the total number of octets received on the interface, including framing characters. -
getOutOctet
public long getOutOctet()Returns the total number of octets transmitted outOctets of the interface, including framing characters. -
getSpeed
Calculates the speed of the interface. This is done by providing the method with the previous value of this interface. An interface is marked by its index.- Parameters:
old
- The previous value of this interface
-
getNumIfs
Returns how many interfaces are present.- Returns:
- the number of interfaces
- Throws:
PduException
IOException
-