SNMP Stack 5_1

uk.co.westhawk.snmp.pdu
Class OneIntPdu

java.lang.Object
  |
  +--java.util.Observable
        |
        +--uk.co.westhawk.snmp.stack.Pdu
              |
              +--uk.co.westhawk.snmp.stack.GetPdu
                    |
                    +--uk.co.westhawk.snmp.pdu.OneIntPdu

public class OneIntPdu
extends GetPdu

The OneIntPdu class will ask for one (1) object (oid) of the AsnInteger type, based on the Get request.

Unless an exception occurred the Object to the update() method of the Observer will be an Integer. In the case of an exception, that exception will be passed.

For SNMPv3: The receiver of a request PDU acts as the authoritative engine.

Version:
$Revision: 3.13 $ $Date: 2006/01/17 17:43:53 $
Author:
Birgit Arkesteijn
See Also:
GetPdu_vec

Field Summary
 
Fields inherited from class uk.co.westhawk.snmp.stack.Pdu
added, answered, context, encodedPacket, errind, errstat, msg_type, reqVarbinds, respVarbinds, snmpv3MsgId
 
Constructor Summary
OneIntPdu(SnmpContextBasisFace con)
          Constructor.
OneIntPdu(SnmpContextBasisFace con, java.lang.String oid)
          Constructor that will send the request immediately.
OneIntPdu(SnmpContextBasisFace con, java.lang.String oid, java.util.Observer o)
          Constructor that will send the request immediately.
 
Method Summary
 java.lang.Integer getValue()
          Returns the value (the answer) of this request.
protected  void new_value(int n, varbind res)
          The value of the request is set.
protected  void tell_them()
          This method 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, isExpectingResponse, isTimedOut, notifyObservers, printVars, 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
 

Constructor Detail

OneIntPdu

public OneIntPdu(SnmpContextBasisFace con)
Constructor.

Parameters:
con - The context of the request

OneIntPdu

public OneIntPdu(SnmpContextBasisFace con,
                 java.lang.String oid)
          throws PduException,
                 java.io.IOException
Constructor that will send the request immediately. No Observer is set.

Parameters:
con - the SnmpContextBasisFace
oid - the oid

OneIntPdu

public OneIntPdu(SnmpContextBasisFace con,
                 java.lang.String oid,
                 java.util.Observer o)
          throws PduException,
                 java.io.IOException
Constructor that will send the request immediately.

Parameters:
con - the SnmpContextBasisFace
oid - the oid
o - the Observer that will be notified when the answer is received
Method Detail

getValue

public java.lang.Integer getValue()
Returns the value (the answer) of this request.

Returns:
the value

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 value
See Also:
Pdu.new_value(int, uk.co.westhawk.snmp.stack.varbind)

tell_them

protected void tell_them()
This method 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 an Integer. In the case of an exception, that exception will be passed.

Overrides:
tell_them in class Pdu

SNMP Stack 5_1