2 * This Java file has been generated by smidump 0.4.5. Do not edit!
3 * It is intended to be used within a Java AgentX sub-agent environment.
5 * $Id: ProtocolDirTable.java 4432 2006-05-29 16:21:11Z strauss $
9 This class represents a Java AgentX (JAX) implementation of
10 the table protocolDirTable defined in RMON2-MIB.
17 import java.util.Vector;
20 import jax.AgentXVarBind;
21 import jax.AgentXResponsePDU;
22 import jax.AgentXSetPhase;
23 import jax.AgentXTable;
24 import jax.AgentXEntry;
26 public class ProtocolDirTable extends AgentXTable
30 private final static long[] OID = {1, 3, 6, 1, 2, 1, 16, 11, 2, 1};
33 public ProtocolDirTable()
35 oid = new AgentXOID(OID);
37 // register implemented columns
38 columns.addElement(new Long(3));
39 columns.addElement(new Long(4));
40 columns.addElement(new Long(5));
41 columns.addElement(new Long(6));
42 columns.addElement(new Long(7));
43 columns.addElement(new Long(8));
44 columns.addElement(new Long(9));
45 columns.addElement(new Long(10));
48 public ProtocolDirTable(boolean shared)
52 oid = new AgentXOID(OID);
54 // register implemented columns
55 columns.addElement(new Long(3));
56 columns.addElement(new Long(4));
57 columns.addElement(new Long(5));
58 columns.addElement(new Long(6));
59 columns.addElement(new Long(7));
60 columns.addElement(new Long(8));
61 columns.addElement(new Long(9));
62 columns.addElement(new Long(10));
65 public AgentXVarBind getVarBind(AgentXEntry entry, long column)
67 AgentXOID oid = new AgentXOID(getOID(), column, entry.getInstance());
69 switch ((int)column) {
70 case 3: // protocolDirLocalIndex
72 int value = ((ProtocolDirEntry)entry).get_protocolDirLocalIndex();
73 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, value);
75 case 4: // protocolDirDescr
77 byte[] value = ((ProtocolDirEntry)entry).get_protocolDirDescr();
78 return new AgentXVarBind(oid, AgentXVarBind.OCTETSTRING, value);
80 case 5: // protocolDirType
82 byte[] value = ((ProtocolDirEntry)entry).get_protocolDirType();
83 return new AgentXVarBind(oid, AgentXVarBind.OCTETSTRING, value);
85 case 6: // protocolDirAddressMapConfig
87 int value = ((ProtocolDirEntry)entry).get_protocolDirAddressMapConfig();
88 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, value);
90 case 7: // protocolDirHostConfig
92 int value = ((ProtocolDirEntry)entry).get_protocolDirHostConfig();
93 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, value);
95 case 8: // protocolDirMatrixConfig
97 int value = ((ProtocolDirEntry)entry).get_protocolDirMatrixConfig();
98 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, value);
100 case 9: // protocolDirOwner
102 byte[] value = ((ProtocolDirEntry)entry).get_protocolDirOwner();
103 return new AgentXVarBind(oid, AgentXVarBind.OCTETSTRING, value);
105 case 10: // protocolDirStatus
107 int value = ((ProtocolDirEntry)entry).get_protocolDirStatus();
108 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, value);
115 public int setEntry(AgentXSetPhase phase,
121 switch ((int)column) {
122 case 4: // protocolDirDescr
124 if (vb.getType() != AgentXVarBind.OCTETSTRING)
125 return AgentXResponsePDU.WRONG_TYPE;
127 return ((ProtocolDirEntry)entry).set_protocolDirDescr(phase, vb.bytesValue());
129 case 6: // protocolDirAddressMapConfig
131 if (vb.getType() != AgentXVarBind.INTEGER)
132 return AgentXResponsePDU.WRONG_TYPE;
134 return ((ProtocolDirEntry)entry).set_protocolDirAddressMapConfig(phase, vb.intValue());
136 case 7: // protocolDirHostConfig
138 if (vb.getType() != AgentXVarBind.INTEGER)
139 return AgentXResponsePDU.WRONG_TYPE;
141 return ((ProtocolDirEntry)entry).set_protocolDirHostConfig(phase, vb.intValue());
143 case 8: // protocolDirMatrixConfig
145 if (vb.getType() != AgentXVarBind.INTEGER)
146 return AgentXResponsePDU.WRONG_TYPE;
148 return ((ProtocolDirEntry)entry).set_protocolDirMatrixConfig(phase, vb.intValue());
150 case 9: // protocolDirOwner
152 if (vb.getType() != AgentXVarBind.OCTETSTRING)
153 return AgentXResponsePDU.WRONG_TYPE;
155 return ((ProtocolDirEntry)entry).set_protocolDirOwner(phase, vb.bytesValue());
157 case 10: // protocolDirStatus
159 if (vb.getType() != AgentXVarBind.INTEGER)
160 return AgentXResponsePDU.WRONG_TYPE;
162 return ((ProtocolDirEntry)entry).set_protocolDirStatus(phase, vb.intValue());
166 return AgentXResponsePDU.NOT_WRITABLE;