com.sun.jdmk.snmp.agent
Class SnmpMibAgent

java.lang.Object
  extended bycom.sun.jdmk.snmp.agent.SnmpMibAgent
All Implemented Interfaces:
MBeanRegistration, Serializable, SnmpMibAgentMBean
Direct Known Subclasses:
SnmpErrorHandlerAgent, SnmpMib, SnmpProxy

Deprecated. Use package com.sun.management.snmp.agent in preference to classes in this package. This class may be removed in a future version of Java DMK.

public abstract class SnmpMibAgent
extends Object
implements SnmpMibAgentMBean, MBeanRegistration, Serializable

Abstract class for representing an SNMP agent. The class is used by the SNMP protocol adaptor as the entry point in the SNMP agent to query.

Version:
4.38 04/22/04
Author:
Sun Microsystems, Inc
See Also:
Serialized Form

Field Summary
protected  String mibName
          Deprecated. The object name of the MIB.
protected  MBeanServer server
          Deprecated. The reference to the MBean server.
 
Constructor Summary
SnmpMibAgent()
          Deprecated. Default constructor.
 
Method Summary
 void check(SnmpMibRequest req)
          Deprecated. Checks if a set operation can be performed.
 void get(SnmpMibRequest req)
          Deprecated. Processes a get operation.
 boolean getBindingState()
          Deprecated. Indicates whether or not the MIB module is bound to a SNMP protocol adaptor.
 void getBulk(SnmpMibRequest req, int nonRepeat, int maxRepeat)
          Deprecated. Processes a getBulk operation.
 MBeanServer getMBeanServer()
          Deprecated. Gets the reference to the MBean server in which the SNMP MIB is registered.
 String getMibName()
          Deprecated. Gets the MIB name.
 void getNext(SnmpMibRequest req)
          Deprecated. Processes a getNext operation.
abstract  long[] getRootOid()
          Deprecated. Gets the root object identifier of the MIB.
 SnmpMibHandler getSnmpAdaptor()
          Deprecated. Gets the reference to the SNMP protocol adaptor to which the MIB is bound.
 ObjectName getSnmpAdaptorName()
          Deprecated. Gets the object name of the SNMP protocol adaptor to which the MIB is bound.
abstract  void init()
          Deprecated. Initializes the MIB (with no registration of the MBeans into the MBean server).
static SnmpMibRequest newMibRequest(SnmpEngine engine, SnmpPdu reqPdu, Vector vblist, int version, Object userData, String principal, int securityLevel, int securityModel, byte[] contextName, byte[] accessContextName)
          Deprecated. This is a factory method for creating new SnmpMibRequest objects.
static SnmpMibRequest newMibRequest(SnmpPdu reqPdu, Vector vblist, int version, Object userData)
          Deprecated. This is a factory method for creating new SnmpMibRequest objects.
static SnmpMibRequest newMibRequest(Vector vblist, int version, Object userData)
          Deprecated. As of Java Dynamic Management Kit 5.0, replaced by newMibRequest(javax.management.snmp.SnmpPdu, java.util.Vector, int, java.lang.Object)
 void postDeregister()
          Deprecated. Not used in this context.
 void postRegister(Boolean registrationDone)
          Deprecated. Not used in this context.
 void preDeregister()
          Deprecated. Not used in this context.
abstract  ObjectName preRegister(MBeanServer server, ObjectName name)
          Deprecated. Initializes the MIB but each single MBean representing the MIB is inserted into the MBean server.
 void set(SnmpMibRequest req)
          Deprecated. Processes a set operation.
 void setSnmpAdaptor(SnmpMibHandler stack)
          Deprecated. Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler.
 void setSnmpAdaptor(SnmpMibHandler stack, SnmpOid[] oids)
          Deprecated. Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler.
 void setSnmpAdaptor(SnmpMibHandler stack, String contextName)
          Deprecated. Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and adds this new MIB in the SNMP MIB handler.
 void setSnmpAdaptor(SnmpMibHandler stack, String contextName, SnmpOid[] oids)
          Deprecated. Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and adds this new MIB in the SNMP MIB handler.
 void setSnmpAdaptorName(ObjectName name)
          Deprecated. Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler associated to the specified name.
 void setSnmpAdaptorName(ObjectName name, SnmpOid[] oids)
          Deprecated. Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler associated to the specified name.
 void setSnmpAdaptorName(ObjectName name, String contextName)
          Deprecated. Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler associated to the specified name.
 void setSnmpAdaptorName(ObjectName name, String contextName, SnmpOid[] oids)
          Deprecated. Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler associated to the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mibName

protected String mibName
Deprecated. 
The object name of the MIB.


server

