Imported Upstream version 0.4.8
[platform/upstream/libsmi.git] / test / dumps / jax / SnmpTrap.java
1 /*
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.
4  *
5  * $Id: SnmpTrap.java 4432 2006-05-29 16:21:11Z strauss $
6  */
7
8 /**
9     This class represents a Java AgentX (JAX) implementation of
10     the scalar group snmpTrap defined in SNMPv2-MIB.
11
12     @version 1
13     @author  smidump 0.4.5
14     @see     AgentXGroup, AgentXScalars
15  */
16
17 import java.util.Vector;
18 import java.util.Enumeration;
19 import jax.AgentXOID;
20 import jax.AgentXVarBind;
21 import jax.AgentXSetPhase;
22 import jax.AgentXResponsePDU;
23 import jax.AgentXScalars;
24
25 public class SnmpTrap extends AgentXScalars
26 {
27
28     private final static long[] SnmpTrapOID = {1, 3, 6, 1, 6, 3, 1, 1, 4};
29
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();
36     public SnmpTrap()
37     {
38         oid = new AgentXOID(SnmpTrapOID);
39         data = new Vector();
40         SnmpTrapOIDOID = new AgentXOID(SnmpTrapOIDName);
41         data.addElement(SnmpTrapOIDOID);
42         SnmpTrapEnterpriseOID = new AgentXOID(SnmpTrapEnterpriseName);
43         data.addElement(SnmpTrapEnterpriseOID);
44     }
45
46     public AgentXOID get_snmpTrapOID()
47     {
48         return snmpTrapOID;
49     }
50
51     public AgentXOID get_snmpTrapEnterprise()
52     {
53         return snmpTrapEnterprise;
54     }
55
56     public AgentXVarBind getScalar(AgentXOID pos, AgentXOID oid)
57     {
58         if ((pos == null) || (pos.compareTo(oid) != 0))
59             return new AgentXVarBind(oid, AgentXVarBind.NOSUCHOBJECT);
60         else {
61             if (pos == SnmpTrapOIDOID)
62                 return new AgentXVarBind(oid, AgentXVarBind.OBJECTIDENTIFIER, 
63                                          get_snmpTrapOID());
64             if (pos == SnmpTrapEnterpriseOID)
65                 return new AgentXVarBind(oid, AgentXVarBind.OBJECTIDENTIFIER, 
66                                          get_snmpTrapEnterprise());
67         }
68         return new AgentXVarBind(oid, AgentXVarBind.NOSUCHOBJECT);
69     }
70
71     public int setScalar(AgentXSetPhase phase, AgentXOID pos,
72                          AgentXVarBind inVb)
73     {
74         if ((pos == null) || (pos.compareTo(inVb.getOID()) != 0))
75             return AgentXResponsePDU.INCONSISTENT_NAME;
76         else {
77         }
78         return AgentXResponsePDU.NOT_WRITABLE;
79     }
80
81     public AgentXVarBind getNextScalar(AgentXOID pos, AgentXOID oid)
82     {
83         if ((pos == null) || (pos.compareTo(oid) <= 0))
84             return new AgentXVarBind(oid, AgentXVarBind.ENDOFMIBVIEW);
85         else {
86             if (pos == SnmpTrapOIDOID)
87                 return new AgentXVarBind(pos, AgentXVarBind.OBJECTIDENTIFIER, 
88                                          get_snmpTrapOID());
89             if (pos == SnmpTrapEnterpriseOID)
90                 return new AgentXVarBind(pos, AgentXVarBind.OBJECTIDENTIFIER, 
91                                          get_snmpTrapEnterprise());
92         }
93         return new AgentXVarBind(pos, AgentXVarBind.ENDOFMIBVIEW);
94     }
95
96 }
97