blob: 557191726124311ce73853abc2f0818f9b697d5e [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2003-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 "JvmMemMgrPoolRelEntry" group.
69 * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.120.1.
70 */
71public class JvmMemMgrPoolRelEntryMeta extends SnmpMibEntry
72 implements Serializable, SnmpStandardMetaServer {
73
74 /**
75 * Constructor for the metadata associated to "JvmMemMgrPoolRelEntry".
76 */
77 public JvmMemMgrPoolRelEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
78 objectserver = objserv;
79 varList = new int[2];
80 varList[0] = 3;
81 varList[1] = 2;
82 SnmpMibNode.sort(varList);
83 }
84
85 /**
86 * Get the value of a scalar variable
87 */
88 public SnmpValue get(long var, Object data)
89 throws SnmpStatusException {
90 switch((int)var) {
91 case 3:
92 return new SnmpString(node.getJvmMemMgrRelPoolName());
93
94 case 2:
95 return new SnmpString(node.getJvmMemMgrRelManagerName());
96
97 default:
98 break;
99 }
100 throw new SnmpStatusException(SnmpStatusException.noSuchObject);
101 }
102
103 /**
104 * Set the value of a scalar variable
105 */
106 public SnmpValue set(SnmpValue x, long var, Object data)
107 throws SnmpStatusException {
108 switch((int)var) {
109 case 3:
110 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
111
112 case 2:
113 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
114
115 default:
116 break;
117 }
118 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
119 }
120
121 /**
122 * Check the value of a scalar variable
123 */
124 public void check(SnmpValue x, long var, Object data)
125 throws SnmpStatusException {
126 switch((int) var) {
127 case 3:
128 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
129
130 case 2:
131 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
132
133 default:
134 throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
135 }
136 }
137
138 /**
139 * Allow to bind the metadata description to a specific object.
140 */
141 protected void setInstance(JvmMemMgrPoolRelEntryMBean var) {
142 node = var;
143 }
144
145
146 // ------------------------------------------------------------
147 //
148 // Implements the "get" method defined in "SnmpMibEntry".
149 // See the "SnmpMibEntry" Javadoc API for more details.
150 //
151 // ------------------------------------------------------------
152
153 public void get(SnmpMibSubRequest req, int depth)
154 throws SnmpStatusException {
155 objectserver.get(this,req,depth);
156 }
157
158
159 // ------------------------------------------------------------
160 //
161 // Implements the "set" method defined in "SnmpMibEntry".
162 // See the "SnmpMibEntry" Javadoc API for more details.
163 //
164 // ------------------------------------------------------------
165
166 public void set(SnmpMibSubRequest req, int depth)
167 throws SnmpStatusException {
168 objectserver.set(this,req,depth);
169 }
170
171
172 // ------------------------------------------------------------
173 //
174 // Implements the "check" method defined in "SnmpMibEntry".
175 // See the "SnmpMibEntry" Javadoc API for more details.
176 //
177 // ------------------------------------------------------------
178
179 public void check(SnmpMibSubRequest req, int depth)
180 throws SnmpStatusException {
181 objectserver.check(this,req,depth);
182 }
183
184 /**
185 * Returns true if "arc" identifies a scalar object.
186 */
187 public boolean isVariable(long arc) {
188
189 switch((int)arc) {
190 case 3:
191 case 2:
192 return true;
193 default:
194 break;
195 }
196 return false;
197 }
198
199 /**
200 * Returns true if "arc" identifies a readable scalar object.
201 */
202 public boolean isReadable(long arc) {
203
204 switch((int)arc) {
205 case 3:
206 case 2:
207 return true;
208 default:
209 break;
210 }
211 return false;
212 }
213
214
215 // ------------------------------------------------------------
216 //
217 // Implements the "skipVariable" method defined in "SnmpMibEntry".
218 // See the "SnmpMibEntry" Javadoc API for more details.
219 //
220 // ------------------------------------------------------------
221
222 public boolean skipVariable(long var, Object data, int pduVersion) {
223 return super.skipVariable(var,data,pduVersion);
224 }
225
226 /**
227 * Return the name of the attribute corresponding to the SNMP variable identified by "id".
228 */
229 public String getAttributeName(long id)
230 throws SnmpStatusException {
231 switch((int)id) {
232 case 3:
233 return "JvmMemMgrRelPoolName";
234
235 case 2:
236 return "JvmMemMgrRelManagerName";
237
238 default:
239 break;
240 }
241 throw new SnmpStatusException(SnmpStatusException.noSuchObject);
242 }
243
244 protected JvmMemMgrPoolRelEntryMBean node;
245 protected SnmpStandardObjectServer objectserver = null;
246}