FileDocCategorySizeDatePackage
SnmpAdaptorServerMBean.javaAPI DocJava SE 5 API26437Fri Aug 26 14:55:06 BST 2005com.sun.jmx.snmp.daemon

SnmpAdaptorServerMBean

public interface SnmpAdaptorServerMBean implements CommunicatorServerMBean
Exposes the remote management interface of the {@link SnmpAdaptorServer} MBean.

This API is a Sun Microsystems internal API and is subject to change without notice.

Fields Summary
Constructors Summary
Methods Summary
public com.sun.jmx.snmp.agent.SnmpMibHandleraddMib(com.sun.jmx.snmp.agent.SnmpMibAgent mib)
Adds a new MIB in the SNMP MIB handler. This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)} and {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)} and should not be called directly.

param
mib The MIB to add.
return
A reference to the SNMP MIB handler.
exception
IllegalArgumentException If the parameter is null.

public com.sun.jmx.snmp.agent.SnmpMibHandleraddMib(com.sun.jmx.snmp.agent.SnmpMibAgent mib, com.sun.jmx.snmp.SnmpOid[] oids)
Adds a new MIB in the SNMP MIB handler.

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

public intgetActiveClientCount()
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 booleangetAuthRespEnabled()
Returns true if this SNMP protocol adaptor sends a response in case of authentication failure.

When this feature is enabled, the SNMP protocol adaptor sends a response with noSuchName or readOnly when the authentication failed. If the flag is disabled, the SNMP protocol adaptor trashes the PDU silently.

The default behavior is to send responses.

return
true if responses are sent.

public booleangetAuthTrapEnabled()
Returns true if authentication traps are enabled.

When this feature is enabled, the SNMP protocol adaptor sends an authenticationFailure trap each time an authentication fails.

The default behaviour is to send authentication traps.

return
true if authentication traps are enabled, false otherwise.

public java.lang.IntegergetBufferSize()
Returns the buffer size of this SNMP protocol adaptor. By default, buffer size 1024 is used.

return
The buffer size.

public java.lang.StringgetEnterpriseOid()
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".

public com.sun.jmx.snmp.InetAddressAclgetInetAddressAcl()
Returns the Ip address based ACL used by this SNMP protocol adaptor.

return
The InetAddressAcl implementation.
since
1.5

public intgetInformPort()
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 intgetMaxActiveClientCount()
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 intgetMaxTries()
Gets the number of times to try sending an inform request before giving up.

return
The maximun number of tries.

public java.lang.String[]getMibs()
Returns the names of the MIBs available in this SNMP protocol adaptor.

return
An array of MIB names.

public com.sun.jmx.snmp.SnmpPduFactorygetPduFactory()
Returns the message factory of this SNMP protocol adaptor.

return
The factory object.

public java.lang.StringgetProtocol()
Returns the protocol of this SNMP protocol adaptor.

return
The string "snmp".

public intgetServedClientCount()
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 stop method.

public java.lang.LonggetSnmpInASNParseErrs()
Returns the snmpInASNParseErrs value defined in MIB-II.

return
The snmpInASNParseErrs value.

public java.lang.LonggetSnmpInBadCommunityNames()
Returns the snmpInBadCommunityNames value defined in MIB-II.

return
The snmpInBadCommunityNames value.

public java.lang.LonggetSnmpInBadCommunityUses()
Returns the snmpInBadCommunityUses value defined in MIB-II.

return
The snmpInBadCommunityUses value.

public java.lang.LonggetSnmpInBadVersions()
Returns the snmpInBadVersions value defined in MIB-II.

return
The snmpInBadVersions value.

public java.lang.LonggetSnmpInGetNexts()
Returns the snmpInGetNexts value defined in MIB-II.

return
The snmpInGetNexts value.

public java.lang.LonggetSnmpInGetRequests()
Returns the snmpInGetRequests value defined in MIB-II.

return
The snmpInGetRequests value.

public java.lang.LonggetSnmpInPkts()
Returns the snmpInPkts value defined in MIB-II.

return
The snmpInPkts value.

public java.lang.LonggetSnmpInSetRequests()
Returns the snmpInSetRequests value defined in MIB-II.

return
The snmpInSetRequests value.

public java.lang.LonggetSnmpInTotalReqVars()
Returns the snmpInTotalReqVars value defined in MIB-II.

return
The snmpInTotalReqVars value.

public java.lang.LonggetSnmpInTotalSetVars()
Returns the snmpInTotalSetVars value defined in MIB-II.

return
The snmpInTotalSetVars value.

public java.lang.LonggetSnmpOutBadValues()
Returns the snmpOutBadValues value defined in MIB-II.

return
The snmpOutBadValues value.

public java.lang.LonggetSnmpOutGenErrs()
Returns the snmpOutGenErrs value defined in MIB-II.

return
The snmpOutGenErrs value.

