KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)file SnmpMibAgentMBean.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 1.24
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
12
13 package com.sun.jmx.snmp.agent;
14
15
16
17 // java imports
18
//
19
import java.util.Vector JavaDoc;
20
21 // jmx imports
22
//
23
import javax.management.MBeanServer JavaDoc;
24 import javax.management.ObjectName JavaDoc;
25 import javax.management.MalformedObjectNameException JavaDoc;
26 import javax.management.InstanceNotFoundException JavaDoc;
27 import javax.management.ServiceNotFoundException JavaDoc;
28 import com.sun.jmx.snmp.SnmpOid;
29 import com.sun.jmx.snmp.SnmpStatusException;
30
31 /**
32  * Exposes the remote management interface of the <CODE>SnmpMibAgent</CODE> MBean.
33  *
34  * <p><b>This API is a Sun Microsystems internal API and is subject
35  * to change without notice.</b></p>
36  * @version 1.24 12/19/03
37  * @author Sun Microsystems, Inc
38  */

39
40 public interface SnmpMibAgentMBean {
41
42     // PUBLIC METHODS
43
//---------------
44

45     /**
46      * Processes a <CODE>get</CODE> operation.
47      * This method must not be called from remote.
48      *
49      * @param req The SnmpMibRequest object holding the list of variables to
50      * be retrieved. This list is composed of
51      * <CODE>SnmpVarBind</CODE> objects.
52      *
53      * @exception SnmpStatusException An error occured during the operation.
54      * @see SnmpMibAgent#get(SnmpMibRequest)
55      */

56     public void get(SnmpMibRequest req) throws SnmpStatusException;
57   
58     /**
59      * Processes a <CODE>getNext</CODE> operation.
60      * This method must not be called from remote.
61      *
62      * @param req The SnmpMibRequest object holding the list of variables to
63      * be retrieved. This list is composed of
64      * <CODE>SnmpVarBind</CODE> objects.
65      *
66      * @exception SnmpStatusException An error occured during the operation.
67      * @see SnmpMibAgent#getNext(SnmpMibRequest)
68      */

69     public void getNext(SnmpMibRequest req) throws SnmpStatusException;
70     
71     /**
72      * Processes a <CODE>getBulk</CODE> operation.
73      * This method must not be called from remote.
74      *
75      * @param req The SnmpMibRequest object holding the list of variables to
76      * be retrieved. This list is composed of
77      * <CODE>SnmpVarBind</CODE> objects.
78      *
79      * @param nonRepeat The number of variables, starting with the first
80      * variable in the variable-bindings, for which a single
81      * lexicographic successor is requested.
82      *
83      * @param maxRepeat The number of lexicographic successors requested
84      * for each of the last R variables. R is the number of variables
85      * following the first <CODE>nonRepeat</CODE> variables for which
86      * multiple lexicographic successors are requested.
87      *
88      * @exception SnmpStatusException An error occured during the operation.
89      * @see SnmpMibAgent#getBulk(SnmpMibRequest,int,int)
90      */

91     public void getBulk(SnmpMibRequest req, int nonRepeat, int maxRepeat)
92     throws SnmpStatusException;
93
94     /**
95      * Processes a <CODE>set</CODE> operation.
96      * This method must not be called from remote.
97      *
98      * @param req The SnmpMibRequest object holding the list of variables to
99      * be set. This list is composed of
100      * <CODE>SnmpVarBind</CODE> objects.
101      *
102      * @exception SnmpStatusException An error occured during the operation.
103      * @see SnmpMibAgent#set(SnmpMibRequest)
104      */

105     public void set(SnmpMibRequest req) throws SnmpStatusException;
106
107     /**
108      * Checks if a <CODE>set</CODE> operation can be performed.
109      * If the operation cannot be performed, the method should emit a
110      * <CODE>SnmpStatusException</CODE>.
111      *
112      * @param req The SnmpMibRequest object holding the list of variables to
113      * be set. This list is composed of
114      * <CODE>SnmpVarBind</CODE> objects.
115      *
116      * @exception SnmpStatusException The <CODE>set</CODE> operation
117      * cannot be performed.
118      * @see SnmpMibAgent#check(SnmpMibRequest)
119      */

120     public void check(SnmpMibRequest req) throws SnmpStatusException;
121         
122     // GETTERS AND SETTERS
123
//--------------------
124

125     /**
126      * Gets the reference to the MBean server in which the SNMP MIB is
127      * registered.
128      *
129      * @return The MBean server or null if the MIB is not registered in any
130      * MBean server.
131      */

132     public MBeanServer JavaDoc getMBeanServer();
133   
134     /**
135      * Gets the reference to the SNMP protocol adaptor to which the MIB is
136      * bound.
137      * <BR>This method is used for accessing the SNMP MIB handler property
138      * of the SNMP MIB agent in case of a standalone agent.
139      *
140      * @return The SNMP MIB handler.
141      */

142     public SnmpMibHandler getSnmpAdaptor();
143     
144     /**
145      * Sets the reference to the SNMP protocol adaptor through which the
146      * MIB will be SNMP accessible and add this new MIB in the SNMP MIB
147      * handler.
148      * <BR>This method is used for setting the SNMP MIB handler property of
149      * the SNMP MIB agent in case of a standalone agent.
150      *
151      * @param stack The SNMP MIB handler.
152      */

153     public void setSnmpAdaptor(SnmpMibHandler stack);
154
155     /**
156      * Sets the reference to the SNMP protocol adaptor through which the MIB
157      * will be SNMP accessible and add this new MIB in the SNMP MIB handler.
158      * This method is to be called to set a specific agent to a specific OID.
159      * This can be useful when dealing with MIB overlapping.
160      * Some OID can be implemented in more than one MIB. In this case, the
161      * OID nearer agent will be used on SNMP operations.
162      * @param stack The SNMP MIB handler.
163      * @param oids The set of OIDs this agent implements.
164      *
165      * @since 1.5
166      */

167     public void setSnmpAdaptor(SnmpMibHandler stack, SnmpOid[] oids);
168     
169     /**
170      * Sets the reference to the SNMP protocol adaptor through which the MIB
171      * will be SNMP accessible and add this new MIB in the SNMP MIB handler.
172      * Adds a new contextualized MIB in the SNMP MIB handler.
173      *
174      * @param stack The SNMP MIB handler.
175      * @param contextName The MIB context name. If null is passed, will be
176      * registered in the default context.
177      *
178      * @exception IllegalArgumentException If the parameter is null.
179      *
180      * @since 1.5
181      */

182     public void setSnmpAdaptor(SnmpMibHandler stack, String JavaDoc contextName);
183
184     /**
185      * Sets the reference to the SNMP protocol adaptor through which the MIB
186      * will be SNMP accessible and adds this new MIB in the SNMP MIB handler.
187      * Adds a new contextualized MIB in the SNMP MIB handler.
188      *
189      * @param stack The SNMP MIB handler.
190      * @param contextName The MIB context name. If null is passed, will be
191      * registered in the default context.
192      * @param oids The set of OIDs this agent implements.
193      * @exception IllegalArgumentException If the parameter is null.
194      *
195      * @since 1.5
196      */

197     public void setSnmpAdaptor(SnmpMibHandler stack,
198                    String JavaDoc contextName,
199                    SnmpOid[] oids);
200     
201     /**
202      * Gets the object name of the SNMP protocol adaptor to which the MIB is
203      * bound.
204      *
205      * @return The name of the SNMP protocol adaptor.
206      */

207     public ObjectName JavaDoc getSnmpAdaptorName();
208     
209     /**
210      * Sets the reference to the SNMP protocol adaptor through which the MIB
211      * will be SNMP accessible and add this new MIB in the SNMP MIB handler
212      * associated to the specified <CODE>name</CODE>.
213      *
214      * @param name The object name of the SNMP MIB handler.
215      *
216      * @exception InstanceNotFoundException The MBean does not exist in the
217      * MBean server.
218      * @exception ServiceNotFoundException This SNMP MIB is not registered
219      * in the MBean server or the requested service is not supported.
220      */

221     public void setSnmpAdaptorName(ObjectName JavaDoc name)
222     throws InstanceNotFoundException JavaDoc, ServiceNotFoundException JavaDoc;
223     
224
225     /**
226      * Sets the reference to the SNMP protocol adaptor through which the MIB
227      * will be SNMP accessible and add this new MIB in the SNMP MIB handler
228      * associated to the specified <CODE>name</CODE>.
229      * This method is to be called to set a specific agent to a specific OID.
230      * This can be useful when dealing with MIB overlapping.
231      * Some OID can be implemented in more than one MIB. In this case, the
232      * OID nearer agent will be used on SNMP operations.
233      * @param name The name of the SNMP protocol adaptor.
234      * @param oids The set of OIDs this agent implements.
235      * @exception InstanceNotFoundException The SNMP protocol adaptor does
236      * not exist in the MBean server.
237      *
238      * @exception ServiceNotFoundException This SNMP MIB is not registered
239      * in the MBean server or the requested service is not supported.
240      *
241      * @since 1.5
242      */

243     public void setSnmpAdaptorName(ObjectName JavaDoc name, SnmpOid[] oids)
244     throws InstanceNotFoundException JavaDoc, ServiceNotFoundException JavaDoc;
245
246     /**
247      * Sets the reference to the SNMP protocol adaptor through which the MIB
248      * will be SNMP accessible and add this new MIB in the SNMP MIB handler
249      * associated to the specified <CODE>name</CODE>.
250      *
251      * @param name The name of the SNMP protocol adaptor.
252      * @param contextName The MIB context name. If null is passed, will be
253      * registered in the default context.
254      * @exception InstanceNotFoundException The SNMP protocol adaptor does
255      * not exist in the MBean server.
256      *
257      * @exception ServiceNotFoundException This SNMP MIB is not registered
258      * in the MBean server or the requested service is not supported.
259      *
260      * @since 1.5
261      */

262     public void setSnmpAdaptorName(ObjectName JavaDoc name, String JavaDoc contextName)
263     throws InstanceNotFoundException JavaDoc, ServiceNotFoundException JavaDoc;
264
265      /**
266      * Sets the reference to the SNMP protocol adaptor through which the MIB
267      * will be SNMP accessible and add this new MIB in the SNMP MIB handler
268      * associated to the specified <CODE>name</CODE>.
269      *
270      * @param name The name of the SNMP protocol adaptor.
271      * @param contextName The MIB context name. If null is passed, will be
272      * registered in the default context.
273      * @param oids The set of OIDs this agent implements.
274      * @exception InstanceNotFoundException The SNMP protocol adaptor does
275      * not exist in the MBean server.
276      *
277      * @exception ServiceNotFoundException This SNMP MIB is not registered
278      * in the MBean server or the requested service is not supported.
279      *
280      * @since 1.5
281      */

282     public void setSnmpAdaptorName(ObjectName JavaDoc name,
283                    String JavaDoc contextName,
284                    SnmpOid[] oids)
285     throws InstanceNotFoundException JavaDoc, ServiceNotFoundException JavaDoc;
286     
287     /**
288      * Indicates whether or not the MIB module is bound to a SNMP protocol
289      * adaptor.
290      * As a reminder, only bound MIBs can be accessed through SNMP protocol
291      * adaptor.
292      *
293      * @return <CODE>true</CODE> if the MIB module is bound,
294      * <CODE>false</CODE> otherwise.
295      */

296     public boolean getBindingState();
297
298     /**
299      * Gets the MIB name.
300      *
301      * @return The MIB name.
302      */

303     public String JavaDoc getMibName();
304 }
305                     
306
Popular Tags