[SNMP4J] Dynamically build VariableBinding[]

Jerome Jabson jjabson at yahoo.com
Thu Feb 11 02:51:43 CET 2010


Hello,

I'm trying to dynamically build a VariableBinding[]. However, I am having trouble populating the value of I'm trying to set:

                            while ((currentLine = myInput.readLine()) != null){
                                int idx = currentLine.indexOf(",");
                                if (idx != -1){
                                    int idxCount = 0;
                                    String obj = currentLine.substring(0, idx);
                                    String displayValue = currentLine.substring(idx);
                                    instanceList = oidHT.get(obj);
                                    testcase = tcHash.get(obj);
                                    String vbSyn = testcase.getTranslatedSyntax();
                                    varBindColumnarValues[idxCount] = new VariableBinding(new OID(instanceList.get(idxCount), new vbSyn(displayValue)));
                                }
                            }

In the code above I a reading a file with a Columnar Object name and value. I am trying to build a VariableBinding[] called varBindColumnarValues. I have and Object called testcase which holds TC type of the Columnar Object (i.e. Integer32, OctetString, etc...), which is what I am trying to set by new vbSyn.This is not working for obvious reasons, I just want to know how can I build the Variable binding dynamically so that I can pass the VariableBinding[] to create a table. 

Thanks in advance for your help,
Jerome



      



More information about the SNMP4J mailing list