net.sf.snmpadaptor4j.core.trap
Class SnmpManagers

java.lang.Object
  extended by net.sf.snmpadaptor4j.core.trap.SnmpManagers

public class SnmpManagers
extends Object

Object representing all SNMP managers on the network to which SNMP traps should be sent.

Author:
Jean-Philippe MINETTI

Field Summary
protected  long closingTime
          Closing time of connections to all SNMP managers (in milliseconds).
protected  org.apache.log4j.Logger logger
          Logger.
protected  List<SnmpTrapSender> senderList
          List of SNMP trap sender.
protected  Timer timer
          Timer used to close connections to all SNMP managers.
 
Constructor Summary
  SnmpManagers(SnmpApiFactory senderFactory)
          Constructor.
protected SnmpManagers(SnmpApiFactory senderFactory, long connectionDuration)
          Constructor (only for tests).
 
Method Summary
 void initialize(List<SnmpManagerConfiguration> managerList)
          Initializes the configuration for SNMP traps sending to SNMP managers.
 void send(SnmpTrap trap)
          Sends a SNMP trap to all managers.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.apache.log4j.Logger logger
Logger.


senderList

protected final List<SnmpTrapSender> senderList
List of SNMP trap sender.


timer

protected Timer timer
Timer used to close connections to all SNMP managers.


closingTime

protected long closingTime
Closing time of connections to all SNMP managers (in milliseconds).

Constructor Detail

SnmpManagers

public SnmpManagers(SnmpApiFactory senderFactory)
Constructor.

Parameters:
senderFactory - Factory used for instantiate senders of SNMP traps to SNMP managers (must not be NULL).

SnmpManagers

protected SnmpManagers(SnmpApiFactory senderFactory,
                       long connectionDuration)
Constructor (only for tests).

Parameters:
senderFactory - Factory used for instantiate senders of SNMP traps to SNMP managers (must not be NULL).
connectionDuration - Connection duration after each sending of SNMP traps (in milliseconds).
Method Detail

initialize

public final void initialize(List<SnmpManagerConfiguration> managerList)
                      throws Exception
Initializes the configuration for SNMP traps sending to SNMP managers.

Parameters:
managerList - Connection parameters to all SNMP managers (must not be NULL).
Throws:
Exception - Exception if an error has occurred.

send

public void send(SnmpTrap trap)
Sends a SNMP trap to all managers.

Parameters:
trap - Object representing a specific or generic SNMP trap (must not be NULL).

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.