Imported Upstream version 0.4.8
[platform/upstream/libsmi.git] / test / dumps / jax / AddressMap.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: AddressMap.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 addressMap defined in RMON2-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 AddressMap extends AgentXScalars
26 {
27
28     private final static long[] AddressMapOID = {1, 3, 6, 1, 2, 1, 16, 13};
29
30     protected AgentXOID AddressMapInsertsOID;
31     protected final static long[] AddressMapInsertsName = {1, 3, 6, 1, 2, 1, 16, 13, 1, 0};
32     protected long addressMapInserts = 0;
33     protected AgentXOID AddressMapDeletesOID;
34     protected final static long[] AddressMapDeletesName = {1, 3, 6, 1, 2, 1, 16, 13, 2, 0};
35     protected long addressMapDeletes = 0;
36     protected AgentXOID AddressMapMaxDesiredEntriesOID;
37     protected final static long[] AddressMapMaxDesiredEntriesName = {1, 3, 6, 1, 2, 1, 16, 13, 3, 0};
38     protected int addressMapMaxDesiredEntries = 0;
39     protected int undo_addressMapMaxDesiredEntries = 0;
40     public AddressMap()
41     {
42         oid = new AgentXOID(AddressMapOID);
43         data = new Vector();
44         AddressMapInsertsOID = new AgentXOID(AddressMapInsertsName);
45         data.addElement(AddressMapInsertsOID);
46         AddressMapDeletesOID = new AgentXOID(AddressMapDeletesName);
47         data.addElement(AddressMapDeletesOID);
48         AddressMapMaxDesiredEntriesOID = new AgentXOID(AddressMapMaxDesiredEntriesName);
49         data.addElement(AddressMapMaxDesiredEntriesOID);
50     }
51
52     public long get_addressMapInserts()
53     {
54         return addressMapInserts;
55     }
56
57     public long get_addressMapDeletes()
58     {
59         return addressMapDeletes;
60     }
61
62     public int get_addressMapMaxDesiredEntries()
63     {
64         return addressMapMaxDesiredEntries;
65     }
66
67     public int set_addressMapMaxDesiredEntries(AgentXSetPhase phase, int value)
68     {
69         switch (phase.getPhase()) {
70         case AgentXSetPhase.TEST_SET:
71             break;
72         case AgentXSetPhase.COMMIT:
73             undo_addressMapMaxDesiredEntries = addressMapMaxDesiredEntries;
74             addressMapMaxDesiredEntries = value;
75             break;
76         case AgentXSetPhase.UNDO:
77             addressMapMaxDesiredEntries = undo_addressMapMaxDesiredEntries;
78             break;
79         case AgentXSetPhase.CLEANUP:
80             break;
81         default:
82             return AgentXResponsePDU.PROCESSING_ERROR;
83         }
84         return AgentXResponsePDU.NO_ERROR;
85     }
86     public AgentXVarBind getScalar(AgentXOID pos, AgentXOID oid)
87     {
88         if ((pos == null) || (pos.compareTo(oid) != 0))
89             return new AgentXVarBind(oid, AgentXVarBind.NOSUCHOBJECT);
90         else {
91             if (pos == AddressMapInsertsOID)
92                 return new AgentXVarBind(oid, AgentXVarBind.COUNTER32, 
93                                          get_addressMapInserts());
94             if (pos == AddressMapDeletesOID)
95                 return new AgentXVarBind(oid, AgentXVarBind.COUNTER32, 
96                                          get_addressMapDeletes());
97             if (pos == AddressMapMaxDesiredEntriesOID)
98                 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, 
99                                          get_addressMapMaxDesiredEntries());
100         }
101         return new AgentXVarBind(oid, AgentXVarBind.NOSUCHOBJECT);
102     }
103
104     public int setScalar(AgentXSetPhase phase, AgentXOID pos,
105                          AgentXVarBind inVb)
106     {
107         if ((pos == null) || (pos.compareTo(inVb.getOID()) != 0))
108             return AgentXResponsePDU.INCONSISTENT_NAME;
109         else {
110             if (pos == AddressMapMaxDesiredEntriesOID)
111                 return set_addressMapMaxDesiredEntries(phase, inVb.intValue());
112         }
113         return AgentXResponsePDU.NOT_WRITABLE;
114     }
115
116     public AgentXVarBind getNextScalar(AgentXOID pos, AgentXOID oid)
117     {
118         if ((pos == null) || (pos.compareTo(oid) <= 0))
119             return new AgentXVarBind(oid, AgentXVarBind.ENDOFMIBVIEW);
120         else {
121             if (pos == AddressMapInsertsOID)
122                 return new AgentXVarBind(pos, AgentXVarBind.COUNTER32, 
123                                          get_addressMapInserts());
124             if (pos == AddressMapDeletesOID)
125                 return new AgentXVarBind(pos, AgentXVarBind.COUNTER32, 
126                                          get_addressMapDeletes());
127             if (pos == AddressMapMaxDesiredEntriesOID)
128                 return new AgentXVarBind(pos, AgentXVarBind.INTEGER, 
129                                          get_addressMapMaxDesiredEntries());
130         }
131         return new AgentXVarBind(pos, AgentXVarBind.ENDOFMIBVIEW);
132     }
133
134 }
135