1. /*
  2. * @(#)file SnmpTooBigException.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 4.9
  5. * @(#)date 04/09/15
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp;
  12. // "@(#)SnmpTooBigException.java 1.1 98/07/23 SMI"
  13. /**
  14. * Is used internally to signal that the size of a PDU exceeds the packet size limitation.
  15. * <p>
  16. * You will not usually need to use this class, except if you
  17. * decide to implement your own
  18. * {@link com.sun.jmx.snmp.SnmpPduFactory SnmPduFactory} object.
  19. * <p>
  20. * The <CODE>varBindCount</CODE> property contains the
  21. * number of <CODE>SnmpVarBind</CODE> successfully encoded
  22. * before the exception was thrown. Its value is 0
  23. * when this number is unknown.
  24. *
  25. * <p><b>This API is a Sun Microsystems internal API and is subject
  26. * to change without notice.</b></p>
  27. * @version 1.1 07/23/98
  28. * @author Sun Microsystems, Inc
  29. */
  30. public class SnmpTooBigException extends Exception {
  31. /**
  32. * Builds an <CODE>SnmpTooBigException</CODE> with
  33. * <CODE>varBindCount</CODE> set to 0.
  34. */
  35. public SnmpTooBigException() {
  36. varBindCount = 0 ;
  37. }
  38. /**
  39. * Builds an <CODE>SnmpTooBigException</CODE> with
  40. * <CODE>varBindCount</CODE> set to the specified value.
  41. * @param n The <CODE>varBindCount</CODE> value.
  42. */
  43. public SnmpTooBigException(int n) {
  44. varBindCount = n ;
  45. }
  46. /**
  47. * Returns the number of <CODE>SnmpVarBind</CODE> successfully
  48. * encoded before the exception was thrown.
  49. *
  50. * @return A positive integer (0 means the number is unknown).
  51. */
  52. public int getVarBindCount() {
  53. return varBindCount ;
  54. }
  55. /**
  56. * The <CODE>varBindCount</CODE>.
  57. * @serial
  58. */
  59. private int varBindCount ;
  60. }