KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > agent > SnmpGenericMetaServer


1 /*
2  * @(#)file SnmpGenericMetaServer.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 1.7
5  * @(#)date 08/02/09
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.agent;
12
13 // jmx imports
14
//
15
import com.sun.jmx.snmp.SnmpValue;
16 import com.sun.jmx.snmp.SnmpStatusException;
17
18 /**
19  * <p>
20  * This interface defines the methods that must be implemented by an
21  * SNMP metadata object that needs to interact with an
22  * {@link com.sun.jmx.snmp.agent.SnmpGenericObjectServer} object.
23  * </p>
24  *
25  * <p>
26  * All these methods are usually generated by <code>mibgen</code> when
27  * run in generic-metadata mode.
28  * </p>
29  *
30  * <p><b><i>
31  * This interface is used internally between the generated Metadata and
32  * the SNMP runtime and you shouldn't need to worry about it, because
33  * you will never have to use it directly.
34  * </b></i></p>
35  *
36  * <p><b>This API is a Sun Microsystems internal API and is subject
37  * to change without notice.</b></p>
38  **/

39 public interface SnmpGenericMetaServer {
40
41     /**
42      * Construct an attribute value (as returned by Attribute::getValue())
43      * from an SnmpValue. The returned attribute value can be used to
44      * construct an Attribute object.
45      *
46      * @param id The OID arc identifying the variable for which the
47      * value is constructed.
48      * @param value The SnmpValue from which the Attribute::value will be
49      * constructed.
50      * @return The attribute value built from the given <code>value</code>.
51      * @exception SnmpStatusException if the attribute value cannot be built
52      * from the given SnmpValue <code>value</code>.
53      *
54      */

55     Object JavaDoc buildAttributeValue(long id, SnmpValue value)
56     throws SnmpStatusException;
57
58     /**
59      * Construct an SnmpValue from an Attribute value as returned by
60      * Attribute::getValue().
61      *
62      * @param id The OID arc identifying the variable for which the
63      * value is constructed.
64      * @param value The attribute value as returned by Attribute::getValue().
65      *
66      * @return The SnmpValue built from the given <code>value</code>.
67      * @exception SnmpStatusException if the SnmpValue cannot be built from
68      * the given <code>value</code>.
69      **/

70     SnmpValue buildSnmpValue(long id, Object JavaDoc value)
71     throws SnmpStatusException;
72
73     /**
74      * Return the name of the attribute corresponding to the
75      * SNMP variable identified by the given <code>id</code>.
76      *
77      * @param id The OID arc identifying the variable.
78      *
79      * @return The name of the variable identified by the given
80      * <code>id</code>.
81      *
82      * @exception SnmpStatusException if the given <code>id</code> does not
83      * correspond to a known variable.
84      */

85     String JavaDoc getAttributeName(long id)
86     throws SnmpStatusException;
87
88     /**
89      * Check the access rights for a SET operation.
90      *
91      * @param x The new requested value.
92      * @param id The OID arc identifying the variable for which the SET is
93      * requested.
94      * @param data A contextual object containing user-data.
95      * This object is allocated through the <code>
96      * {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
97      * for each incoming SNMP request.
98      * @exception SnmpStatusException if the SET operation must be rejected.
99      */

100     void checkSetAccess(SnmpValue x, long id, Object JavaDoc data)
101     throws SnmpStatusException;
102     
103     /**
104      * Check the access rights for a GET operation.
105      *
106      * @param id The OID arc identifying the variable for which the SET is
107      * requested.
108      * @param data A contextual object containing user-data.
109      * This object is allocated through the <code>
110      * {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
111      * for each incoming SNMP request.
112      * @exception SnmpStatusException if the SET operation must be rejected.
113      */

114     void checkGetAccess(long id, Object JavaDoc data)
115     throws SnmpStatusException;
116     
117 }
118
119
Popular Tags