blob: da597f7af765b2778379b93c555d46db00fa3c72 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
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
26package com.sun.jmx.snmp.agent;
27
28// jmx imports
29//
30import com.sun.jmx.snmp.SnmpValue;
31import com.sun.jmx.snmp.SnmpStatusException;
32
33/**
34 * <p>
35 * This interface defines the methods that must be implemented by an
36 * SNMP metadata object that needs to interact with an
37 * {@link com.sun.jmx.snmp.agent.SnmpStandardObjectServer} object.
38 * </p>
39 * <p>
40 * All these methods are usually generated by <code>mibgen</code> when
41 * run in standard-metadata mode (default).
42 * </p>
43 * <p><b><i>
44 * This interface is used internally between the generated Metadata and
45 * the SNMP runtime and you shouldn't need to worry about it, because
46 * you will never have to use it directly.
47 * </b></i></p>
48 *
49 * <p><b>This API is a Sun Microsystems internal API and is subject
50 * to change without notice.</b></p>
51 **/
52public interface SnmpStandardMetaServer {
53 /**
54 * Returns the value of the scalar object identified by the given
55 * OID arc.
56 *
57 * @param arc OID arc of the querried scalar object.
58 *
59 * @return The <CODE>SnmpValue</CODE> of the scalar object identified
60 * by <CODE>arc</CODE>.
61 *
62 * @param userData A contextual object containing user-data.
63 * This object is allocated through the <code>
64 * {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
65 * for each incoming SNMP request.
66 *
67 * @exception SnmpStatusException If the arc is not valid, or if
68 * access is denied.
69 *
70 **/
71 public SnmpValue get(long arc, Object userData)
72 throws SnmpStatusException ;
73
74 /**
75 * Sets the value of the scalar object identified by the given
76 * OID arc.
77 *
78 * @param x New value for the scalar object identified by
79 * <CODE>arc</CODE>
80 *
81 * @param arc OID arc of the scalar object whose value is set.
82 *
83 * @return The new <CODE>SnmpValue</CODE> of the scalar object
84 * identified by <CODE>arc</CODE>.
85 *
86 * @param userData A contextual object containing user-data.
87 * This object is allocated through the <code>
88 * {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
89 * for each incoming SNMP request.
90 *
91 * @exception SnmpStatusException If the arc is not valid, or if
92 * access is denied.
93 *
94 **/
95 public SnmpValue set(SnmpValue x, long arc, Object userData)
96 throws SnmpStatusException ;
97
98 /**
99 * Checks that the new desired value of the scalar object identified
100 * by the given OID arc is valid.
101 *
102 * @param x New value for the scalar object identified by
103 * <CODE>arc</CODE>
104 *
105 * @param arc OID arc of the scalar object whose value is set.
106 *
107 * @param userData A contextual object containing user-data.
108 * This object is allocated through the <code>
109 * {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
110 * for each incoming SNMP request.
111 *
112 * @exception SnmpStatusException If the arc is not valid, or if
113 * access is denied, or if the new desired value is not valid.
114 *
115 **/
116 public void check(SnmpValue x, long arc, Object userData)
117 throws SnmpStatusException ;
118
119}