blob: f0809f523d2d8f156be103bebae5a94608c89b71 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26package sun.management.snmp.jvmmib;
27
28//
29// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
30//
31
32// java imports
33//
34import java.io.Serializable;
35
36// jmx imports
37//
38import javax.management.MBeanServer;
39import com.sun.jmx.snmp.SnmpCounter;
40import com.sun.jmx.snmp.SnmpCounter64;
41import com.sun.jmx.snmp.SnmpGauge;
42import com.sun.jmx.snmp.SnmpInt;
43import com.sun.jmx.snmp.SnmpUnsignedInt;
44import com.sun.jmx.snmp.SnmpIpAddress;
45import com.sun.jmx.snmp.SnmpTimeticks;
46import com.sun.jmx.snmp.SnmpOpaque;
47import com.sun.jmx.snmp.SnmpString;
48import com.sun.jmx.snmp.SnmpStringFixed;
49import com.sun.jmx.snmp.SnmpOid;
50import com.sun.jmx.snmp.SnmpNull;
51import com.sun.jmx.snmp.SnmpValue;
52import com.sun.jmx.snmp.SnmpVarBind;
53import com.sun.jmx.snmp.SnmpStatusException;
54
55// jdmk imports
56//
57import com.sun.jmx.snmp.agent.SnmpMibNode;
58import com.sun.jmx.snmp.agent.SnmpMib;
59import com.sun.jmx.snmp.agent.SnmpMibEntry;
60import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
61import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
62import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
63import com.sun.jmx.snmp.agent.SnmpMibTable;
64import com.sun.jmx.snmp.EnumRowStatus;
65import com.sun.jmx.snmp.SnmpDefinitions;
66
67/**
68 * The class is used for representing SNMP metadata for the "JvmRTClassPathEntry" group.
69 * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.22.1.
70 */
71public class JvmRTClassPathEntryMeta extends SnmpMibEntry
72 implements Serializable, SnmpStandardMetaServer {
73
74 /**
75 * Constructor for the metadata associated to "JvmRTClassPathEntry".
76 */
77 public JvmRTClassPathEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
78 objectserver = objserv;
79 varList = new int[1];
80 varList[0] = 2;
81 SnmpMibNode.sort(varList);
82 }
83
84 /**
85 * Get the value of a scalar variable
86 */
87 public SnmpValue get(long var, Object data)
88 throws SnmpStatusException {
89 switch((int)var) {
90 case 2:
91 return new SnmpString(node.getJvmRTClassPathItem());
92
93 case 1:
94 throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
95 default:
96 break;
97 }
98 throw new SnmpStatusException(SnmpStatusException.noSuchObject);
99 }
100
101 /**
102 * Set the value of a scalar variable
103 */
104 public SnmpValue set(SnmpValue x, long var, Object data)
105 throws SnmpStatusException {
106 switch((int)var) {
107 case 2:
108 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
109
110 case 1:
111 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
112
113 default:
114 break;
115 }
116 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
117 }
118
119 /**
120 * Check the value of a scalar variable
121 */
122 public void check(SnmpValue x, long var, Object data)
123 throws SnmpStatusException {
124 switch((int) var) {
125 case 2:
126 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
127
128 case 1:
129 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
130
131 default:
132 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
133 }
134 }
135
136 /**
137 * Allow to bind the metadata description to a specific object.
138 */
139 protected void setInstance(JvmRTClassPathEntryMBean var) {
140 node = var;
141 }
142
143
144 // ------------------------------------------------------------
145 //
146 // Implements the "get" method defined in "SnmpMibEntry".
147 // See the "SnmpMibEntry" Javadoc API for more details.
148 //
149 // ------------------------------------------------------------
150
151 public void get(SnmpMibSubRequest req, int depth)
152 throws SnmpStatusException {
153 objectserver.get(this,req,depth);
154 }
155
156
157 // ------------------------------------------------------------
158 //
159 // Implements the "set" method defined in "SnmpMibEntry".
160 // See the "SnmpMibEntry" Javadoc API for more details.
161 //
162 // ------------------------------------------------------------
163
164 public void set(SnmpMibSubRequest req, int depth)
165 throws SnmpStatusException {
166 objectserver.set(this,req,depth);
167 }
168
169
170 // ------------------------------------------------------------
171 //
172 // Implements the "check" method defined in "SnmpMibEntry".
173 // See the "SnmpMibEntry" Javadoc API for more details.
174 //
175 // ------------------------------------------------------------
176
177 public void check(SnmpMibSubRequest req, int depth)
178 throws SnmpStatusException {
179 objectserver.check(this,req,depth);
180 }
181
182 /**
183 * Returns true if "arc" identifies a scalar object.
184 */
185 public boolean isVariable(long arc) {
186
187 switch((int)arc) {
188 case 2:
189 case 1:
190 return true;
191 default:
192 break;
193 }
194 return false;
195 }
196
197 /**
198 * Returns true if "arc" identifies a readable scalar object.
199 */
200 public boolean isReadable(long arc) {
201
202 switch((int)arc) {
203 case 2:
204 return true;
205 default:
206 break;
207 }
208 return false;
209 }
210
211
212 // ------------------------------------------------------------
213 //
214 // Implements the "skipVariable" method defined in "SnmpMibEntry".
215 // See the "SnmpMibEntry" Javadoc API for more details.
216 //
217 // ------------------------------------------------------------
218
219 public boolean skipVariable(long var, Object data, int pduVersion) {
220 switch((int)var) {
221 case 1:
222 return true;
223 default:
224 break;
225 }
226 return super.skipVariable(var,data,pduVersion);
227 }
228
229 /**
230 * Return the name of the attribute corresponding to the SNMP variable identified by "id".
231 */
232 public String getAttributeName(long id)
233 throws SnmpStatusException {
234 switch((int)id) {
235 case 2:
236 return "JvmRTClassPathItem";
237
238 case 1:
239 return "JvmRTClassPathIndex";
240
241 default:
242 break;
243 }
244 throw new SnmpStatusException(SnmpStatusException.noSuchObject);
245 }
246
247 protected JvmRTClassPathEntryMBean node;
248 protected SnmpStandardObjectServer objectserver = null;
249}