SNMP Stack 4_12

uk.co.westhawk.snmp.stack
Class PassiveSnmpContext

java.lang.Object
  |
  +--uk.co.westhawk.snmp.stack.AbstractSnmpContext
        |
        +--uk.co.westhawk.snmp.stack.SnmpContext
              |
              +--uk.co.westhawk.snmp.stack.PassiveSnmpContext
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.lang.Runnable, SnmpContextBasisFace, SnmpContextFace, TrapListener

public class PassiveSnmpContext
extends SnmpContext

This class contains the SNMP v1 context that is needed by a Pdu to send a SNMP v1 request in environments where thread creation is unwanted.

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 RFC 1905.

See notes on how to send traps in an Oracle JServer environment.

Since:
4_12
Version:
$Revision: 3.3 $ $Date: 2002/10/15 13:37:02 $
Author:
Birgit Arkesteijn
See Also:
PassiveTrapPduv1

Fields inherited from class uk.co.westhawk.snmp.stack.SnmpContext
Default_Community
 
Fields inherited from class uk.co.westhawk.snmp.stack.AbstractSnmpContext
hostAddr, hostPort, isDestroyed, maxRecvSize, typeSocket
 
Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextFace
version_id
 
Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
DEFAULT_PORT, KVM_SOCKET, MAXPDU, MSS, NETSCAPE_SOCKET, STANDARD_SOCKET
 
Fields inherited from interface uk.co.westhawk.snmp.event.TrapListener
version_id
 
Constructor Summary
PassiveSnmpContext(java.lang.String a_host, int a_port)
          Constructor.
PassiveSnmpContext(java.lang.String a_host, int a_port, java.lang.String socketType)
          Constructor.
 
Method Summary
protected  void activate()
          Overrides the AbstractSnmpContext.activate() to do nothing.
 
Methods inherited from class uk.co.westhawk.snmp.stack.SnmpContext
clone, encodePacket, encodePacket, getCommunity, getVersion, ProcessIncomingMessage, processIncomingTrap, setCommunity, toString
 
Methods inherited from class uk.co.westhawk.snmp.stack.AbstractSnmpContext
addPdu, addTrapListener, destroy, getDebugString, getHost, getHostAddress, getMaxRecvSize, getPort, getTypeSocket, removePdu, removeTrapListener, run, sendPacket, setMaxRecvSize, stop, trapReceived
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
addPdu, addTrapListener, destroy, getHost, getPort, getTypeSocket, removePdu, removeTrapListener, sendPacket
 

Constructor Detail

PassiveSnmpContext

public PassiveSnmpContext(java.lang.String a_host,
                          int a_port)
                   throws java.io.IOException
Constructor.
Parameters:
host - The host to which the Pdu will send
port - The port where the SNMP server will be
See Also:
SnmpContext.SnmpContext(String, int)

PassiveSnmpContext

public PassiveSnmpContext(java.lang.String a_host,
                          int a_port,
                          java.lang.String socketType)
                   throws java.io.IOException
Constructor.
Parameters:
host - The host to which the Pdu will send
port - The port where the SNMP server will be
typeSocketA - The type of socket to use.
See Also:
SnmpContext.SnmpContext(String, int, String), SnmpContextBasisFace.STANDARD_SOCKET, SnmpContextBasisFace.NETSCAPE_SOCKET, SnmpContextBasisFace.KVM_SOCKET
Method Detail

activate

protected void activate()
Overrides the AbstractSnmpContext.activate() to do nothing. This prevents the creation of threads in the base class.
Overrides:
activate in class AbstractSnmpContext
See Also:
AbstractSnmpContext.activate()

SNMP Stack 4_12