protected MBeanServer server
Deprecated. 
The reference to the MBean server.

Constructor Detail

SnmpMibAgent

public SnmpMibAgent()
Deprecated. 
Default constructor.

Method Detail

init

public abstract void init()
                   throws IllegalAccessException
Deprecated. 
Initializes the MIB (with no registration of the MBeans into the MBean server).

Throws:
IllegalAccessException - The MIB can not be initialized.

preRegister

public abstract ObjectName preRegister(MBeanServer server,
                                       ObjectName name)
                                throws Exception
Deprecated. 
Initializes the MIB but each single MBean representing the MIB is inserted into the MBean server.

Specified by:
preRegister in interface MBeanRegistration
Parameters:
server - The MBean server to register the service with.
name - The object name.
Returns:
The name of the SNMP MIB registered.
Throws:
Exception

postRegister

public void postRegister(Boolean registrationDone)
Deprecated. 
Not used in this context.

Specified by:
postRegister in interface MBeanRegistration

preDeregister

public void preDeregister()
                   throws Exception
Deprecated. 
Not used in this context.

Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Deprecated. 
Not used in this context.

Specified by:
postDeregister in interface MBeanRegistration

get

public void get(SnmpMibRequest req)
         throws SnmpStatusException
Deprecated. 
Processes a get operation. This method must update the SnmpVarBinds contained in the SnmpMibRequest req parameter.

Specified by:
get in interface SnmpMibAgentMBean
Parameters:
req - The SnmpMibRequest object holding the list of variable to be retrieved. This list is composed of SnmpVarBind objects.
Throws:
SnmpStatusException - An error occurred during the operation.
See Also:
get(SnmpMibRequest)

getNext

public void getNext(SnmpMibRequest req)
             throws SnmpStatusException
Deprecated. 
Processes a getNext operation. This method must update the SnmpVarBinds contained in the SnmpMibRequest req parameter.

Specified by:
getNext in interface SnmpMibAgentMBean
Parameters:
req - The SnmpMibRequest object holding the list of OIDs from which the next variables should be retrieved. This list is composed of SnmpVarBind objects.
Throws:
SnmpStatusException - An error occurred during the operation.
See Also:
getNext(SnmpMibRequest)

getBulk

public void getBulk(SnmpMibRequest req,
                    int nonRepeat,
                    int maxRepeat)
             throws SnmpStatusException
Deprecated. 
Processes a getBulk operation. This method must update the SnmpVarBinds contained in the SnmpMibRequest req parameter.

Specified by:
getBulk in interface SnmpMibAgentMBean
Parameters:
req - The SnmpMibRequest object holding the list of variable to be retrieved. This list is composed of SnmpVarBind objects.
nonRepeat - The number of variables, starting with the first variable in the variable-bindings, for which a single lexicographic successor is requested.
maxRepeat - The number of lexicographic successors requested for each of the last R variables. R is the number of variables following the first nonRepeat variables for which multiple lexicographic successors are requested.
Throws:
SnmpStatusException - An error occurred during the operation.
See Also:
getBulk(SnmpMibRequest,int,int)

set

public void set(SnmpMibRequest req)
         throws SnmpStatusException
Deprecated. 
Processes a set operation. This method must update the SnmpVarBinds contained in the SnmpMibRequest req parameter. This method is called during the second phase of the SET two-phase commit.

Specified by:
set in interface SnmpMibAgentMBean
Parameters:
req - The SnmpMibRequest object holding the list of variable to be set. This list is composed of SnmpVarBind objects.
Throws:
SnmpStatusException - An error occurred during the operation. Throwing an exception in this method will break the atomicity of the SET operation. Care must be taken so that the exception is thrown in the check(SnmpMibRequest) method instead.
See Also:
set(SnmpMibRequest)

check

public void check(SnmpMibRequest req)
           throws SnmpStatusException
Deprecated. 
Checks if a set operation can be performed. If the operation can not be performed, the method should raise an SnmpStatusException. This method is called during the first phase of the SET two-phase commit.

Specified by:
check in interface SnmpMibAgentMBean
Parameters:
req - The SnmpMibRequest object holding the list of variable to be set. This list is composed of SnmpVarBind objects.
Throws:
SnmpStatusException - The set operation cannot be performed.
See Also:
check(SnmpMibRequest)

getRootOid

public abstract long[] getRootOid()
Deprecated. 
Gets the root object identifier of the MIB.

The root object identifier is the object identifier uniquely identifying the MIB.

Returns:
The root object identifier.

getMBeanServer

public MBeanServer getMBeanServer()
Deprecated. 
Gets the reference to the MBean server in which the SNMP MIB is registered.

