1 10 11 package com.sun.jmx.snmp; 12 13 import java.io.Serializable ; 14 import java.util.Hashtable ; 15 16 import com.sun.jmx.snmp.SnmpValue; 17 import com.sun.jmx.snmp.SnmpInt; 18 19 import com.sun.jmx.snmp.Enumerated; 20 21 38 39 public class EnumRowStatus extends Enumerated implements Serializable { 40 41 46 public final static int unspecified = 0; 47 48 56 public final static int active = 1; 57 58 70 public final static int notInService = 2; 71 72 83 public final static int notReady = 3; 84 85 96 public final static int createAndGo = 4; 97 98 108 public final static int createAndWait = 5; 109 110 119 public final static int destroy = 6; 120 121 128 public EnumRowStatus(int valueIndex) 129 throws IllegalArgumentException { 130 super(valueIndex); 131 } 132 133 140 public EnumRowStatus(Enumerated valueIndex) 141 throws IllegalArgumentException { 142 this(valueIndex.intValue()); 143 } 144 145 152 public EnumRowStatus(long valueIndex) 153 throws IllegalArgumentException { 154 this((int)valueIndex); 155 } 156 157 164 public EnumRowStatus(Integer valueIndex) 165 throws IllegalArgumentException { 166 super(valueIndex); 167 } 168 169 176 public EnumRowStatus(Long valueIndex) 177 throws IllegalArgumentException { 178 this(valueIndex.longValue()); 179 } 180 181 184 public EnumRowStatus() 185 throws IllegalArgumentException { 186 this(unspecified); 187 } 188 189 196 public EnumRowStatus(String x) 197 throws IllegalArgumentException { 198 super(x); 199 } 200 201 208 public EnumRowStatus(SnmpInt valueIndex) 209 throws IllegalArgumentException { 210 this(valueIndex.intValue()); 211 } 212 213 220 public SnmpInt toSnmpValue() 221 throws IllegalArgumentException { 222 if (value == unspecified) 223 throw new 224 IllegalArgumentException ("`unspecified' is not a valid SNMP value."); 225 return new SnmpInt(value); 226 } 227 228 242 static public boolean isValidValue(int value) { 243 if (value < 0) return false; 244 if (value > 6) return false; 245 return true; 246 } 247 248 protected Hashtable getIntTable() { 251 return EnumRowStatus.getRSIntTable(); 252 } 253 254 protected Hashtable getStringTable() { 257 return EnumRowStatus.getRSStringTable(); 258 } 259 260 static final Hashtable getRSIntTable() { 261 return intTable ; 262 } 263 264 static final Hashtable getRSStringTable() { 265 return stringTable ; 266 } 267 268 final static Hashtable intTable = new Hashtable (); 271 final static Hashtable stringTable = new Hashtable (); 272 static { 273 intTable.put(new Integer (0), "unspecified"); 274 intTable.put(new Integer (3), "notReady"); 275 intTable.put(new Integer (6), "destroy"); 276 intTable.put(new Integer (2), "notInService"); 277 intTable.put(new Integer (5), "createAndWait"); 278 intTable.put(new Integer (1), "active"); 279 intTable.put(new Integer (4), "createAndGo"); 280 stringTable.put("unspecified", new Integer (0)); 281 stringTable.put("notReady", new Integer (3)); 282 stringTable.put("destroy", new Integer (6)); 283 stringTable.put("notInService", new Integer (2)); 284 stringTable.put("createAndWait", new Integer (5)); 285 stringTable.put("active", new Integer (1)); 286 stringTable.put("createAndGo", new Integer (4)); 287 } 288 289 290 } 291 292 | Popular Tags |