1. /*
  2. * @(#)file SnmpTableEntryFactory.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.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. package com.sun.jmx.snmp.agent;
  11. import com.sun.jmx.snmp.SnmpStatusException;
  12. import com.sun.jmx.snmp.SnmpOid;
  13. import com.sun.jmx.snmp.agent.SnmpMibTable;
  14. import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
  15. /**
  16. * This interface is implemented by mibgen generated table objects
  17. * inheriting from {@link com.sun.jmx.snmp.agent.SnmpTableSupport}.
  18. * <p>
  19. * It is used internally by the metadata whenever a remote SNMP manager
  20. * requests the creation of a new entry through an SNMP SET.
  21. * </p>
  22. * <p>
  23. * At creation, the mibgen generated table object retrieves its
  24. * corresponding metadata from the MIB and registers with
  25. * this metadata as a SnmpTableEntryFactory.
  26. * </p>
  27. *
  28. * <p><b>This API is a Sun Microsystems internal API and is subject
  29. * to change without notice.</b></p>
  30. **/
  31. public interface SnmpTableEntryFactory extends SnmpTableCallbackHandler {
  32. /**
  33. * This method is called by the SNMP runtime whenever a new entry
  34. * creation is requested by a remote manager.
  35. *
  36. * The factory is responsible for instantiating the appropriate MBean
  37. * and for registering it with the appropriate metadata object.
  38. *
  39. * Usually this method will:
  40. * <ul>
  41. * <li>Check whether the creation can be accepted
  42. * <li>Instantiate a new entry
  43. * <li>Possibly register this entry with the MBeanServer, if needed.
  44. * <li>Call <code>addEntry()</code> on the given <code>meta</code> object.
  45. * </ul>
  46. * This method is usually generated by <code>mibgen</code> on table
  47. * objects (inheriting from
  48. * {@link com.sun.jmx.snmp.agent.SnmpTableSupport}). <br>
  49. *
  50. * <p><b><i>
  51. * This method is called internally by the SNMP runtime whenever a
  52. * new entry creation is requested by a remote SNMP manager.
  53. * You should never need to call this method directlty.
  54. * </i></b></p>
  55. *
  56. * @param request The SNMP subrequest containing the sublist of varbinds
  57. * for the new entry.
  58. * @param rowOid The OID indexing the conceptual row (entry) for which
  59. * the creation was requested.
  60. * @param depth The depth reached in the OID tree (the position at
  61. * which the columnar object ids start in the OIDs
  62. * included in the varbind).
  63. * @param meta The metadata object impacted by the subrequest
  64. *
  65. * @exception SnmpStatusException The new entry cannot be created.
  66. *
  67. **/
  68. public void createNewEntry(SnmpMibSubRequest request, SnmpOid rowOid,
  69. int depth, SnmpMibTable meta)
  70. throws SnmpStatusException;
  71. }