public class PassiveSnmpContext extends SnmpContext
This extends SnmpContext so that it does not create any threads to send PDUs. It must be used with the PDU class PassiveTrapPduv1. The original purpose of the Passive classes is to allow the stack to be used in environments where thread creation is unwanted, eg database JVMs such as Oracle JServer. See SNMPv2-PDU.
See notes on how to send traps in an Oracle JServer environment.
PassiveTrapPduv1
anyPduExpectingResponse, bindAddr, hostname, hostPort, isDestroyed, maxRecvSize, pduSupport, trapSupport, typeSocket
DEFAULT_COMMUNITY
DEFAULT_PORT, MAXPDU, MSS, STANDARD_SOCKET, TCP_SOCKET
Modifier | Constructor and Description |
---|---|
|
PassiveSnmpContext(java.lang.String host,
int port)
Constructor.
|
|
PassiveSnmpContext(java.lang.String host,
int port,
java.lang.String typeSocketA)
Constructor.
|
protected |
PassiveSnmpContext(java.lang.String host,
int port,
java.lang.String bindAddress,
java.lang.String typeSocketA)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activate()
Overrides the AbstractSnmpContext.activate() to do nothing.
|
clone, encodePacket, encodePacket, getCommunity, getHashKey, getVersion, processIncomingPdu, processIncomingResponse, setCommunity, toString
addPdu, addRequestPduListener, addRequestPduListener, addRequestPduListener, addTrapListener, addTrapListener, addTrapListener, destroy, freeTransmitters, getBindAddress, getDebugString, getHost, getHostAddress, getMaxRecvSize, getPort, getReceivedFromHostAddress, getSendToHostAddress, getTypeSocket, isDestroyed, rawPduReceived, removePdu, removeRequestPduListener, removeRequestPduListener, removeRequestPduListener, removeTrapListener, removeTrapListener, removeTrapListener, run, sendPacket, setMaxRecvSize, stop
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPdu, addRequestPduListener, addRequestPduListener, addRequestPduListener, addTrapListener, addTrapListener, addTrapListener, destroy, getBindAddress, getHost, getPort, getReceivedFromHostAddress, getSendToHostAddress, getTypeSocket, isDestroyed, removePdu, removeRequestPduListener, removeRequestPduListener, removeRequestPduListener, removeTrapListener, removeTrapListener, removeTrapListener, sendPacket
public PassiveSnmpContext(java.lang.String host, int port) throws java.io.IOException
host
- The host to which the Pdu will be sentport
- The port where the SNMP server will bejava.io.IOException
SnmpContext.SnmpContext(String, int)
public PassiveSnmpContext(java.lang.String host, int port, java.lang.String typeSocketA) throws java.io.IOException
host
- The host to which the Pdu will be sentport
- The port where the SNMP server will betypeSocketA
- The type of socket to use.java.io.IOException
SnmpContext.SnmpContext(String, int, String)
,
SnmpContextBasisFace.STANDARD_SOCKET
,
SnmpContextBasisFace.TCP_SOCKET
protected PassiveSnmpContext(java.lang.String host, int port, java.lang.String bindAddress, java.lang.String typeSocketA) throws java.io.IOException
host
- The host to which the Pdu will be sentport
- The port where the SNMP server will bebindAddress
- The local address the server will bind totypeSocketA
- The type of socket to use.java.io.IOException
- Thrown when the socket cannot be
created.SnmpContextBasisFace.STANDARD_SOCKET
,
SnmpContextBasisFace.TCP_SOCKET
protected void activate()
activate
in class AbstractSnmpContext
AbstractSnmpContext.activate()