public java.lang.LonggetSnmpOutGetResponses()
Returns the snmpOutGetResponses value defined in MIB-II.

return
The snmpOutGetResponses value.

public java.lang.LonggetSnmpOutNoSuchNames()
Returns the snmpOutNoSuchNames value defined in MIB-II.

return
The snmpOutNoSuchNames value.

public java.lang.LonggetSnmpOutPkts()
Returns the snmpOutPkts value defined in MIB-II.

return
The snmpOutPkts value.

public java.lang.LonggetSnmpOutTooBigs()
Returns the snmpOutTooBigs value defined in MIB-II.

return
The snmpOutTooBigs value.

public java.lang.LonggetSnmpOutTraps()
Returns the snmpOutTraps value defined in MIB-II.

return
The snmpOutTraps value.

public java.lang.LonggetSnmpProxyDrops()
Returns the snmpProxyDrops value defined in rfc 1907 NMPv2-MIB .

return
The snmpProxyDrops value.
since
1.5

public java.lang.LonggetSnmpSilentDrops()
Returns the snmpSilentDrops value defined in rfc 1907 NMPv2-MIB .

return
The snmpSilentDrops value.
since
1.5

public intgetTimeout()
Gets the timeout to wait for an inform response from the manager.

return
The value of the timeout property.

public java.lang.IntegergetTrapPort()
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.

public com.sun.jmx.snmp.agent.SnmpUserDataFactorygetUserDataFactory()
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

public booleanremoveMib(com.sun.jmx.snmp.agent.SnmpMibAgent mib)
Removes the specified MIB from the SNMP protocol adaptor. This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)} and {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)} and should not be called directly.

param
mib The MIB to be removed.
return
true if the specified mib was a MIB included in the SNMP MIB handler, false otherwise.

public voidsetAuthRespEnabled(boolean enabled)
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.

public voidsetAuthTrapEnabled(boolean enabled)
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.

public voidsetBufferSize(java.lang.Integer s)
Sets the buffer size of this SNMP protocol adaptor.

param
s The buffer size.
exception
java.lang.IllegalStateException This method has been invoked while the communicator was ONLINE or STARTING.

public voidsetEnterpriseOid(java.lang.String oid)
Sets the enterprise OID.

param
oid The OID in string format "x.x.x.x".
exception
IllegalArgumentException The string format is incorrect

public voidsetInformPort(int port)
Sets the port used by this SNMP protocol adaptor for sending inform requests.

param
port The port number for sending SNMP inform requests.

public voidsetMaxActiveClientCount(int c)
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 ONLINE or STARTING.

public voidsetMaxTries(int newMaxTries)
Changes the maximun number of times to try sending an inform request before giving up.

param
newMaxTries The maximun number of tries.

public voidsetPduFactory(com.sun.jmx.snmp.SnmpPduFactory factory)
Sets the message factory of this SNMP protocol adaptor.

param
factory The factory object (null means the default factory).

public voidsetTimeout(int newTimeout)
Changes the timeout to wait for an inform response from the manager.

param
newTimeout The timeout (in milliseconds).

public voidsetTrapPort(java.lang.Integer port)
Sets the port used by this SNMP protocol adaptor for sending traps.

param
port The port number for sending SNMP traps.

