J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2000-2003 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 | |
| 26 | package com.sun.jmx.snmp.agent; |
| 27 | |
| 28 | import com.sun.jmx.snmp.SnmpStatusException; |
| 29 | import com.sun.jmx.snmp.SnmpOid; |
| 30 | import com.sun.jmx.snmp.agent.SnmpMibTable; |
| 31 | import com.sun.jmx.snmp.agent.SnmpMibSubRequest; |
| 32 | |
| 33 | /** |
| 34 | * This interface is implemented by mibgen generated table objects |
| 35 | * inheriting from {@link com.sun.jmx.snmp.agent.SnmpTableSupport}. |
| 36 | * <p> |
| 37 | * It is used internally by the metadata whenever a remote SNMP manager |
| 38 | * requests the creation of a new entry through an SNMP SET. |
| 39 | * </p> |
| 40 | * <p> |
| 41 | * At creation, the mibgen generated table object retrieves its |
| 42 | * corresponding metadata from the MIB and registers with |
| 43 | * this metadata as a SnmpTableEntryFactory. |
| 44 | * </p> |
| 45 | * |
| 46 | * <p><b>This API is a Sun Microsystems internal API and is subject |
| 47 | * to change without notice.</b></p> |
| 48 | **/ |
| 49 | |
| 50 | public interface SnmpTableEntryFactory extends SnmpTableCallbackHandler { |
| 51 | |
| 52 | /** |
| 53 | * This method is called by the SNMP runtime whenever a new entry |
| 54 | * creation is requested by a remote manager. |
| 55 | * |
| 56 | * The factory is responsible for instantiating the appropriate MBean |
| 57 | * and for registering it with the appropriate metadata object. |
| 58 | * |
| 59 | * Usually this method will: |
| 60 | * <ul> |
| 61 | * <li>Check whether the creation can be accepted |
| 62 | * <li>Instantiate a new entry |
| 63 | * <li>Possibly register this entry with the MBeanServer, if needed. |
| 64 | * <li>Call <code>addEntry()</code> on the given <code>meta</code> object. |
| 65 | * </ul> |
| 66 | * This method is usually generated by <code>mibgen</code> on table |
| 67 | * objects (inheriting from |
| 68 | * {@link com.sun.jmx.snmp.agent.SnmpTableSupport}). <br> |
| 69 | * |
| 70 | * <p><b><i> |
| 71 | * This method is called internally by the SNMP runtime whenever a |
| 72 | * new entry creation is requested by a remote SNMP manager. |
| 73 | * You should never need to call this method directlty. |
| 74 | * </i></b></p> |
| 75 | * |
| 76 | * @param request The SNMP subrequest containing the sublist of varbinds |
| 77 | * for the new entry. |
| 78 | * @param rowOid The OID indexing the conceptual row (entry) for which |
| 79 | * the creation was requested. |
| 80 | * @param depth The depth reached in the OID tree (the position at |
| 81 | * which the columnar object ids start in the OIDs |
| 82 | * included in the varbind). |
| 83 | * @param meta The metadata object impacted by the subrequest |
| 84 | * |
| 85 | * @exception SnmpStatusException The new entry cannot be created. |
| 86 | * |
| 87 | **/ |
| 88 | public void createNewEntry(SnmpMibSubRequest request, SnmpOid rowOid, |
| 89 | int depth, SnmpMibTable meta) |
| 90 | throws SnmpStatusException; |
| 91 | } |