[SNMP4J] getTable for Rows

Marco.Bresciani at alcatel.it Marco.Bresciani at alcatel.it
Wed Mar 22 16:50:06 CET 2006


Frank Fock <fock at agentpp.com>
21/03/2006 20.28
 
        To:     Marco BRESCIANI/IT/ALCATEL at ALCATEL
        cc:     snmp4j at agentpp.org
        Subject:        Re: [SNMP4J] getTable for Rows
>> value, say "4", I can set lowbound to 3 and highbound to 4. Okay.
>
>> strange "4.0" and "4.1" as rowindex! Then... how/can I set low and 
high?
>>
>Use "4" as lower bound for "4.0" and "4.0.2^31-1" for "4.1".
>SNMP4J 1.7 has also the OID.predecessor() and OID.successor()
>methods to easily compute predecessor and successor OIDs.

I've used this piece of code in order to retrieve bounds:

/* row index management */
if (indexOid.contains(".") == true) {
    lowBound = new OID(indexOid).predecessor();
} else {
    tempValue = new Integer(indexOid).intValue();
    if (tempValue == 0) {
        lowBound = null;
    } else {
        lowBound = new OID("" + (int) (tempValue - 1));
    }
}
//lowBound = new OID(indexOid).predecessor();
highBound = new OID(indexOid);

and the "normal" index (indexOid=3, indexOid=4 and so) use indexOid-1 as 
index lowerbound and indexOid as uppderbound. When it receives "4.0" it 
evaluates "4" as lowerbound and "4.0" as upperbound... but it gives me 
back no data.

Marco



More information about the SNMP4J mailing list