/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
// java imports
//
// jmx imports
//
// SNMP Runtime imports
//
/**
* Implements an adaptor on top of the SNMP protocol.
* <P>
* When this SNMP protocol adaptor is started it creates a datagram socket
* and is able to receive requests and send traps or inform requests.
* When it is stopped, the socket is closed and neither requests
* <P>
* The default port number of the socket is 161. This default value can be
* changed by specifying a port number:
* <UL>
* <LI>in the object constructor</LI>
* <LI>using the {@link com.sun.jmx.snmp.daemon.CommunicatorServer#setPort
* setPort} method before starting the adaptor</LI>
* </UL>
* The default object name is defined by {@link
* com.sun.jmx.snmp.ServiceName#DOMAIN com.sun.jmx.snmp.ServiceName.DOMAIN}
* and {@link com.sun.jmx.snmp.ServiceName#SNMP_ADAPTOR_SERVER
* com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_SERVER}.
* <P>
* The SNMP protocol adaptor supports versions 1 and 2 of the SNMP protocol
* in a stateless way: when it receives a v1 request, it replies with a v1
* response, when it receives a v2 request it replies with a v2 response.
* <BR>The method {@link #snmpV1Trap snmpV1Trap} sends traps using SNMP v1
* format.
* The method {@link #snmpV2Trap snmpV2Trap} sends traps using SNMP v2 format.
* The method {@link #snmpInformRequest snmpInformRequest} sends inform
* requests using SNMP v2 format.
* <P>
* To receive data packets, the SNMP protocol adaptor uses a buffer
* which size can be configured using the property <CODE>bufferSize</CODE>
* (default value is 1024).
* Packets which do not fit into the buffer are rejected.
* Increasing <CODE>bufferSize</CODE> allows the exchange of bigger packets.
* However, the underlying networking system may impose a limit on the size
* of UDP packets.
* Packets which size exceed this limit will be rejected, no matter what
* the value of <CODE>bufferSize</CODE> actually is.
* <P>
* An SNMP protocol adaptor may serve several managers concurrently. The
* number of concurrent managers can be limited using the property
* <CODE>maxActiveClientCount</CODE>.
* <p>
* The SNMP protocol adaptor specifies a default value (10) for the
* <CODE>maxActiveClientCount</CODE> property. When the adaptor is stopped,
* the active requests are interrupted and an error result is sent to
* the managers.
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
// PRIVATE VARIABLES
//------------------
/**
* Port number for sending SNMP traps.
* <BR>The default value is 162.
*/
/**
* Port number for sending SNMP inform requests.
* <BR>The default value is 162.
*/
/**
* The <CODE>InetAddress</CODE> used when creating the datagram socket.
* <BR>It is specified when creating the SNMP protocol adaptor.
* If not specified, the local host machine is used.
*/
/**
* The IP address based ACL used by this SNMP protocol adaptor.
*/
/**
* The factory object.
*/
/**
* The user-data factory object.
*/
/**
* Indicates if the SNMP protocol adaptor sends a response in case
* of authentication failure
*/
private boolean authRespEnabled = true;
/**
* Indicates if authentication traps are enabled.
*/
private boolean authTrapEnabled = true;
/**
* The enterprise OID.
* <BR>The default value is "1.3.6.1.4.1.42".
*/
/**
* The buffer size of the SNMP protocol adaptor.
* This buffer size is used for both incoming request and outgoing
* inform requests.
* <BR>The default value is 1024.
*/
/**
* Whether ACL must be used.
*/
private transient boolean useAcl = true;
// SENDING SNMP INFORMS STUFF
//---------------------------
/**
* Number of times to try an inform request before giving up.
* The default number is 3.
*/
/**
* The amount of time to wait for an inform response from the manager.
* The default amount of time is 3000 millisec.
*/
// VARIABLES REQUIRED FOR IMPLEMENTING SNMP GROUP (MIBII)
//-------------------------------------------------------
/**
* The <CODE>snmpOutTraps</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpOutGetResponses</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpOutGenErrs</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpOutBadValues</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpOutNoSuchNames</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpOutTooBigs</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpOutPkts</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInASNParseErrs</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInBadCommunityUses</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInBadCommunityNames</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInBadVersions</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInGetRequests</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInGetNexts</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInSetRequests</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInPkts</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInTotalReqVars</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInTotalSetVars</CODE> value defined in MIB-II.
*/
/**
* The <CODE>snmpInTotalSetVars</CODE> value defined in rfc 1907 MIB-II.
*/
"Interrupted system call";
static {
if (s != null) {
try {
} catch (Exception e) {
SnmpAdaptorServer.class.getName(),
"<static init>",
"Got wrong value for com.sun.jmx.snmp.threadnumber: " +
s + ". Use the default value: " + threadNumber);
}
}
}
// PUBLIC CONSTRUCTORS
//--------------------
/**
* Initializes this SNMP protocol adaptor using the default port (161).
* Use the {@link com.sun.jmx.snmp.IPAcl.SnmpAcl} default
* implementation of the <CODE>InetAddressAcl</CODE> interface.
*/
public SnmpAdaptorServer() {
null) ;
}
/**
* Initializes this SNMP protocol adaptor using the specified port.
* Use the {@link com.sun.jmx.snmp.IPAcl.SnmpAcl} default
* implementation of the <CODE>InetAddressAcl</CODE> interface.
*
* @param port The port number for sending SNMP responses.
*/
}
/**
* Initializes this SNMP protocol adaptor using the default port (161)
* and the specified IP address based ACL implementation.
*
* @param acl The <CODE>InetAddressAcl</CODE> implementation.
* <code>null</code> means no ACL - everybody is authorized.
*
* @since 1.5
*/
null) ;
}
/**
* Initializes this SNMP protocol adaptor using the default port (161)
* and the
* specified <CODE>InetAddress</CODE>.
* Use the {@link com.sun.jmx.snmp.IPAcl.SnmpAcl} default
* implementation of the <CODE>InetAddressAcl</CODE> interface.
*
* @param addr The IP address to bind.
*/
addr) ;
}
/**
* Initializes this SNMP protocol adaptor using the specified port and the
* specified IP address based ACL implementation.
*
* @param acl The <CODE>InetAddressAcl</CODE> implementation.
* <code>null</code> means no ACL - everybody is authorized.
* @param port The port number for sending SNMP responses.
*
* @since 1.5
*/
}
/**
* Initializes this SNMP protocol adaptor using the specified port and the
* specified <CODE>InetAddress</CODE>.
* Use the {@link com.sun.jmx.snmp.IPAcl.SnmpAcl} default
* implementation of the <CODE>InetAddressAcl</CODE> interface.
*
* @param port The port number for sending SNMP responses.
* @param addr The IP address to bind.
*/
}
/**
* Initializes this SNMP protocol adaptor using the specified IP
* address based ACL implementation and the specified
* <CODE>InetAddress</CODE>.
*
* @param acl The <CODE>InetAddressAcl</CODE> implementation.
* @param addr The IP address to bind.
*
* @since 1.5
*/
addr) ;
}
/**
* Initializes this SNMP protocol adaptor using the specified port, the
* specified address based ACL implementation and the specified
* <CODE>InetAddress</CODE>.
*
* @param acl The <CODE>InetAddressAcl</CODE> implementation.
* @param port The port number for sending SNMP responses.
* @param addr The IP address to bind.
*
* @since 1.5
*/
}
/**
* Initializes this SNMP protocol adaptor using the specified port and the
* specified <CODE>InetAddress</CODE>.
* This constructor allows to initialize an SNMP adaptor without using
* the ACL mechanism (by setting the <CODE>useAcl</CODE> parameter to
* false).
* <br>This constructor must be used in particular with a platform that
* does not support the <CODE>java.security.acl</CODE> package like pJava.
*
* @param useAcl Specifies if this new SNMP adaptor uses the ACL mechanism.
* If the specified parameter is set to <CODE>true</CODE>, this
* constructor is equivalent to
* <CODE>SnmpAdaptorServer((int)port,(InetAddress)addr)</CODE>.
* @param port The port number for sending SNMP responses.
* @param addr The IP address to bind.
*/
}
// If forceAcl is `true' and InetAddressAcl is null, then a default
// SnmpAcl object is created.
//
super(CommunicatorServer.SNMP_TYPE) ;
// Initialize the ACL implementation.
//
try {
acl = (InetAddressAcl)
new SnmpAcl("SNMP protocol adaptor IP ACL");
} catch (UnknownHostException e) {
"constructor", "UnknowHostException when creating ACL",e);
}
}
} else {
}
}
// GETTERS AND SETTERS
//--------------------
/**
* Gets the number of managers that have been processed by this
* SNMP protocol adaptor since its creation.
*
* @return The number of managers handled by this SNMP protocol adaptor
* since its creation. This counter is not reset by the <CODE>stop</CODE>
* method.
*/
public int getServedClientCount() {
return super.getServedClientCount();
}
/**
* Gets the number of managers currently being processed by this
* SNMP protocol adaptor.
*
* @return The number of managers currently being processed by this
* SNMP protocol adaptor.
*/
public int getActiveClientCount() {
return super.getActiveClientCount();
}
/**
* Gets the maximum number of managers that this SNMP protocol adaptor can
* process concurrently.
*
* @return The maximum number of managers that this SNMP protocol adaptor
* can process concurrently.
*/
public int getMaxActiveClientCount() {
return super.getMaxActiveClientCount();
}
/**
* Sets the maximum number of managers this SNMP protocol adaptor can
* process concurrently.
*
* @param c The number of managers.
*
* @exception java.lang.IllegalStateException This method has been invoked
* while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
*/
public void setMaxActiveClientCount(int c)
super.setMaxActiveClientCount(c);
}
/**
* Returns the Ip address based ACL used by this SNMP protocol adaptor.
* @return The <CODE>InetAddressAcl</CODE> implementation.
*
* @since 1.5
*/
return (InetAddressAcl)ipacl;
}
/**
* Returns the port used by this SNMP protocol adaptor for sending traps.
* By default, port 162 is used.
*
* @return The port number for sending SNMP traps.
*/
}
/**
* Sets the port used by this SNMP protocol adaptor for sending traps.
*
* @param port The port number for sending SNMP traps.
*/
}
/**
* Sets the port used by this SNMP protocol adaptor for sending traps.
*
* @param port The port number for sending SNMP traps.
*/
if (val < 0) throw new
IllegalArgumentException("Trap port cannot be a negative value");
}
/**
* Returns the port used by this SNMP protocol adaptor for sending
* inform requests. By default, port 162 is used.
*
* @return The port number for sending SNMP inform requests.
*/
public int getInformPort() {
return informPort;
}
/**
* Sets the port used by this SNMP protocol adaptor for sending
* inform requests.
*
* @param port The port number for sending SNMP inform requests.
*/
if (port < 0)
throw new IllegalArgumentException("Inform request port "+
"cannot be a negative value");
informPort= port ;
}
/**
* Returns the protocol of this SNMP protocol adaptor.
*
* @return The string "snmp".
*/
return "snmp";
}
/**
* Returns the buffer size of this SNMP protocol adaptor.
* This buffer size is used for both incoming request and outgoing
* inform requests.
* By default, buffer size 1024 is used.
*
* @return The buffer size.
*/
return new Integer(bufferSize) ;
}
/**
* Sets the buffer size of this SNMP protocol adaptor.
* This buffer size is used for both incoming request and outgoing
* inform requests.
*
* @param s The buffer size.
*
* @exception java.lang.IllegalStateException This method has been invoked
* while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
*/
throw new IllegalStateException("Stop server before carrying out"+
" this operation");
}
bufferSize = s.intValue() ;
}
/**
* Gets the number of times to try sending an inform request before
* giving up.
* By default, a maximum of 3 tries is used.
* @return The maximun number of tries.
*/
final public int getMaxTries() {
return maxTries;
}
/**
* Changes the maximun number of times to try sending an inform
* request before giving up.
* @param newMaxTries The maximun number of tries.
*/
if (newMaxTries < 0)
throw new IllegalArgumentException();
}
/**
* Gets the timeout to wait for an inform response from the manager.
* By default, a timeout of 3 seconds is used.
* @return The value of the timeout property.
*/
final public int getTimeout() {
return timeout;
}
/**
* Changes the timeout to wait for an inform response from the manager.
* @param newTimeout The timeout (in milliseconds).
*/
if (newTimeout < 0)
throw new IllegalArgumentException();
}
/**
* Returns the message factory of this SNMP protocol adaptor.
*
* @return The factory object.
*/
return pduFactory ;
}
/**
* Sets the message factory of this SNMP protocol adaptor.
*
* @param factory The factory object (null means the default factory).
*/
pduFactory = new SnmpPduFactoryBER() ;
else
pduFactory = factory ;
}
/**
* Set the user-data factory of this SNMP protocol adaptor.
*
* @param factory The factory object (null means no factory).
* @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
*/
}
/**
* Get the user-data factory associated with this SNMP protocol adaptor.
*
* @return The factory object (null means no factory).
* @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
*/
return userDataFactory;
}
/**
* Returns <CODE>true</CODE> if authentication traps are enabled.
* <P>
* When this feature is enabled, the SNMP protocol adaptor sends
* an <CODE>authenticationFailure</CODE> trap each time an
* authentication fails.
* <P>
* The default behaviour is to send authentication traps.
*
* @return <CODE>true</CODE> if authentication traps are enabled,
* <CODE>false</CODE> otherwise.
*/
public boolean getAuthTrapEnabled() {
return authTrapEnabled ;
}
/**
* Sets the flag indicating if traps need to be sent in case of
* authentication failure.
*
* @param enabled Flag indicating if traps need to be sent.
*/
}
/**
* Returns <code>true</code> if this SNMP protocol adaptor sends a
* response in case of authentication failure.
* <P>
* When this feature is enabled, the SNMP protocol adaptor sends a
* response with <CODE>noSuchName</CODE> or <CODE>readOnly</CODE> when
* the authentication failed. If the flag is disabled, the
* SNMP protocol adaptor trashes the PDU silently.
* <P>
* The default behavior is to send responses.
*
* @return <CODE>true</CODE> if responses are sent.
*/
public boolean getAuthRespEnabled() {
return authRespEnabled ;
}
/**
* Sets the flag indicating if responses need to be sent in case of
* authentication failure.
*
* @param enabled Flag indicating if responses need to be sent.
*/
}
/**
* Returns the enterprise OID. It is used by
* {@link #snmpV1Trap snmpV1Trap} to fill the 'enterprise' field of the
* trap request.
*
* @return The OID in string format "x.x.x.x".
*/
return enterpriseOid.toString() ;
}
/**
* Sets the enterprise OID.
*
* @param oid The OID in string format "x.x.x.x".
*
* @exception IllegalArgumentException The string format is incorrect
*/
}
/**
* Returns the names of the MIBs available in this SNMP protocol adaptor.
*
* @return An array of MIB names.
*/
int i = 0 ;
}
return result ;
}
// GETTERS FOR SNMP GROUP (MIBII)
//-------------------------------
/**
* Returns the <CODE>snmpOutTraps</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpOutTraps</CODE> value.
*/
return new Long(snmpOutTraps);
}
/**
* Returns the <CODE>snmpOutGetResponses</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpOutGetResponses</CODE> value.
*/
return new Long(snmpOutGetResponses);
}
/**
* Returns the <CODE>snmpOutGenErrs</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpOutGenErrs</CODE> value.
*/
return new Long(snmpOutGenErrs);
}
/**
* Returns the <CODE>snmpOutBadValues</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpOutBadValues</CODE> value.
*/
return new Long(snmpOutBadValues);
}
/**
* Returns the <CODE>snmpOutNoSuchNames</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpOutNoSuchNames</CODE> value.
*/
return new Long(snmpOutNoSuchNames);
}
/**
* Returns the <CODE>snmpOutTooBigs</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpOutTooBigs</CODE> value.
*/
return new Long(snmpOutTooBigs);
}
/**
* Returns the <CODE>snmpInASNParseErrs</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInASNParseErrs</CODE> value.
*/
return new Long(snmpInASNParseErrs);
}
/**
* Returns the <CODE>snmpInBadCommunityUses</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInBadCommunityUses</CODE> value.
*/
return new Long(snmpInBadCommunityUses);
}
/**
* Returns the <CODE>snmpInBadCommunityNames</CODE> value defined in
* MIB-II.
*
* @return The <CODE>snmpInBadCommunityNames</CODE> value.
*/
return new Long(snmpInBadCommunityNames);
}
/**
* Returns the <CODE>snmpInBadVersions</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInBadVersions</CODE> value.
*/
return new Long(snmpInBadVersions);
}
/**
* Returns the <CODE>snmpOutPkts</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpOutPkts</CODE> value.
*/
return new Long(snmpOutPkts);
}
/**
* Returns the <CODE>snmpInPkts</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInPkts</CODE> value.
*/
return new Long(snmpInPkts);
}
/**
* Returns the <CODE>snmpInGetRequests</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInGetRequests</CODE> value.
*/
return new Long(snmpInGetRequests);
}
/**
* Returns the <CODE>snmpInGetNexts</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInGetNexts</CODE> value.
*/
return new Long(snmpInGetNexts);
}
/**
* Returns the <CODE>snmpInSetRequests</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInSetRequests</CODE> value.
*/
return new Long(snmpInSetRequests);
}
/**
* Returns the <CODE>snmpInTotalSetVars</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInTotalSetVars</CODE> value.
*/
return new Long(snmpInTotalSetVars);
}
/**
* Returns the <CODE>snmpInTotalReqVars</CODE> value defined in MIB-II.
*
* @return The <CODE>snmpInTotalReqVars</CODE> value.
*/
return new Long(snmpInTotalReqVars);
}
/**
* Returns the <CODE>snmpSilentDrops</CODE> value defined in RFC
* 1907 NMPv2-MIB .
*
* @return The <CODE>snmpSilentDrops</CODE> value.
*
* @since 1.5
*/
return new Long(snmpSilentDrops);
}
/**
* Returns the <CODE>snmpProxyDrops</CODE> value defined in RFC
* 1907 NMPv2-MIB .
*
* @return The <CODE>snmpProxyDrops</CODE> value.
*
* @since 1.5
*/
return new Long(0);
}
// PUBLIC METHODS
//---------------
/**
* Allows the MBean to perform any operations it needs before being
* registered in the MBean server.
* If the name of the SNMP protocol adaptor MBean is not specified,
* it is initialized with the default value:
* {@link com.sun.jmx.snmp.ServiceName#DOMAIN
* com.sun.jmx.snmp.ServiceName.DOMAIN}:{@link
* com.sun.jmx.snmp.ServiceName#SNMP_ADAPTOR_SERVER
* com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_SERVER}.
* If any exception is raised, the SNMP protocol adaptor MBean will
* not be registered in the MBean server.
*
* @param server The MBean server to register the service with.
* @param name The object name.
*
* @return The name of the SNMP protocol adaptor registered.
*
* @exception java.lang.Exception
*/
}
}
/**
* Not used in this context.
*/
super.postRegister(registrationDone);
}
/**
* Not used in this context.
*/
super.preDeregister();
}
/**
* Not used in this context.
*/
public void postDeregister() {
super.postDeregister();
}
/**
* Adds a new MIB in the SNMP MIB handler.
*
* @param mib The MIB to add.
*
* @return A reference to the SNMP MIB handler.
*
* @exception IllegalArgumentException If the parameter is null.
*/
throws IllegalArgumentException {
throw new IllegalArgumentException() ;
}
return this;
}
/**
* Adds a 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 nearer agent will be used on SNMP operations.
*
* @param mib The MIB to add.
* @param oids The set of OIDs this agent implements.
*
* @return A reference to the SNMP MIB handler.
*
* @exception IllegalArgumentException If the parameter is null.
*
* @since 1.5
*/
throws IllegalArgumentException {
throw new IllegalArgumentException() ;
}
//If null oid array, just add it to the mib.
}
return this;
}
/**
* Adds a new MIB in the SNMP MIB handler. In SNMP V1 and V2 the
* <CODE>contextName</CODE> is useless and this method
* is equivalent to <CODE>addMib(SnmpMibAgent mib)</CODE>.
*
* @param mib The MIB to add.
* @param contextName The MIB context name.
* @return A reference on the SNMP MIB handler.
*
* @exception IllegalArgumentException If the parameter is null.
*
* @since 1.5
*/
throws IllegalArgumentException {
}
/**
* Adds a new MIB in the SNMP MIB handler. In SNMP V1 and V2 the
* <CODE>contextName</CODE> is useless and this method
* is equivalent to <CODE>addMib(SnmpMibAgent mib, SnmpOid[] oids)</CODE>.
*
* @param mib The MIB to add.
* @param contextName The MIB context. If null is passed, will be
* registered in the default context.
* @param oids The set of OIDs this agent implements.
*
* @return A reference to the SNMP MIB handler.
*
* @exception IllegalArgumentException If the parameter is null.
*
* @since 1.5
*/
throws IllegalArgumentException {
}
/**
* Removes the specified MIB from the SNMP protocol adaptor.
* In SNMP V1 and V2 the <CODE>contextName</CODE> is useless and this
* method is equivalent to <CODE>removeMib(SnmpMibAgent mib)</CODE>.
*
* @param mib The MIB to be removed.
* @param contextName The context name used at registration time.
*
* @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was
* a MIB included in the SNMP MIB handler, <CODE>false</CODE>
* otherwise.
*
* @since 1.5
*/
}
/**
* Removes the specified MIB from the SNMP protocol adaptor.
*
* @param mib The MIB to be removed.
*
* @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was a MIB
* included in the SNMP MIB handler, <CODE>false</CODE> otherwise.
*/
}
/**
* Removes the specified MIB from the SNMP protocol adaptor.
*
* @param mib The MIB to be removed.
* @param oids The oid the MIB was previously registered for.
* @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was
* a MIB included in the SNMP MIB handler, <CODE>false</CODE>
* otherwise.
*
* @since 1.5
*/
}
/**
* Removes the specified MIB from the SNMP protocol adaptor.
*
* @param mib The MIB to be removed.
* @param contextName The context name used at registration time.
* @param oids The oid the MIB was previously registered for.
* @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was
* a MIB included in the SNMP MIB handler, <CODE>false</CODE>
* otherwise.
*
* @since 1.5
*/
}
// SUBCLASSING OF COMMUNICATOR SERVER
//-----------------------------------
/**
* Creates the datagram socket.
*/
protected void doBind()
throws CommunicationException, InterruptedException {
try {
synchronized (this) {
}
dbgTag = makeDebugTag();
} catch (SocketException e) {
throw new InterruptedException(e.toString()) ;
else {
}
throw new CommunicationException(e) ;
}
}
}
/**
* Return the actual port to which the adaptor is bound.
* Can be different from the port given at construction time if
* that port number was 0.
* @return the actual port to which the adaptor is bound.
**/
public int getPort() {
synchronized (this) {
}
return super.getPort();
}
/**
* Closes the datagram socket.
*/
protected void doUnbind()
throws CommunicationException, InterruptedException {
"doUnbind","Finally close the socket");
}
synchronized (this) {
// Important to inform finalize() that the socket is closed...
}
}
}
DatagramSocket s, DatagramPacket p,
MBeanServer f, ObjectName n) {
final SnmpRequestHandler handler =
dataFactory, f, n);
}
/**
* Reads a packet from the datagram socket and creates a request
* handler which decodes and processes the request.
*/
protected void doReceive()
throws CommunicationException, InterruptedException {
// Let's wait for something to be received.
//
try {
"doReceive","received a message but state not online, returning.");
}
return;
}
} catch (SocketException e) {
// Let's check if we have been interrupted by stop().
//
throw new InterruptedException(e.toString()) ;
else
throw new CommunicationException(e) ;
} catch (InterruptedIOException e) {
throw new InterruptedException(e.toString()) ;
} catch (CommunicationException e) {
throw e ;
} catch (Exception e) {
throw new CommunicationException(e) ;
}
"doReceive", "received a message");
}
}
return;
}
/**
* Not used in this context.
*/
protected void doProcess()
throws CommunicationException, InterruptedException {
}
/**
* The number of times the communicator server will attempt
* to bind before giving up.
* We attempt only once...
* @return 1
**/
protected int getBindTries() {
return 1;
}
/**
* Stops this SNMP protocol adaptor.
* Closes the datagram socket.
* <p>
* Has no effect if this SNMP protocol adaptor is <CODE>OFFLINE</CODE> or
* <CODE>STOPPING</CODE>.
*/
public void stop(){
}
super.stop();
try {
try {
byte[] ob = new byte[1];
else
}
} finally {
}
} catch (Throwable e){
"stop", "Got unexpected Throwable", e);
}
}
}
}
// SENDING SNMP TRAPS STUFF
//-------------------------
/**
* Sends a trap using SNMP V1 trap format.
* <BR>The trap is sent to each destination defined in the ACL file
* (if available).
* If no ACL file or no destinations are available, the trap is sent
* to the local host.
*
* @param generic The generic number of the trap.
* @param specific The specific number of the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit defined
* by <CODE>bufferSize</CODE>.
*/
throws IOException, SnmpStatusException {
", specific=" + specific);
}
// First, make an SNMP V1 trap pdu
//
if (varBindList != null) {
}
else
// If the local host cannot be determined, we put 0.0.0.0 in agentAddr
try {
} catch (UnknownHostException e) {
byte[] zeroedAddr = new byte[4];
}
// Next, send the pdu to all destinations defined in ACL
//
sendTrapPdu(pdu) ;
}
return new SnmpIpAddress(address);
else {
"handleMultipleIPVersion",
"Not an IPv4 address, return null");
}
return null;
}
}
/**
* Sends a trap using SNMP V1 trap format.
* <BR>The trap is sent to the specified <CODE>InetAddress</CODE>
* destination using the specified community string (and the ACL file
* is not used).
*
* @param addr The <CODE>InetAddress</CODE> destination of the trap.
* @param cs The community string to be used for the trap.
* @param generic The generic number of the trap.
* @param specific The specific number of the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit defined
* by <CODE>bufferSize</CODE>.
*/
throws IOException, SnmpStatusException {
specific);
}
// First, make an SNMP V1 trap pdu
//
else
if (varBindList != null) {
}
else
// If the local host cannot be determined, we put 0.0.0.0 in agentAddr
try {
} catch (UnknownHostException e) {
byte[] zeroedAddr = new byte[4];
}
// Next, send the pdu to the specified destination
//
else
}
/**
* Sends a trap using SNMP V1 trap format.
* <BR>The trap is sent to the specified <CODE>InetAddress</CODE>
* destination using the specified parameters (and the ACL file is not
* used).
* Note that if the specified <CODE>InetAddress</CODE> destination is null,
* then the ACL file mechanism is used.
*
* @param addr The <CODE>InetAddress</CODE> destination of the trap.
* @param agentAddr The agent address to be used for the trap.
* @param cs The community string to be used for the trap.
* @param enterpOid The enterprise OID to be used for the trap.
* @param generic The generic number of the trap.
* @param specific The specific number of the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
* @param time The time stamp (overwrite the current time).
*
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit defined
* by <CODE>bufferSize</CODE>.
*
* @since 1.5
*/
int generic,
int specific,
throws IOException, SnmpStatusException {
cs,
time);
}
/**
* Sends a trap using SNMP V1 trap format.
* <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
* The community string used is the one located in the
* <CODE>SnmpPeer</CODE> parameters
* (<CODE>SnmpParameters.getRdCommunity() </CODE>).
*
* @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
* @param agentAddr The agent address to be used for the trap.
* @param enterpOid The enterprise OID to be used for the trap.
* @param generic The generic number of the trap.
* @param specific The specific number of the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
* @param time The time stamp (overwrite the current time).
*
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit
* defined by <CODE>bufferSize</CODE>.
*
* @since 1.5
*/
int generic,
int specific,
throws IOException, SnmpStatusException {
peer.getDestPort(),
p.getRdCommunity(),
time);
}
int port,
int generic,
int specific,
throws IOException, SnmpStatusException {
specific);
}
// First, make an SNMP V1 trap pdu
//
//Diff start
else
//Diff end
// Diff start
else
//Diff end
//Diff start
else
//Diff end
if (varBindList != null) {
}
else
// If the local host cannot be determined,
// we put 0.0.0.0 in agentAddr
try {
final InetAddress inetAddr =
} catch (UnknownHostException e) {
byte[] zeroedAddr = new byte[4];
}
}
// Next, send the pdu to the specified destination
//
// Diff start
else
//End diff
}
/**
* Sends a trap using SNMP V2 trap format.
* <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
* <BR>The community string used is the one located in the
* <CODE>SnmpPeer</CODE> parameters
* (<CODE>SnmpParameters.getRdCommunity() </CODE>).
* <BR>The variable list included in the outgoing trap is composed of
* the following items:
* <UL>
* <LI><CODE>sysUpTime.0</CODE> with the value specified by
* <CODE>time</CODE></LI>
* <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
* <CODE>trapOid</CODE></LI>
* <LI><CODE>all the (oid,values)</CODE> from the specified
* <CODE>varBindList</CODE></LI>
* </UL>
*
* @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
* @param time The time stamp (overwrite the current time).
*
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit
* defined by <CODE>bufferSize</CODE>.
*
* @since 1.5
*/
throws IOException, SnmpStatusException {
peer.getDestPort(),
p.getRdCommunity(),
time);
}
/**
* Sends a trap using SNMP V2 trap format.
* <BR>The trap is sent to each destination defined in the ACL file
* (if available). If no ACL file or no destinations are available,
* the trap is sent to the local host.
* <BR>The variable list included in the outgoing trap is composed of
* the following items:
* <UL>
* <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
* <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
* <CODE>trapOid</CODE></LI>
* <LI><CODE>all the (oid,values)</CODE> from the specified
* <CODE>varBindList</CODE></LI>
* </UL>
*
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit defined
* by <CODE>bufferSize</CODE>.
*/
throws IOException, SnmpStatusException {
}
// First, make an SNMP V2 trap pdu
// We clone varBindList and insert sysUpTime and snmpTrapOid
//
if (varBindList != null)
else
0);
// Next, send the pdu to all destinations defined in ACL
//
sendTrapPdu(pdu) ;
}
/**
* Sends a trap using SNMP V2 trap format.
* <BR>The trap is sent to the specified <CODE>InetAddress</CODE>
* destination using the specified community string (and the ACL file
* is not used).
* <BR>The variable list included in the outgoing trap is composed of
* the following items:
* <UL>
* <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
* <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
* <CODE>trapOid</CODE></LI>
* <LI><CODE>all the (oid,values)</CODE> from the specified
* <CODE>varBindList</CODE></LI>
* </UL>
*
* @param addr The <CODE>InetAddress</CODE> destination of the trap.
* @param cs The community string to be used for the trap.
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit
* defined by <CODE>bufferSize</CODE>.
*/
throws IOException, SnmpStatusException {
}
// First, make an SNMP V2 trap pdu
// We clone varBindList and insert sysUpTime and snmpTrapOid
//
else
if (varBindList != null)
else
0);
// Next, send the pdu to the specified destination
//
else
}
/**
* Sends a trap using SNMP V2 trap format.
* <BR>The trap is sent to the specified <CODE>InetAddress</CODE>
* destination using the specified parameters (and the ACL file is not
* used).
* Note that if the specified <CODE>InetAddress</CODE> destination is null,
* then the ACL file mechanism is used.
* <BR>The variable list included in the outgoing trap is composed of the
* following items:
* <UL>
* <LI><CODE>sysUpTime.0</CODE> with the value specified by
* <CODE>time</CODE></LI>
* <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
* <CODE>trapOid</CODE></LI>
* <LI><CODE>all the (oid,values)</CODE> from the specified
* <CODE>varBindList</CODE></LI>
* </UL>
*
* @param addr The <CODE>InetAddress</CODE> destination of the trap.
* @param cs The community string to be used for the trap.
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
* @param time The time stamp (overwrite the current time).
*
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit
* defined by <CODE>bufferSize</CODE>.
*
* @since 1.5
*/
throws IOException, SnmpStatusException {
cs,
time);
}
int port,
throws IOException, SnmpStatusException {
}
// First, make an SNMP V2 trap pdu
// We clone varBindList and insert sysUpTime and snmpTrapOid
//
else
if (varBindList != null)
else
// Only difference with other
else
//End of diff
0);
// Next, send the pdu to the specified destination
//
// Diff start
else
//End diff
}
/**
* Send the specified trap PDU to the passed <CODE>InetAddress</CODE>.
* @param address The destination address.
* @param pdu The pdu to send.
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit
* defined by <CODE>bufferSize</CODE>.
*
* @since 1.5
*/
throws IOException, SnmpStatusException {
else
}
/**
* Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
* @param peer The destination peer. The Read community string is used of
* <CODE>SnmpParameters</CODE> is used as the trap community string.
* @param pdu The pdu to send.
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit defined
* by <CODE>bufferSize</CODE>.
* @since 1.5
*/
throws IOException, SnmpStatusException {
}
else {
}
}
/**
* Send the specified trap PDU to every destinations from the ACL file.
*/
throws SnmpStatusException, IOException {
// Make an SNMP message from the pdu
//
try {
throw new SnmpStatusException(
}
}
catch (SnmpTooBigException x) {
"sendTrapPdu", "Trap pdu is too big. " +
"Trap hasn't been sent to anyone" );
}
// FIXME: is the right exception to throw ?
// We could simply forward SnmpTooBigException ?
}
// Now send the SNMP message to each destination
//
int sendingCount = 0 ;
while (ed.hasMoreElements()) {
while (ec.hasMoreElements()) {
try {
sendingCount++ ;
}
catch (SnmpTooBigException x) {
"sendTrapPdu", "Trap pdu is too big. " +
}
}
}
}
}
// If there is no destination defined or if everything has failed
// we tried to send the trap to the local host (as suggested by
// mister Olivier Reisacher).
//
if (sendingCount == 0) {
try {
} catch (SnmpTooBigException x) {
"sendTrapPdu", "Trap pdu is too big. " +
"Trap hasn't been sent.");
}
} catch (UnknownHostException e) {
"sendTrapPdu", "Trap pdu is too big. " +
"Trap hasn't been sent.");
}
}
}
}
/**
* Send the specified trap PDU to the specified destination.
*/
throws SnmpStatusException, IOException {
// Make an SNMP message from the pdu
//
try {
throw new SnmpStatusException(
}
} catch (SnmpTooBigException x) {
"sendTrapPdu", "Trap pdu is too big. " +
"Trap hasn't been sent to the specified host.");
}
// FIXME: is the right exception to throw ?
// We could simply forward SnmpTooBigException ?
}
// Now send the SNMP message to specified destination
//
try {
} catch (SnmpTooBigException x) {
"sendTrapPdu", "Trap pdu is too big. " +
}
}
}
}
/**
* Send the specified message on trapSocket.
*/
throws IOException, SnmpTooBigException {
byte[] buffer = new byte[bufferSize] ;
}
}
snmpOutTraps++;
snmpOutPkts++;
}
/**
* Open trapSocket if it's not already done.
*/
if (trapSocket == null) {
"openTrapSocketIfNeeded", "using port " +
}
}
}
/**
* Close trapSocket if the SNMP protocol adaptor is not ONLINE.
*/
synchronized void closeTrapSocketIfNeeded() {
trapSocket.close() ;
trapSocket = null ;
}
}
// SENDING SNMP INFORMS STUFF
//---------------------------
/**
* Sends an inform using SNMP V2 inform request format.
* <BR>The inform request is sent to each destination defined in the ACL
* file (if available).
* If no ACL file or no destinations are available, the inform request is
* sent to the local host.
* <BR>The variable list included in the outgoing inform is composed of
* the following items:
* <UL>
* <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
* <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
* <CODE>trapOid</CODE></LI>
* <LI><CODE>all the (oid,values)</CODE> from the specified
* <CODE>varBindList</CODE></LI>
* </UL>
* To send an inform request, the SNMP adaptor server must be active.
*
* @param cb The callback that is invoked when a request is complete.
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @return A vector of {@link com.sun.jmx.snmp.daemon.SnmpInformRequest}
* objects.
* <P>If there is no destination host for this inform request,
* the returned vector will be empty.
*
* @exception IllegalStateException This method has been invoked while
* the SNMP adaptor server was not active.
* @exception IOException An I/O error occurred while sending the
* inform request.
* @exception SnmpStatusException If the inform request exceeds the
* limit defined by <CODE>bufferSize</CODE>.
*/
if (!isActive()) {
throw new IllegalStateException(
"Start SNMP adaptor server before carrying out this operation");
}
}
// First, make an SNMP inform pdu:
// We clone varBindList and insert sysUpTime and snmpTrapOid variables.
//
if (varBindList != null)
else
0);
// Next, send the pdu to the specified destination
//
// Now send the SNMP message to each destination
//
while (ed.hasMoreElements()) {
while (ec.hasMoreElements()) {
fullVbl,getInformPort())) ;
}
}
}
return informReqList ;
}
/**
* Sends an inform using SNMP V2 inform request format.
* <BR>The inform is sent to the specified <CODE>InetAddress</CODE>
* destination
* using the specified community string.
* <BR>The variable list included in the outgoing inform is composed
* of the following items:
* <UL>
* <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
* <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
* <CODE>trapOid</CODE></LI>
* <LI><CODE>all the (oid,values)</CODE> from the specified
* <CODE>varBindList</CODE></LI>
* </UL>
* To send an inform request, the SNMP adaptor server must be active.
*
* @param addr The <CODE>InetAddress</CODE> destination for this inform
* request.
* @param cs The community string to be used for the inform request.
* @param cb The callback that is invoked when a request is complete.
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @return The inform request object.
*
* @exception IllegalStateException This method has been invoked
* while the SNMP adaptor server was not active.
* @exception IOException An I/O error occurred while sending the
* inform request.
* @exception SnmpStatusException If the inform request exceeds the
* limit defined by <CODE>bufferSize</CODE>.
*/
return snmpInformRequest(addr,
cs,
cb,
}
/**
* Sends an inform using SNMP V2 inform request format.
* <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE>
* destination.
* <BR>The community string used is the one located in the
* <CODE>SnmpPeer</CODE> parameters
* (<CODE>SnmpParameters.getInformCommunity() </CODE>).
* <BR>The variable list included in the outgoing inform is composed
* of the following items:
* <UL>
* <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
* <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
* <CODE>trapOid</CODE></LI>
* <LI><CODE>all the (oid,values)</CODE> from the specified
* <CODE>varBindList</CODE></LI>
* </UL>
* To send an inform request, the SNMP adaptor server must be active.
*
* @param peer The <CODE>SnmpPeer</CODE> destination for this inform
* request.
* @param cb The callback that is invoked when a request is complete.
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @return The inform request object.
*
* @exception IllegalStateException This method has been invoked while
* the SNMP adaptor server was not active.
* @exception IOException An I/O error occurred while sending the
* inform request.
* @exception SnmpStatusException If the inform request exceeds the
* limit defined by <CODE>bufferSize</CODE>.
*
* @since 1.5
*/
peer.getDestPort(),
p.getInformCommunity(),
cb,
}
/**
* Method that maps an SNMP error status in the passed protocolVersion
* according to the provided pdu type.
* @param errorStatus The error status to convert.
* @param protocolVersion The protocol version.
* @param reqPduType The pdu type.
*/
int protocolVersion,
int reqPduType) {
}
int port,
if (!isActive()) {
throw new IllegalStateException(
"Start SNMP adaptor server before carrying out this operation");
}
}
// First, make an SNMP inform pdu:
// We clone varBindList and insert sysUpTime and snmpTrapOid variables.
//
if (varBindList != null)
else
0);
// Next, send the pdu to the specified destination
//
}
/**
* Open informSocket if it's not already done.
*/
if (informSession == null) {
informSession = new SnmpSession(this) ;
"openInformSocketIfNeeded",
"to send inform requests and receive inform responses");
}
}
}
/**
* Close informSocket if the SNMP protocol adaptor is not ONLINE.
*/
synchronized void closeInformSocketIfNeeded() {
informSession = null ;
}
}
/**
* Gets the IP address to bind.
* This getter is used to initialize the DatagramSocket in the
* SnmpSocket object created for the inform request stuff.
*/
return address;
}
// PROTECTED METHODS
//------------------
/**
* Finalizer of the SNMP protocol adaptor objects.
* This method is called by the garbage collector on an object
* when garbage collection determines that there are no more
* references to the object.
* <P>Closes the datagram socket associated to this SNMP protocol adaptor.
*/
protected void finalize() {
try {
}
} catch (Exception e) {
"finalize", "Exception in finalizer", e);
}
}
}
// PACKAGE METHODS
//----------------
/**
* Returns the string used in debug traces.
*/
}
switch(pduType) {
case pduGetRequestPdu:
break;
case pduGetNextRequestPdu:
break;
case pduSetRequestPdu:
break;
default:
break;
}
snmpInPkts++ ;
}
switch(errorStatus) {
case snmpRspNoError:
break;
case snmpRspGenErr:
break;
case snmpRspBadValue:
break;
case snmpRspNoSuchName:
break;
case snmpRspTooBig:
break;
default:
break;
}
snmpOutPkts++ ;
}
switch(pduType) {
case pduGetRequestPdu:
case pduGetNextRequestPdu:
case pduGetBulkRequestPdu:
snmpInTotalReqVars += n ;
break ;
case pduSetRequestPdu:
snmpInTotalSetVars += n ;
break ;
}
}
void incSnmpInASNParseErrs(int n) {
snmpInASNParseErrs += n ;
}
void incSnmpInBadVersions(int n) {
snmpInBadVersions += n ;
}
void incSnmpInBadCommunityUses(int n) {
snmpInBadCommunityUses += n ;
}
void incSnmpInBadCommunityNames(int n) {
snmpInBadCommunityNames += n ;
}
void incSnmpSilentDrops(int n) {
snmpSilentDrops += n ;
}
// PRIVATE METHODS
//----------------
/**
* Returns the time (in hundreths of second) elapsed since the SNMP
* protocol adaptor startup.
*/
long getSysUpTime() {
}
/**
* Control the way the SnmpAdaptorServer service is deserialized.
*/
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
// Call the specific initialization for the SnmpAdaptorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
}
/**
* Common initializations.
*/
root= new SnmpMibTree();
// The default Agent is initialized with a SnmpErrorHandlerAgent agent.
// For the trap time, use the time the agent started ...
//
maxActiveClientCount = 10;
// Create the default message factory
pduFactory = new SnmpPduFactoryBER() ;
port = p ;
address = a ;
throw new IllegalArgumentException("ACL object cannot be null") ;
}
}
final Thread t = super.createMainThread();
t.setDaemon(true);
return t;
}
}