Package uk.co.westhawk.snmp.stack
Class SnmpContextv2cPool
java.lang.Object
uk.co.westhawk.snmp.stack.SnmpContextPool
uk.co.westhawk.snmp.stack.SnmpContextv2cPool
- All Implemented Interfaces:
SnmpContextBasisFace
,SnmpContextFace
,SnmpContextv2cFace
This class contains the pool of SNMP v2c contexts.
It extends the SnmpContextPool and is similar in every way, except it
uses a pool of SnmpContextv2c.
Thanks to Seon Lee (slee@virtc.com) for reporting thread safety problems.
- Version:
- $Revision: 3.15 $ $Date: 2009/03/05 13:27:41 $
- Author:
- Birgit Arkesteijn
- See Also:
-
Field Summary
Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
DEFAULT_PORT, MAXPDU, MSS, STANDARD_SOCKET, TCP_SOCKET
Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextFace
DEFAULT_COMMUNITY
-
Constructor Summary
ConstructorsConstructorDescriptionSnmpContextv2cPool
(String host, int port) Constructor.SnmpContextv2cPool
(String host, int port, String typeSocket) Constructor.SnmpContextv2cPool
(String host, int port, String comm, String typeSocket) Constructor.SnmpContextv2cPool
(String host, int port, String comm, String bindAddress, String typeSocket) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()
This method is not supported.int
Returns the SNMP version of the context.Methods inherited from class uk.co.westhawk.snmp.stack.SnmpContextPool
addPdu, addRequestPduListener, addRequestPduListener, addRequestPduListener, addTrapListener, addTrapListener, addTrapListener, destroy, destroyPool, dumpContexts, encodePacket, getBindAddress, getCommunity, getHashKey, getHost, getPort, getReceivedFromHostAddress, getSendToHostAddress, getTypeSocket, isDestroyed, processIncomingPdu, removePdu, removeRequestPduListener, removeRequestPduListener, removeRequestPduListener, removeTrapListener, removeTrapListener, removeTrapListener, sendPacket, setCommunity, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
addPdu, addRequestPduListener, addRequestPduListener, addRequestPduListener, addTrapListener, addTrapListener, addTrapListener, destroy, encodePacket, getBindAddress, getHashKey, getHost, getPort, getReceivedFromHostAddress, getSendToHostAddress, getTypeSocket, isDestroyed, processIncomingPdu, removePdu, removeRequestPduListener, removeRequestPduListener, removeRequestPduListener, removeTrapListener, removeTrapListener, removeTrapListener, sendPacket
Methods inherited from interface uk.co.westhawk.snmp.stack.SnmpContextFace
getCommunity, setCommunity
-
Constructor Details
-
SnmpContextv2cPool
Constructor.- Parameters:
host
- The host to which the PDU will be sentport
- The port where the SNMP server will be- Throws:
IOException
- See Also:
-
SnmpContextv2cPool
Constructor. Parameter typeSocket should be either STANDARD_SOCKET, TCP_SOCKET or a fully qualified classname.- Parameters:
host
- The host to which the PDU will be sentport
- The port where the SNMP server will betypeSocket
- The type of socket to use.- Throws:
IOException
- See Also:
-
SnmpContextv2cPool
Constructor. Parameter typeSocket should be either STANDARD_SOCKET, TCP_SOCKET or a fully qualified classname.- Parameters:
host
- The host to which the PDU will be sentport
- The port where the SNMP server will becomm
- The community name.typeSocket
- The type of socket to use.- Throws:
IOException
- Since:
- 4_14
- See Also:
-
SnmpContextv2cPool
public SnmpContextv2cPool(String host, int port, String comm, String bindAddress, String typeSocket) throws IOException Constructor. Parameter typeSocket should be either STANDARD_SOCKET, TCP_SOCKET or a fully qualified classname.- Parameters:
host
- The host to which the PDU will be sentport
- The port where the SNMP server will becomm
- The community name.bindAddress
- The local address the server will bind totypeSocket
- The type of socket to use.- Throws:
IOException
- Since:
- 4_14
- See Also:
-
-
Method Details
-
getVersion
public int getVersion()Description copied from interface:SnmpContextBasisFace
Returns the SNMP version of the context.- Specified by:
getVersion
in interfaceSnmpContextBasisFace
- Overrides:
getVersion
in classSnmpContextPool
- Returns:
- The version
- See Also:
-
clone
This method is not supported. It will throw a CloneNotSupportedException.- Specified by:
clone
in interfaceSnmpContextBasisFace
- Overrides:
clone
in classSnmpContextPool
- Throws:
CloneNotSupportedException
- Thrown when the constructor generates an IOException or when in one of the Pool classes.- Since:
- 4_14
-