equal
deleted
inserted
replaced
153 **/ |
153 **/ |
154 void findHandlingNode(SnmpVarBind varbind, |
154 void findHandlingNode(SnmpVarBind varbind, |
155 long[] oid, int depth, |
155 long[] oid, int depth, |
156 SnmpRequestTree handlers) |
156 SnmpRequestTree handlers) |
157 throws SnmpStatusException { |
157 throws SnmpStatusException { |
158 throw noSuchObjectException; |
158 throw new SnmpStatusException(SnmpStatusException.noSuchObject); |
159 } |
159 } |
160 |
160 |
161 /** |
161 /** |
162 * Find the node which handles the leaf that immediately follows the |
162 * Find the node which handles the leaf that immediately follows the |
163 * given varbind OID, and register the it in the SnmpRequestTree. |
163 * given varbind OID, and register the it in the SnmpRequestTree. |
181 **/ |
181 **/ |
182 long[] findNextHandlingNode(SnmpVarBind varbind, |
182 long[] findNextHandlingNode(SnmpVarBind varbind, |
183 long[] oid, int pos, int depth, |
183 long[] oid, int pos, int depth, |
184 SnmpRequestTree handlers, AcmChecker checker) |
184 SnmpRequestTree handlers, AcmChecker checker) |
185 throws SnmpStatusException { |
185 throws SnmpStatusException { |
186 throw noSuchObjectException; |
186 throw new SnmpStatusException(SnmpStatusException.noSuchObject); |
187 } |
187 } |
188 |
188 |
189 /** |
189 /** |
190 * Generic handling of the <CODE>get</CODE> operation. |
190 * Generic handling of the <CODE>get</CODE> operation. |
191 * |
191 * |
344 throws SnmpStatusException { |
344 throws SnmpStatusException { |
345 |
345 |
346 final int[] a = table; |
346 final int[] a = table; |
347 final int val= (int) value; |
347 final int val= (int) value; |
348 |
348 |
349 if (a == null) |
349 if (a == null) { |
350 throw noSuchObjectException; |
350 throw new SnmpStatusException(SnmpStatusException.noSuchObject); |
|
351 } |
351 |
352 |
352 int low= 0; |
353 int low= 0; |
353 int max= a.length; |
354 int max= a.length; |
354 int curr= low + (max-low)/2; |
355 int curr= low + (max-low)/2; |
355 int elmt= 0; |
356 int elmt= 0; |
356 |
357 |
357 // Basic check |
358 // Basic check |
358 // |
359 // |
359 if (max < 1) |
360 if (max < 1) { |
360 throw noSuchObjectException; |
361 throw new SnmpStatusException(SnmpStatusException.noSuchObject); |
361 |
362 } |
362 if (a[max-1] <= val) |
363 |
363 throw noSuchObjectException; |
364 if (a[max-1] <= val) { |
|
365 throw new SnmpStatusException(SnmpStatusException.noSuchObject); |
|
366 } |
364 |
367 |
365 while (low <= max) { |
368 while (low <= max) { |
366 elmt= a[curr]; |
369 elmt= a[curr]; |
367 if (val == elmt) { |
370 if (val == elmt) { |
368 // We ned to get the next index ... |
371 // We ned to get the next index ... |
398 |
401 |
399 /** |
402 /** |
400 * Contains the list of variable identifiers. |
403 * Contains the list of variable identifiers. |
401 */ |
404 */ |
402 protected int[] varList; |
405 protected int[] varList; |
403 |
|
404 /** |
|
405 * Contains a predefined exception that is often fired when an |
|
406 * object is not found in the MIB. |
|
407 */ |
|
408 static final protected SnmpStatusException noSuchInstanceException = |
|
409 new SnmpStatusException(SnmpStatusException.noSuchInstance); |
|
410 static final protected SnmpStatusException noSuchObjectException = |
|
411 new SnmpStatusException(SnmpStatusException.noSuchObject); |
|
412 static final protected SnmpStatusException noSuchNameException = |
|
413 new SnmpStatusException(SnmpDefinitions.snmpRspNoSuchName); |
|
414 } |
406 } |