public voidsetUserDataFactory(com.sun.jmx.snmp.agent.SnmpUserDataFactory 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

public java.util.VectorsnmpInformRequest(SnmpInformHandler cb, com.sun.jmx.snmp.SnmpOid trapOid, com.sun.jmx.snmp.SnmpVarBindList varBindList)
Sends an inform using SNMP V2 inform request format.
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.
The variable list included in the outgoing inform request is composed of the following items:
  • sysUpTime.0 with its current value
  • snmpTrapOid.0 with the value specified by trapOid
  • all the (oid,values) from the specified varBindList
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 SnmpVarBind instances or null.
return
A vector of {@link com.sun.jmx.snmp.daemon.SnmpInformRequest} objects.

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 bufferSize.

public SnmpInformRequestsnmpInformRequest(java.net.InetAddress address, java.lang.String cs, SnmpInformHandler cb, com.sun.jmx.snmp.SnmpOid trapOid, com.sun.jmx.snmp.SnmpVarBindList varBindList)
Sends an inform using SNMP V2 inform request format.
The inform is sent to the specified InetAddress destination using the specified community string.
The variable list included in the outgoing inform request is composed of the following items:
  • sysUpTime.0 with its current value
  • snmpTrapOid.0 with the value specified by trapOid
  • all the (oid,values) from the specified varBindList
To send an inform request, the SNMP adaptor server must be active.

param
address The InetAddress 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 SnmpVarBind 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 bufferSize.

public SnmpInformRequestsnmpInformRequest(com.sun.jmx.snmp.SnmpPeer peer, SnmpInformHandler cb, com.sun.jmx.snmp.SnmpOid trapOid, com.sun.jmx.snmp.SnmpVarBindList varBindList)
Sends an inform using SNMP V2 inform request format.
The inform is sent to the specified SnmpPeer destination.
The community string used is the one located in the SnmpPeer parameters (SnmpParameters.getInformCommunity() ).
The variable list included in the outgoing inform is composed of the following items:
  • sysUpTime.0 with its current value
  • snmpTrapOid.0 with the value specified by trapOid
  • all the (oid,values) from the specified varBindList
To send an inform request, the SNMP adaptor server must be active.

param
peer The SnmpPeer 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 SnmpVarBind 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 bufferSize.
since
1.5

public voidsnmpPduTrap(java.net.InetAddress address, com.sun.jmx.snmp.SnmpPduPacket pdu)
Send the specified trap PDU to the passed InetAddress.

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 bufferSize.
since
1.5

public voidsnmpPduTrap(com.sun.jmx.snmp.SnmpPeer peer, com.sun.jmx.snmp.SnmpPduPacket pdu)
Send the specified trap PDU to the passed SnmpPeer.

param
peer The destination peer. The Read community string is used of SnmpParameters 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 bufferSize.
since
1.5

public voidsnmpV1Trap(int generic, int specific, com.sun.jmx.snmp.SnmpVarBindList varBindList)
Sends a trap using SNMP V1 trap format.
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 SnmpVarBind instances or null.
exception
IOException An I/O error occured while sending the trap.
exception
SnmpStatusException If the trap exceeds the limit defined by bufferSize.

public voidsnmpV1Trap(java.net.InetAddress address, java.lang.String cs, int generic, int specific, com.sun.jmx.snmp.SnmpVarBindList varBindList)
Sends a trap using SNMP V1 trap format.
The trap is sent to the specified InetAddress destination using the specified community string (and the ACL file is not used).

param
address The InetAddress 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 SnmpVarBind instances or null.
exception
IOException An I/O error occurred while sending the trap.
exception
SnmpStatusException If the trap exceeds the limit defined by bufferSize.

public voidsnmpV1Trap(com.sun.jmx.snmp.SnmpPeer peer, com.sun.jmx.snmp.SnmpIpAddress agentAddr, com.sun.jmx.snmp.SnmpOid enterpOid, int generic, int specific, com.sun.jmx.snmp.SnmpVarBindList varBindList, com.sun.jmx.snmp.SnmpTimeticks time)
Sends a trap using SNMP V1 trap format.
The trap is sent to the specified SnmpPeer destination. The community string used is the one located in the SnmpPeer parameters (SnmpParameters.getRdCommunity() ).

param
peer The SnmpPeer 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 SnmpVarBind 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 bufferSize.
since
1.5

public voidsnmpV2Trap(com.sun.jmx.snmp.SnmpPeer peer, com.sun.jmx.snmp.SnmpOid trapOid, com.sun.jmx.snmp.SnmpVarBindList varBindList, com.sun.jmx.snmp.SnmpTimeticks time)
Sends a trap using SNMP V2 trap format.
The trap is sent to the specified SnmpPeer destination.
The community string used is the one located in the SnmpPeer parameters (SnmpParameters.getRdCommunity() ).
The variable list included in the outgoing trap is composed of the following items:
  • sysUpTime.0 with the value specified by time
  • snmpTrapOid.0 with the value specified by trapOid
  • all the (oid,values) from the specified varBindList

param
peer The SnmpPeer destination of the trap.
param
trapOid The OID identifying the trap.
param
varBindList A list of SnmpVarBind 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 bufferSize.
since
1.5

public voidsnmpV2Trap(com.sun.jmx.snmp.SnmpOid trapOid, com.sun.jmx.snmp.SnmpVarBindList varBindList)
Sends a trap using SNMP V2 trap format.
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.
The variable list included in the outgoing trap is composed of the following items:
  • sysUpTime.0 with its current value
  • snmpTrapOid.0 with the value specified by trapOid
  • all the (oid,values) from the specified varBindList

param
trapOid The OID identifying the trap.
param
varBindList A list of SnmpVarBind instances or null.
exception
IOException An I/O error occured while sending the trap.
exception
SnmpStatusException If the trap exceeds the limit defined by bufferSize.

public voidsnmpV2Trap(java.net.InetAddress address, java.lang.String cs, com.sun.jmx.snmp.SnmpOid trapOid, com.sun.jmx.snmp.SnmpVarBindList varBindList)
Sends a trap using SNMP V2 trap format.
The trap is sent to the specified InetAddress destination using the specified community string (and the ACL file is not used).
The variable list included in the outgoing trap is composed of the following items:
  • sysUpTime.0 with its current value
  • snmpTrapOid.0 with the value specified by trapOid
  • all the (oid,values) from the specified varBindList

param
address The InetAddress 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 SnmpVarBind instances or null.
exception
IOException An I/O error occurred while sending the trap.
exception
SnmpStatusException If the trap exceeds the limit defined by bufferSize.