Specified by:
getMBeanServer in interface SnmpMibAgentMBean
Returns:
The MBean server or null if the MIB is not registered in any MBean server.

getSnmpAdaptor

public SnmpMibHandler getSnmpAdaptor()
Deprecated. 
Gets the reference to the SNMP protocol adaptor to which the MIB is bound.

Specified by:
getSnmpAdaptor in interface SnmpMibAgentMBean
Returns:
The SNMP MIB handler.

setSnmpAdaptor

public void setSnmpAdaptor(SnmpMibHandler stack)
Deprecated. 
Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler. If this MIB was previously added in an SnmpMibHandler, it will be removed from it.

Specified by:
setSnmpAdaptor in interface SnmpMibAgentMBean
Parameters:
stack - The SNMP MIB handler.

setSnmpAdaptor

public void setSnmpAdaptor(SnmpMibHandler stack,
                           SnmpOid[] oids)
Deprecated. 
Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler. This method is to be called to set a specific agent to a specific OID. This can be useful when dealing with MIB overlapping. Some OID can be implemented in more than one MIB. In this case, the OID nearest the agent will be used on SNMP operations. If this MIB was previously added in an SnmpMibHandler, it will be removed from it.

Specified by:
setSnmpAdaptor in interface SnmpMibAgentMBean
Parameters:
stack - The SNMP MIB handler.
oids - The set of OIDs this agent implements. If null or oids.length == 0, this is equivalent to calling setSnmpAdaptor(SnmpMibHandler stack)
Since:
Java DMK 5.0

setSnmpAdaptor

public void setSnmpAdaptor(SnmpMibHandler stack,
                           String contextName)
Deprecated. 
Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and adds this new MIB in the SNMP MIB handler. Adds a new contextualized MIB in the SNMP MIB handler. If this MIB was previously added in an SnmpMibHandler in the specified context, it will be removed from it for this context.

Specified by:
setSnmpAdaptor in interface SnmpMibAgentMBean
Parameters:
stack - The SNMP MIB handler.
contextName - The MIB context name. If null or contextName.length == 0, will be registered in the default context.
Throws:
IllegalArgumentException - If the parameter is null.
Since:
Java DMK 5.0

setSnmpAdaptor

public void setSnmpAdaptor(SnmpMibHandler stack,
                           String contextName,
                           SnmpOid[] oids)
Deprecated. 
Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and adds this new MIB in the SNMP MIB handler. Adds a new contextualized MIB in the SNMP MIB handler. If this MIB was previously added in an SnmpMibHandler in the specified context, it will be removed from it for this context.

Specified by:
setSnmpAdaptor in interface SnmpMibAgentMBean
Parameters:
stack - The SNMP MIB handler.
contextName - The MIB context name. If null or contextName.length == 0, will be registered in the default context.
oids - The set of OIDs this agent implements. If null or oids.length == 0, this is equivalent to calling setSnmpAdaptor(SnmpMibHandler stack, String contextName)
Throws:
IllegalArgumentException - If the parameter is null.
Since:
Java DMK 5.0

getSnmpAdaptorName

public ObjectName getSnmpAdaptorName()
Deprecated. 
Gets the object name of the SNMP protocol adaptor to which the MIB is bound.

Specified by:
getSnmpAdaptorName in interface SnmpMibAgentMBean
Returns:
The name of the SNMP protocol adaptor.

setSnmpAdaptorName

public void setSnmpAdaptorName(ObjectName name)
                        throws InstanceNotFoundException,
                               ServiceNotFoundException
Deprecated. 
Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler associated to the specified name. If this MIB was previously added in an SnmpMibHandler, it will be removed from it.

Specified by:
setSnmpAdaptorName in interface SnmpMibAgentMBean
Parameters:
name - The name of the SNMP protocol adaptor.
Throws:
InstanceNotFoundException - The SNMP protocol adaptor does not exist in the MBean server.
ServiceNotFoundException - This SNMP MIB is not registered in the MBean server or the requested service is not supported.

setSnmpAdaptorName

public void setSnmpAdaptorName(ObjectName name,
                               SnmpOid[] oids)
                        throws InstanceNotFoundException,
                               ServiceNotFoundException
Deprecated. 
Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler associated to the specified name. This method is to be called to set a specific agent to a specific OID. This can be useful when dealing with MIB overlapping. Some OID can be implemented in more than one MIB. In this case, the OID nearer agent will be used on SNMP operations. If this MIB was previously added in an SnmpMibHandler, it will be removed from it.

