uk.co.westhawk.snmp.pdu
Class UpSincePdu
java.lang.Object
|
+--java.util.Observable
|
+--uk.co.westhawk.snmp.stack.Pdu
|
+--uk.co.westhawk.snmp.pdu.UpSincePdu
- public class UpSincePdu
- extends Pdu
The UpSincePdu class will send a Get request for the sysUpTime and
will calculate that date the system rebooted the last time.
- Version:
- $Revision: 3.13 $ $Date: 2002/10/10 15:26:15 $
- Author:
- Tim Panton
Field Summary |
static java.lang.String |
SYSUPTIME
The oid of sysUpTime |
Method Summary |
java.util.Date |
getDate()
Returns the date when the system went up, (sysUpTime). |
protected void |
new_value(int n,
varbind res)
The value of the request is set. |
protected void |
tell_them()
The methods notifies all observers. |
Methods inherited from class uk.co.westhawk.snmp.stack.Pdu |
addOid, addOid, addOid, addOid, addOid, addToTrans, getContext, getErrorIndex, getErrorStatus, getErrorStatusString, getMsgType, getReqId, getRequestVarbinds, getResponseVarbinds, isTimedOut, notifyObservers, send, send, send, sendme, setErrorIndex, setErrorStatus, setErrorStatus, setMsgType, setRetryIntervals, toString, toString, waitForSelf |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SYSUPTIME
public static final java.lang.String SYSUPTIME
- The oid of sysUpTime
UpSincePdu
public UpSincePdu(SnmpContextBasisFace con,
java.util.Observer o)
throws PduException,
java.io.IOException
- Constructor that will send the request immediately.
- Parameters:
con
- The context of the requesto
- the Observer that will be notified when the answer is received
getDate
public java.util.Date getDate()
- Returns the date when the system went up, (sysUpTime).
- Returns:
- the date
new_value
protected void new_value(int n,
varbind res)
- The value of the request is set. This will be called by
Pdu.fillin().
- Overrides:
new_value
in class Pdu
- Parameters:
n
- the index of the valuea_var
- the value- See Also:
Pdu.new_value(int, uk.co.westhawk.snmp.stack.varbind)
tell_them
protected void tell_them()
- The methods notifies all observers.
This will be called by Pdu.fillin().
Unless an exception occurred the Object to the update() method of the
Observer will be a Date.
In the case of an exception, that exception will be passed.
- Overrides:
tell_them
in class Pdu