author | mchung |
Tue, 17 Jan 2012 15:55:40 -0800 | |
changeset 11530 | a9d059c15b80 |
parent 5506 | 202f599c92aa |
child 14342 | 8435a30053c1 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
5506 | 2 |
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package 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 |
// |
|
34 |
import java.io.Serializable; |
|
35 |
||
36 |
// jmx imports |
|
37 |
// |
|
38 |
import javax.management.MBeanServer; |
|
39 |
import com.sun.jmx.snmp.SnmpCounter; |
|
40 |
import com.sun.jmx.snmp.SnmpCounter64; |
|
41 |
import com.sun.jmx.snmp.SnmpGauge; |
|
42 |
import com.sun.jmx.snmp.SnmpInt; |
|
43 |
import com.sun.jmx.snmp.SnmpUnsignedInt; |
|
44 |
import com.sun.jmx.snmp.SnmpIpAddress; |
|
45 |
import com.sun.jmx.snmp.SnmpTimeticks; |
|
46 |
import com.sun.jmx.snmp.SnmpOpaque; |
|
47 |
import com.sun.jmx.snmp.SnmpString; |
|
48 |
import com.sun.jmx.snmp.SnmpStringFixed; |
|
49 |
import com.sun.jmx.snmp.SnmpOid; |
|
50 |
import com.sun.jmx.snmp.SnmpNull; |
|
51 |
import com.sun.jmx.snmp.SnmpValue; |
|
52 |
import com.sun.jmx.snmp.SnmpVarBind; |
|
53 |
import com.sun.jmx.snmp.SnmpStatusException; |
|
54 |
||
55 |
// jdmk imports |
|
56 |
// |
|
57 |
import com.sun.jmx.snmp.agent.SnmpMibNode; |
|
58 |
import com.sun.jmx.snmp.agent.SnmpMib; |
|
59 |
import com.sun.jmx.snmp.agent.SnmpMibEntry; |
|
60 |
import com.sun.jmx.snmp.agent.SnmpStandardObjectServer; |
|
61 |
import com.sun.jmx.snmp.agent.SnmpStandardMetaServer; |
|
62 |
import com.sun.jmx.snmp.agent.SnmpMibSubRequest; |
|
63 |
import com.sun.jmx.snmp.agent.SnmpMibTable; |
|
64 |
import com.sun.jmx.snmp.EnumRowStatus; |
|
65 |
import com.sun.jmx.snmp.SnmpDefinitions; |
|
66 |
||
67 |
/** |
|
68 |
* The class is used for representing SNMP metadata for the "JvmMemManagerEntry" group. |
|
69 |
* The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.100.1. |
|
70 |
*/ |
|
71 |
public class JvmMemManagerEntryMeta extends SnmpMibEntry |
|
72 |
implements Serializable, SnmpStandardMetaServer { |
|
73 |
||
11530
a9d059c15b80
7117570: Warnings in sun.mangement.* and its subpackages
mchung
parents:
5506
diff
changeset
|
74 |
static final long serialVersionUID = 8166956416408970453L; |
2 | 75 |
/** |
76 |
* Constructor for the metadata associated to "JvmMemManagerEntry". |
|
77 |
*/ |
|
78 |
public JvmMemManagerEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) { |
|
79 |
objectserver = objserv; |
|
80 |
varList = new int[2]; |
|
81 |
varList[0] = 3; |
|
82 |
varList[1] = 2; |
|
83 |
SnmpMibNode.sort(varList); |
|
84 |
} |
|
85 |
||
86 |
/** |
|
87 |
* Get the value of a scalar variable |
|
88 |
*/ |
|
89 |
public SnmpValue get(long var, Object data) |
|
90 |
throws SnmpStatusException { |
|
91 |
switch((int)var) { |
|
92 |
case 3: |
|
93 |
return new SnmpInt(node.getJvmMemManagerState()); |
|
94 |
||
95 |
case 2: |
|
96 |
return new SnmpString(node.getJvmMemManagerName()); |
|
97 |
||
98 |
case 1: |
|
99 |
throw new SnmpStatusException(SnmpStatusException.noSuchInstance); |
|
100 |
default: |
|
101 |
break; |
|
102 |
} |
|
103 |
throw new SnmpStatusException(SnmpStatusException.noSuchObject); |
|
104 |
} |
|
105 |
||
106 |
/** |
|
107 |
* Set the value of a scalar variable |
|
108 |
*/ |
|
109 |
public SnmpValue set(SnmpValue x, long var, Object data) |
|
110 |
throws SnmpStatusException { |
|
111 |
switch((int)var) { |
|
112 |
case 3: |
|
113 |
throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable); |
|
114 |
||
115 |
case 2: |
|
116 |
throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable); |
|
117 |
||
118 |
case 1: |
|
119 |
throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable); |
|
120 |
||
121 |
default: |
|
122 |
break; |
|
123 |
} |
|
124 |
throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable); |
|
125 |
} |
|
126 |
||
127 |
/** |
|
128 |
* Check the value of a scalar variable |
|
129 |
*/ |
|
130 |
public void check(SnmpValue x, long var, Object data) |
|
131 |
throws SnmpStatusException { |
|
132 |
switch((int) var) { |
|
133 |
case 3: |
|
134 |
throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable); |
|
135 |
||
136 |
case 2: |
|
137 |
throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable); |
|
138 |
||
139 |
case 1: |
|
140 |
throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable); |
|
141 |
||
142 |
default: |
|
143 |
throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable); |
|
144 |
} |
|
145 |
} |
|
146 |
||
147 |
/** |
|
148 |
* Allow to bind the metadata description to a specific object. |
|
149 |
*/ |
|
150 |
protected void setInstance(JvmMemManagerEntryMBean var) { |
|
151 |
node = var; |
|
152 |
} |
|
153 |
||
154 |
||
155 |
// ------------------------------------------------------------ |
|
156 |
// |
|
157 |
// Implements the "get" method defined in "SnmpMibEntry". |
|
158 |
// See the "SnmpMibEntry" Javadoc API for more details. |
|
159 |
// |
|
160 |
// ------------------------------------------------------------ |
|
161 |
||
162 |
public void get(SnmpMibSubRequest req, int depth) |
|
163 |
throws SnmpStatusException { |
|
164 |
objectserver.get(this,req,depth); |
|
165 |
} |
|
166 |
||
167 |
||
168 |
// ------------------------------------------------------------ |
|
169 |
// |
|
170 |
// Implements the "set" method defined in "SnmpMibEntry". |
|
171 |
// See the "SnmpMibEntry" Javadoc API for more details. |
|
172 |
// |
|
173 |
// ------------------------------------------------------------ |
|
174 |
||
175 |
public void set(SnmpMibSubRequest req, int depth) |
|
176 |
throws SnmpStatusException { |
|
177 |
objectserver.set(this,req,depth); |
|
178 |
} |
|
179 |
||
180 |
||
181 |
// ------------------------------------------------------------ |
|
182 |
// |
|
183 |
// Implements the "check" method defined in "SnmpMibEntry". |
|
184 |
// See the "SnmpMibEntry" Javadoc API for more details. |
|
185 |
// |
|
186 |
// ------------------------------------------------------------ |
|
187 |
||
188 |
public void check(SnmpMibSubRequest req, int depth) |
|
189 |
throws SnmpStatusException { |
|
190 |
objectserver.check(this,req,depth); |
|
191 |
} |
|
192 |
||
193 |
/** |
|
194 |
* Returns true if "arc" identifies a scalar object. |
|
195 |
*/ |
|
196 |
public boolean isVariable(long arc) { |
|
197 |
||
198 |
switch((int)arc) { |
|
199 |
case 3: |
|
200 |
case 2: |
|
201 |
case 1: |
|
202 |
return true; |
|
203 |
default: |
|
204 |
break; |
|
205 |
} |
|
206 |
return false; |
|
207 |
} |
|
208 |
||
209 |
/** |
|
210 |
* Returns true if "arc" identifies a readable scalar object. |
|
211 |
*/ |
|
212 |
public boolean isReadable(long arc) { |
|
213 |
||
214 |
switch((int)arc) { |
|
215 |
case 3: |
|
216 |
case 2: |
|
217 |
return true; |
|
218 |
default: |
|
219 |
break; |
|
220 |
} |
|
221 |
return false; |
|
222 |
} |
|
223 |
||
224 |
||
225 |
// ------------------------------------------------------------ |
|
226 |
// |
|
227 |
// Implements the "skipVariable" method defined in "SnmpMibEntry". |
|
228 |
// See the "SnmpMibEntry" Javadoc API for more details. |
|
229 |
// |
|
230 |
// ------------------------------------------------------------ |
|
231 |
||
232 |
public boolean skipVariable(long var, Object data, int pduVersion) { |
|
233 |
switch((int)var) { |
|
234 |
case 1: |
|
235 |
return true; |
|
236 |
default: |
|
237 |
break; |
|
238 |
} |
|
239 |
return super.skipVariable(var,data,pduVersion); |
|
240 |
} |
|
241 |
||
242 |
/** |
|
243 |
* Return the name of the attribute corresponding to the SNMP variable identified by "id". |
|
244 |
*/ |
|
245 |
public String getAttributeName(long id) |
|
246 |
throws SnmpStatusException { |
|
247 |
switch((int)id) { |
|
248 |
case 3: |
|
249 |
return "JvmMemManagerState"; |
|
250 |
||
251 |
case 2: |
|
252 |
return "JvmMemManagerName"; |
|
253 |
||
254 |
case 1: |
|
255 |
return "JvmMemManagerIndex"; |
|
256 |
||
257 |
default: |
|
258 |
break; |
|
259 |
} |
|
260 |
throw new SnmpStatusException(SnmpStatusException.noSuchObject); |
|
261 |
} |
|
262 |
||
263 |
protected JvmMemManagerEntryMBean node; |
|
264 |
protected SnmpStandardObjectServer objectserver = null; |
|
265 |
} |