Specified by:
setSnmpAdaptorName in interface SnmpMibAgentMBean
Parameters:
name - The name of the SNMP protocol adaptor.
oids - The set of OIDs this agent implements. If null or oids.length == 0, this is equivalent to calling setSnmpAdaptorName(ObjectName name)
Throws:
InstanceNotFoundException - The SNMP protocol adaptor does not exist in the MBean server.
ServiceNotFoundException - This SNMP MIB is not registered in the MBean server or the requested service is not supported.
Since:
Java DMK 5.0

setSnmpAdaptorName

public void setSnmpAdaptorName(ObjectName name,
                               String contextName)
                        throws InstanceNotFoundException,
                               ServiceNotFoundException
Deprecated. 
Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler associated to the specified name. If this MIB was previously added in an SnmpMibHandler in the specified context, it will be removed from it for this context.

Specified by:
setSnmpAdaptorName in interface SnmpMibAgentMBean
Parameters:
name - The name of the SNMP protocol adaptor.
contextName - The MIB context name. If null or contextName.length == 0, will be registered in the default context.
Throws:
InstanceNotFoundException - The SNMP protocol adaptor does not exist in the MBean server.
ServiceNotFoundException - This SNMP MIB is not registered in the MBean server or the requested service is not supported.
Since:
Java DMK 5.0

setSnmpAdaptorName

public void setSnmpAdaptorName(ObjectName name,
                               String contextName,
                               SnmpOid[] oids)
                        throws InstanceNotFoundException,
                               ServiceNotFoundException
Deprecated. 
Sets the reference to the SNMP protocol adaptor through which the MIB will be SNMP accessible and add this new MIB in the SNMP MIB handler associated to the specified name. If this MIB was previously added in an SnmpMibHandler in the specified context, it will be removed from it for this context.

Specified by:
setSnmpAdaptorName in interface SnmpMibAgentMBean
Parameters:
name - The name of the SNMP protocol adaptor.
contextName - The MIB context name. If null or contextName.length == 0, will be registered in the default context.
oids - The set of OIDs this agent implements. If null or oids.length == 0, this is equivalent to calling setSnmpAdaptorName(ObjectName name)
Throws:
InstanceNotFoundException - The SNMP protocol adaptor does not exist in the MBean server.
ServiceNotFoundException - This SNMP MIB is not registered in the MBean server or the requested service is not supported.
Since:
Java DMK 5.0

getBindingState

public boolean getBindingState()
Deprecated. 
Indicates whether or not the MIB module is bound to a SNMP protocol adaptor. As a reminder, only bound MIBs can be accessed through SNMP protocol adaptor.

Specified by:
getBindingState in interface SnmpMibAgentMBean
Returns:
true if the MIB module is bound, false otherwise.

getMibName

public String getMibName()
Deprecated. 
Gets the MIB name.

Specified by:
getMibName in interface SnmpMibAgentMBean
Returns:
The MIB name.

newMibRequest

public static SnmpMibRequest newMibRequest(Vector vblist,
                                           int version,
                                           Object userData)
Deprecated. As of Java Dynamic Management Kit 5.0, replaced by newMibRequest(javax.management.snmp.SnmpPdu, java.util.Vector, int, java.lang.Object)

This is a factory method for creating new SnmpMibRequest objects.

Parameters:
vblist - The vector of SnmpVarBind objects in which the MIB concerned by this request is involved.
version - The protocol version of the SNMP request.
userData - User allocated contextual data.
Returns:
A new SnmpMibRequest object.

newMibRequest

public static SnmpMibRequest newMibRequest(SnmpPdu reqPdu,
                                           Vector vblist,
                                           int version,
                                           Object userData)
Deprecated. 
This is a factory method for creating new SnmpMibRequest objects.

Parameters:
reqPdu - The received PDU.
vblist - The vector of SnmpVarBind objects in which the MIB concerned by this request is involved.
version - The protocol version of the SNMP request.
userData - User allocated contextual data.
Returns:
A new SnmpMibRequest object.
Since:
Java DMK 5.0

newMibRequest

public static SnmpMibRequest newMibRequest(SnmpEngine engine,
                                           SnmpPdu reqPdu,
                                           Vector vblist,
                                           int version,
                                           Object userData,
                                           String principal,
                                           int securityLevel,
                                           int securityModel,
                                           byte[] contextName,
                                           byte[] accessContextName)
Deprecated. 
This is a factory method for creating new SnmpMibRequest objects.

Parameters:
engine - The local engine.
reqPdu - The received pdu.
vblist - The vector of SnmpVarBind objects in which the MIB concerned by this request is involved.
version - The protocol version of the SNMP request.
userData - User allocated contextual data.
Returns:
A new SnmpMibRequest object.
Since:
Java DMK 5.0

FCS Release
jdmk-5_1-b34.1 2005.02.10_16:46:09_MET

Copyright 1998-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.