[SNMP4J] Set operation on Table column, not correct index

Frank Fock fock at agentpp.com
Fri Dec 22 17:21:40 CET 2006


Hi Angela,

MOTableCellInfo.getColumn returns the column index
which is *zero* based. An zero column index refers
to the first accessible column in the table, which
might be the column sub-ID "2".

Hope this helps.

Best regards,
Frank

gao weihua wrote:
> Hi, all,
> I am making development based  on snmp4j-agent to manage device. but I have
> a problem when send "set" to snmp4j-agent.
> 
> As we all know, when we add new row to Table, it actually stored in 
> sortmap,
> with format<index, value>, here "index" is created by new OID("xx"), xx is
> an integer.
> when we want a row, we use TableModel.getrow(index), if i not make a
> mistake, here index equals to index in <index, value>. but when I make a 
> try
> to modify a column by set command, the index here will not be obtained
> correctly, which is done in DefaultMoTable.java
> public void prepare(SubRequest request) {
>    OID cellOID = request.getVariableBinding().getOid();
>    MOTableCellInfo cell = getCellInfo(cellOID);
>    if (cell.getIndex() == null) {
>      request.getStatus().setErrorStatus(PDU.inconsistentName);
>      return;
>    }
> ......
> }
> 
> I debug it in eclipse, the index is obtained in line MOTableCellInfo cell =
> getCellInfo(cellOID); but not got the right value.
> 
> For eg, Table entry oid : x.x.x.2.2.1, with column x.x.x.2.2.1.1,
> x.x.x.2.2.1.2,  x.x.x.2.2.1.3, The table has only one row, by addrow(new
> OID("1"), varailbe[] ). I try to set new value to x.x.x.2.2.1.2, but the
> index caculated in MOTableCellInfo cell = getCellInfo(cellOID) always be 0,
> but the actual value is 1.
> 
> Here anybody know what I said above is the truth of snmp4j-agent?
> or I just have make some mis-understand of snmp4j-agent?
> 
> best regards
> Angela
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

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




More information about the SNMP4J mailing list