[SNMP4J] baseagent : create table to a table

Jean.Bauwin at sita.aero Jean.Bauwin at sita.aero
Mon Jul 6 13:01:05 CEST 2009


Hello,

I try to create a table (it's ok) in my agent as this  :

    MOTableSubIndex[] subIndexes = new MOTableSubIndex[] { new 
MOTableSubIndex(SMIConstants.SYNTAX_INTEGER) };
                            MOTableIndex indexDef = new 
MOTableIndex(subIndexes, false);
                            MOColumn[] columns = new MOColumn[5];
                            int c = 0;
 
                            columns[c++] = new MOColumn(c, SMIConstants.
SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);// name-application
                            columns[c++] = new MOColumn(c, SMIConstants.
SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);// server
                            columns[c++] = new MOColumn(c, SMIConstants.
SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);// online
                            columns[c++] = new MOColumn(c, SMIConstants.
SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);// standby
                                //i want a table here instead of the this 
OCTET_STRING with 2 rows.
                            columns[c++] = new MOColumn(c, SMIConstants.
SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);// table connection 
????


                            ifTable = new DefaultMOTable(new OID(
"1.3.6.1.4.1.881.5.3.200.1.1.1"), indexDef, columns);
                             model = (MOMutableTableModel) ifTable
.getModel();
                            rowValues1 = new Variable[] {
                                        new OctetString("EVATIS-M"),
                                        new OctetString("EVATIS-B"),
                                        new OctetString("EVATIS-I"),
                                        new OctetString("CATS-A"),
                                        new OctetString("CATS-D")
                                        };
 
                            rowValues2 = new Variable[] {
                                        new OctetString("moaa-dep-derv-1"
),
                                        new OctetString("moaa-dep-derv-1"
),
                                        new OctetString("moaa-dep-derv-1"
),
                                        new OctetString("moaa-dep-derv-1"
),
                                        new OctetString("moaa-dep-derv-1"
),
                                        };
 
                            rowValues3 = new Variable[] {
                                        new OctetString("0"),
                                        new OctetString("0"),
                                        new OctetString("0"),
                                        new OctetString("0"),
                                        new OctetString("0")
                                        };
 
                            rowValues4 = new Variable[] {
                                        new OctetString("0"),
                                        new OctetString("0"),
                                        new OctetString("0"),
                                        new OctetString("0"),
                                        new OctetString("0")
                                        };
                            rowValues5 = new Variable[] {
                                        new OctetString("---"),
                                        new OctetString("---"),
                                        new OctetString("---"),
                                        new OctetString("---"),
                                        new OctetString("---")
                                        };
 
                            model.addRow(new DefaultMOMutableRow2PC(new 
OID("1"), rowValues1));
                            model.addRow(new DefaultMOMutableRow2PC(new 
OID("2"), rowValues2));
                            model.addRow(new DefaultMOMutableRow2PC(new 
OID("3"), rowValues3));
                            model.addRow(new DefaultMOMutableRow2PC(new 
OID("4"), rowValues4));
                            model.addRow(new DefaultMOMutableRow2PC(new 
OID("5"), rowValues5));
 

i would like to create in the column 5 of my table a
table with 2 entry.
I don't understand why i can't add this table.
Could you help me to understand how th create a table into a table ?


Thx for your help .

Jean Bauwin
Software Engineer
SITA Air Traffic Solutions 
Tel:  +33 1 46 41 10 80
Fax: +33 1 46 41 10 32


More information about the SNMP4J mailing list