[SNMP4J] Creating index for adding row to table entry

Frank Fock fock at agentpp.com
Fri Oct 9 22:40:00 CEST 2009


I do not understand the question: If you know an
row instance, then you know the row index, since
columnar object class OID + index = columnar object
instance value.

Regards,
Frank

pradip de wrote:
> Hi Frank,
> As a follow up question to my previous query is it possible to retrieve the
> index of a row using a particular column value for that row instance which
> could be an OctetString? The reason for this question is that when I want to
> remove the entry I would need to know what the index is or a way to generate
> it.
> thanks,
> Pradip
> 
> On Fri, Oct 9, 2009 at 10:53 AM, pradip de <pradip.de at gmail.com> wrote:
> 
>> Thanks Frank for the quick reply. That was helpful.
>>
>> best,
>> Pradip
>>
>>
>> On Fri, Oct 9, 2009 at 12:00 AM, Frank Fock <fock at agentpp.com> wrote:
>>
>>> Hi Pradip,
>>>
>>> The toSubIndex(..) methods of the SMI types
>>> are used to form an index OID from SNMP values.
>>> It does *not* hash the values. It simply
>>> transforms them. For OctetStrings, it uses each
>>> characters decimal value as OID sub-identifier.
>>>
>>> To generate a integer index, you can use:
>>>
>>> IndexGenerator ig = new IndexGenerator(new Integer32(0));
>>> OID nextIndex = ig.nextSubIndex();
>>>
>>> Regards,
>>> Frank
>>>
>>> pradip de wrote:
>>>
>>>> Hi,
>>>> What is the typical technique for generating an index to add a row in a
>>>> table ? What does the OctetString.toSubIndex(boolean) actually do? Does
>>>> it
>>>> generate a OID index by using some kind of hashing mechanism over the
>>>> OCtetString? Should I use an OctetString that I can assume to be unique
>>>> for
>>>> each row I add and use it to create an index? I have no problem with this
>>>> but sometimes it generates a really long OID for that field. How do I get
>>>> index values of single integers incremented each time I add a row?
>>>> thanks,
>>>> Pradip
>>>> _______________________________________________
>>>> SNMP4J mailing list
>>>> SNMP4J at agentpp.org
>>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>>
>>> --
>>> AGENT++
>>> http://www.agentpp.com
>>> http://www.snmp4j.com
>>> http://www.mibexplorer.com
>>> http://www.mibdesigner.com
>>>
>>>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list