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: SnmpTrap.java 4432 2006-05-29 16:21:11Z strauss $
9 This class represents a Java AgentX (JAX) implementation of
10 the scalar group snmpTrap defined in SNMPv2-MIB.
14 @see AgentXGroup, AgentXScalars
17 import java.util.Vector;
18 import java.util.Enumeration;
20 import jax.AgentXVarBind;
21 import jax.AgentXSetPhase;
22 import jax.AgentXResponsePDU;
23 import jax.AgentXScalars;
25 public class SnmpTrap extends AgentXScalars
28 private final static long[] SnmpTrapOID = {1, 3, 6, 1, 6, 3, 1, 1, 4};
30 protected AgentXOID SnmpTrapOIDOID;
31 protected final static long[] SnmpTrapOIDName = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
32 protected AgentXOID snmpTrapOID = new AgentXOID();
33 protected AgentXOID SnmpTrapEnterpriseOID;
34 protected final static long[] SnmpTrapEnterpriseName = {1, 3, 6, 1, 6, 3, 1, 1, 4, 3, 0};
35 protected AgentXOID snmpTrapEnterprise = new AgentXOID();
38 oid = new AgentXOID(SnmpTrapOID);
40 SnmpTrapOIDOID = new AgentXOID(SnmpTrapOIDName);
41 data.addElement(SnmpTrapOIDOID);
42 SnmpTrapEnterpriseOID = new AgentXOID(SnmpTrapEnterpriseName);
43 data.addElement(SnmpTrapEnterpriseOID);
46 public AgentXOID get_snmpTrapOID()
51 public AgentXOID get_snmpTrapEnterprise()
53 return snmpTrapEnterprise;
56 public AgentXVarBind getScalar(AgentXOID pos, AgentXOID oid)
58 if ((pos == null) || (pos.compareTo(oid) != 0))
59 return new AgentXVarBind(oid, AgentXVarBind.NOSUCHOBJECT);
61 if (pos == SnmpTrapOIDOID)
62 return new AgentXVarBind(oid, AgentXVarBind.OBJECTIDENTIFIER,
64 if (pos == SnmpTrapEnterpriseOID)
65 return new AgentXVarBind(oid, AgentXVarBind.OBJECTIDENTIFIER,
66 get_snmpTrapEnterprise());
68 return new AgentXVarBind(oid, AgentXVarBind.NOSUCHOBJECT);
71 public int setScalar(AgentXSetPhase phase, AgentXOID pos,
74 if ((pos == null) || (pos.compareTo(inVb.getOID()) != 0))
75 return AgentXResponsePDU.INCONSISTENT_NAME;
78 return AgentXResponsePDU.NOT_WRITABLE;
81 public AgentXVarBind getNextScalar(AgentXOID pos, AgentXOID oid)
83 if ((pos == null) || (pos.compareTo(oid) <= 0))
84 return new AgentXVarBind(oid, AgentXVarBind.ENDOFMIBVIEW);
86 if (pos == SnmpTrapOIDOID)
87 return new AgentXVarBind(pos, AgentXVarBind.OBJECTIDENTIFIER,
89 if (pos == SnmpTrapEnterpriseOID)
90 return new AgentXVarBind(pos, AgentXVarBind.OBJECTIDENTIFIER,
91 get_snmpTrapEnterprise());
93 return new AgentXVarBind(pos, AgentXVarBind.ENDOFMIBVIEW);