Imported Upstream version 0.4.8
[platform/upstream/libsmi.git] / test / dumps / jax / ProbeConfig.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: ProbeConfig.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 probeConfig 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 ProbeConfig extends AgentXScalars
26 {
27
28     private final static long[] ProbeConfigOID = {1, 3, 6, 1, 2, 1, 16, 19};
29
30     protected AgentXOID ProbeCapabilitiesOID;
31     protected final static long[] ProbeCapabilitiesName = {1, 3, 6, 1, 2, 1, 16, 19, 1, 0};
32     protected byte[] probeCapabilities = new byte[0];
33     protected AgentXOID ProbeSoftwareRevOID;
34     protected final static long[] ProbeSoftwareRevName = {1, 3, 6, 1, 2, 1, 16, 19, 2, 0};
35     protected byte[] probeSoftwareRev = new byte[0];
36     protected AgentXOID ProbeHardwareRevOID;
37     protected final static long[] ProbeHardwareRevName = {1, 3, 6, 1, 2, 1, 16, 19, 3, 0};
38     protected byte[] probeHardwareRev = new byte[0];
39     protected AgentXOID ProbeDateTimeOID;
40     protected final static long[] ProbeDateTimeName = {1, 3, 6, 1, 2, 1, 16, 19, 4, 0};
41     protected byte[] probeDateTime = new byte[0];
42     protected byte[] undo_probeDateTime = new byte[0];
43     protected AgentXOID ProbeResetControlOID;
44     protected final static long[] ProbeResetControlName = {1, 3, 6, 1, 2, 1, 16, 19, 5, 0};
45     protected int probeResetControl = 0;
46     protected int undo_probeResetControl = 0;
47     protected AgentXOID ProbeDownloadFileOID;
48     protected final static long[] ProbeDownloadFileName = {1, 3, 6, 1, 2, 1, 16, 19, 6, 0};
49     protected byte[] probeDownloadFile = new byte[0];
50     protected byte[] undo_probeDownloadFile = new byte[0];
51     protected AgentXOID ProbeDownloadTFTPServerOID;
52     protected final static long[] ProbeDownloadTFTPServerName = {1, 3, 6, 1, 2, 1, 16, 19, 7, 0};
53     protected byte[] probeDownloadTFTPServer = new byte[4];
54     protected byte[] undo_probeDownloadTFTPServer = new byte[4];
55     protected AgentXOID ProbeDownloadActionOID;
56     protected final static long[] ProbeDownloadActionName = {1, 3, 6, 1, 2, 1, 16, 19, 8, 0};
57     protected int probeDownloadAction = 0;
58     protected int undo_probeDownloadAction = 0;
59     protected AgentXOID ProbeDownloadStatusOID;
60     protected final static long[] ProbeDownloadStatusName = {1, 3, 6, 1, 2, 1, 16, 19, 9, 0};
61     protected int probeDownloadStatus = 0;
62     public ProbeConfig()
63     {
64         oid = new AgentXOID(ProbeConfigOID);
65         data = new Vector();
66         ProbeCapabilitiesOID = new AgentXOID(ProbeCapabilitiesName);
67         data.addElement(ProbeCapabilitiesOID);
68         ProbeSoftwareRevOID = new AgentXOID(ProbeSoftwareRevName);
69         data.addElement(ProbeSoftwareRevOID);
70         ProbeHardwareRevOID = new AgentXOID(ProbeHardwareRevName);
71         data.addElement(ProbeHardwareRevOID);
72         ProbeDateTimeOID = new AgentXOID(ProbeDateTimeName);
73         data.addElement(ProbeDateTimeOID);
74         ProbeResetControlOID = new AgentXOID(ProbeResetControlName);
75         data.addElement(ProbeResetControlOID);
76         ProbeDownloadFileOID = new AgentXOID(ProbeDownloadFileName);
77         data.addElement(ProbeDownloadFileOID);
78         ProbeDownloadTFTPServerOID = new AgentXOID(ProbeDownloadTFTPServerName);
79         data.addElement(ProbeDownloadTFTPServerOID);
80         ProbeDownloadActionOID = new AgentXOID(ProbeDownloadActionName);
81         data.addElement(ProbeDownloadActionOID);
82         ProbeDownloadStatusOID = new AgentXOID(ProbeDownloadStatusName);
83         data.addElement(ProbeDownloadStatusOID);
84     }
85
86     public byte[] get_probeCapabilities()
87     {
88         return probeCapabilities;
89     }
90
91     public byte[] get_probeSoftwareRev()
92     {
93         return probeSoftwareRev;
94     }
95
96     public byte[] get_probeHardwareRev()
97     {
98         return probeHardwareRev;
99     }
100
101     public byte[] get_probeDateTime()
102     {
103         return probeDateTime;
104     }
105
106     public int set_probeDateTime(AgentXSetPhase phase, byte[] value)
107     {
108         switch (phase.getPhase()) {
109         case AgentXSetPhase.TEST_SET:
110             break;
111         case AgentXSetPhase.COMMIT:
112             undo_probeDateTime = probeDateTime;
113             probeDateTime = new byte[value.length];
114             for(int i = 0; i < value.length; i++)
115                 probeDateTime[i] = value[i];
116             break;
117         case AgentXSetPhase.UNDO:
118             probeDateTime = undo_probeDateTime;
119             break;
120         case AgentXSetPhase.CLEANUP:
121             undo_probeDateTime = null;
122             break;
123         default:
124             return AgentXResponsePDU.PROCESSING_ERROR;
125         }
126         return AgentXResponsePDU.NO_ERROR;
127     }
128     public int get_probeResetControl()
129     {
130         return probeResetControl;
131     }
132
133     public int set_probeResetControl(AgentXSetPhase phase, int value)
134     {
135         switch (phase.getPhase()) {
136         case AgentXSetPhase.TEST_SET:
137             break;
138         case AgentXSetPhase.COMMIT:
139             undo_probeResetControl = probeResetControl;
140             probeResetControl = value;
141             break;
142         case AgentXSetPhase.UNDO:
143             probeResetControl = undo_probeResetControl;
144             break;
145         case AgentXSetPhase.CLEANUP:
146             break;
147         default:
148             return AgentXResponsePDU.PROCESSING_ERROR;
149         }
150         return AgentXResponsePDU.NO_ERROR;
151     }
152     public byte[] get_probeDownloadFile()
153     {
154         return probeDownloadFile;
155     }
156
157     public int set_probeDownloadFile(AgentXSetPhase phase, byte[] value)
158     {
159         switch (phase.getPhase()) {
160         case AgentXSetPhase.TEST_SET:
161             break;
162         case AgentXSetPhase.COMMIT:
163             undo_probeDownloadFile = probeDownloadFile;
164             probeDownloadFile = new byte[value.length];
165             for(int i = 0; i < value.length; i++)
166                 probeDownloadFile[i] = value[i];
167             break;
168         case AgentXSetPhase.UNDO:
169             probeDownloadFile = undo_probeDownloadFile;
170             break;
171         case AgentXSetPhase.CLEANUP:
172             undo_probeDownloadFile = null;
173             break;
174         default:
175             return AgentXResponsePDU.PROCESSING_ERROR;
176         }
177         return AgentXResponsePDU.NO_ERROR;
178     }
179     public byte[] get_probeDownloadTFTPServer()
180     {
181         return probeDownloadTFTPServer;
182     }
183
184     public int set_probeDownloadTFTPServer(AgentXSetPhase phase, byte[] value)
185     {
186         switch (phase.getPhase()) {
187         case AgentXSetPhase.TEST_SET:
188             break;
189         case AgentXSetPhase.COMMIT:
190             undo_probeDownloadTFTPServer = probeDownloadTFTPServer;
191             probeDownloadTFTPServer = new byte[value.length];
192             for(int i = 0; i < value.length; i++)
193                 probeDownloadTFTPServer[i] = value[i];
194             break;
195         case AgentXSetPhase.UNDO:
196             probeDownloadTFTPServer = undo_probeDownloadTFTPServer;
197             break;
198         case AgentXSetPhase.CLEANUP:
199             undo_probeDownloadTFTPServer = null;
200             break;
201         default:
202             return AgentXResponsePDU.PROCESSING_ERROR;
203         }
204         return AgentXResponsePDU.NO_ERROR;
205     }
206     public int get_probeDownloadAction()
207     {
208         return probeDownloadAction;
209     }
210
211     public int set_probeDownloadAction(AgentXSetPhase phase, int value)
212     {
213         switch (phase.getPhase()) {
214         case AgentXSetPhase.TEST_SET:
215             break;
216         case AgentXSetPhase.COMMIT:
217             undo_probeDownloadAction = probeDownloadAction;
218             probeDownloadAction = value;
219             break;
220         case AgentXSetPhase.UNDO:
221             probeDownloadAction = undo_probeDownloadAction;
222             break;
223         case AgentXSetPhase.CLEANUP:
224             break;
225         default:
226             return AgentXResponsePDU.PROCESSING_ERROR;
227         }
228         return AgentXResponsePDU.NO_ERROR;
229     }
230     public int get_probeDownloadStatus()
231     {
232         return probeDownloadStatus;
233     }
234
235     public AgentXVarBind getScalar(AgentXOID pos, AgentXOID oid)
236     {
237         if ((pos == null) || (pos.compareTo(oid) != 0))
238             return new AgentXVarBind(oid, AgentXVarBind.NOSUCHOBJECT);
239         else {
240             if (pos == ProbeCapabilitiesOID)
241                 return new AgentXVarBind(oid, AgentXVarBind.OCTETSTRING, 
242                                          get_probeCapabilities());
243             if (pos == ProbeSoftwareRevOID)
244                 return new AgentXVarBind(oid, AgentXVarBind.OCTETSTRING, 
245                                          get_probeSoftwareRev());
246             if (pos == ProbeHardwareRevOID)
247                 return new AgentXVarBind(oid, AgentXVarBind.OCTETSTRING, 
248                                          get_probeHardwareRev());
249             if (pos == ProbeDateTimeOID)
250                 return new AgentXVarBind(oid, AgentXVarBind.OCTETSTRING, 
251                                          get_probeDateTime());
252             if (pos == ProbeResetControlOID)
253                 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, 
254                                          get_probeResetControl());
255             if (pos == ProbeDownloadFileOID)
256                 return new AgentXVarBind(oid, AgentXVarBind.OCTETSTRING, 
257                                          get_probeDownloadFile());
258             if (pos == ProbeDownloadTFTPServerOID)
259                 return new AgentXVarBind(oid, AgentXVarBind.IPADDRESS, 
260                                          get_probeDownloadTFTPServer());
261             if (pos == ProbeDownloadActionOID)
262                 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, 
263                                          get_probeDownloadAction());
264             if (pos == ProbeDownloadStatusOID)
265                 return new AgentXVarBind(oid, AgentXVarBind.INTEGER, 
266                                          get_probeDownloadStatus());
267         }
268         return new AgentXVarBind(oid, AgentXVarBind.NOSUCHOBJECT);
269     }
270
271     public int setScalar(AgentXSetPhase phase, AgentXOID pos,
272                          AgentXVarBind inVb)
273     {
274         if ((pos == null) || (pos.compareTo(inVb.getOID()) != 0))
275             return AgentXResponsePDU.INCONSISTENT_NAME;
276         else {
277             if (pos == ProbeDateTimeOID)
278                 return set_probeDateTime(phase, inVb.bytesValue());
279             if (pos == ProbeResetControlOID)
280                 return set_probeResetControl(phase, inVb.intValue());
281             if (pos == ProbeDownloadFileOID)
282                 return set_probeDownloadFile(phase, inVb.bytesValue());
283             if (pos == ProbeDownloadTFTPServerOID)
284                 return set_probeDownloadTFTPServer(phase, inVb.bytesValue());
285             if (pos == ProbeDownloadActionOID)
286                 return set_probeDownloadAction(phase, inVb.intValue());
287         }
288         return AgentXResponsePDU.NOT_WRITABLE;
289     }
290
291     public AgentXVarBind getNextScalar(AgentXOID pos, AgentXOID oid)
292     {
293         if ((pos == null) || (pos.compareTo(oid) <= 0))
294             return new AgentXVarBind(oid, AgentXVarBind.ENDOFMIBVIEW);
295         else {
296             if (pos == ProbeCapabilitiesOID)
297                 return new AgentXVarBind(pos, AgentXVarBind.OCTETSTRING, 
298                                          get_probeCapabilities());
299             if (pos == ProbeSoftwareRevOID)
300                 return new AgentXVarBind(pos, AgentXVarBind.OCTETSTRING, 
301                                          get_probeSoftwareRev());
302             if (pos == ProbeHardwareRevOID)
303                 return new AgentXVarBind(pos, AgentXVarBind.OCTETSTRING, 
304                                          get_probeHardwareRev());
305             if (pos == ProbeDateTimeOID)
306                 return new AgentXVarBind(pos, AgentXVarBind.OCTETSTRING, 
307                                          get_probeDateTime());
308             if (pos == ProbeResetControlOID)
309                 return new AgentXVarBind(pos, AgentXVarBind.INTEGER, 
310                                          get_probeResetControl());
311             if (pos == ProbeDownloadFileOID)
312                 return new AgentXVarBind(pos, AgentXVarBind.OCTETSTRING, 
313                                          get_probeDownloadFile());
314             if (pos == ProbeDownloadTFTPServerOID)
315                 return new AgentXVarBind(pos, AgentXVarBind.IPADDRESS, 
316                                          get_probeDownloadTFTPServer());
317             if (pos == ProbeDownloadActionOID)
318                 return new AgentXVarBind(pos, AgentXVarBind.INTEGER, 
319                                          get_probeDownloadAction());
320             if (pos == ProbeDownloadStatusOID)
321                 return new AgentXVarBind(pos, AgentXVarBind.INTEGER, 
322                                          get_probeDownloadStatus());
323         }
324         return new AgentXVarBind(pos, AgentXVarBind.ENDOFMIBVIEW);
325     }
326
327 }
328