goldengate.snmp
Class GgSnmpAgent

java.lang.Object
  extended by org.snmp4j.agent.BaseAgent
      extended by goldengate.snmp.GgSnmpAgent
All Implemented Interfaces:
Runnable

public class GgSnmpAgent
extends org.snmp4j.agent.BaseAgent

This Agent contains some functionalities for running a version 2c and 3 of SNMP agent.

Author:
Frederic Bregier

Field Summary
 GgInterfaceMib mib
          The associated MIB with this Agent
 GgInterfaceMonitor monitor
          The associated monitor with this Agent
 int trapLevel
           
 
Fields inherited from class org.snmp4j.agent.BaseAgent
agent, agentState, bootCounterFile, configFileURI, defaultContext, defaultPersistenceProvider, defaultProxyForwarder, dispatcher, mpv3, notificationOriginator, server, session, snmp4jConfigMIB, snmp4jLogMIB, snmpCommunityMIB, snmpFrameworkMIB, snmpNotificationMIB, snmpProxyMIB, snmpTargetMIB, snmpv2MIB, STATE_CREATED, STATE_INIT_FINISHED, STATE_INIT_STARTED, STATE_RUNNING, STATE_STOPPED, sysDescr, sysOID, sysServices, transportMappings, usm, usmMIB, vacmMIB
 
Constructor Summary
GgSnmpAgent(File configurationFile, GgInterfaceMonitor monitor, GgInterfaceMib mib)
           
 
Method Summary
protected  void addCommunities(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB communityMIB)
           
protected  void addNotificationTargets(org.snmp4j.agent.mo.snmp.SnmpTargetMIB targetMIB, org.snmp4j.agent.mo.snmp.SnmpNotificationMIB notificationMIB)
           
protected  void addUsmUser(org.snmp4j.security.USM usm)
           
protected  void addViews(org.snmp4j.agent.mo.snmp.VacmMIB vacm)
           
 GgInterfaceMib getMib()
           
 GgInterfaceMonitor getMonitor()
           
 long getUptime()
           
 long getUptimeSystemTime()
           
protected  void initTransportMappings()
           
protected  void registerManagedObjects()
           
protected  void sendColdStartNotification()
           
protected  void sendShutdownNotification()
          Send a Notification just before Shutdown the SNMP service.
 void start()
          Start method invokes some initialization methods needed to start the agent
 void stop()
           
 void unregisterManagedObject(org.snmp4j.agent.MOGroup moGroup)
           
protected  void unregisterManagedObjects()
           
 
Methods inherited from class org.snmp4j.agent.BaseAgent
addShutdownHook, finishInit, getAgent, getAgentState, getBootCounterFile, getConfigFile, getContext, getDefaultContext, getDefaultProxyForwarder, getEngineBoots, getMPv3, getNotificationOriginator, getServer, getSession, getSnmp4jConfigMIB, getSnmp4jLogMIB, getSnmpCommunityMIB, getSnmpFrameworkMIB, getSnmpNotificationMIB, getSnmpProxyMIB, getSnmpTargetMIB, getSnmpv2MIB, getSysDescr, getSysOID, getSysServices, getUsm, getUsmMIB, getVacmMIB, init, initConfigMIB, initMessageDispatcher, initSnmpSession, loadConfig, registerSnmpMIBs, run, saveConfig, setAgent, setBootCounterFile, setConfigFile, setDefaultContext, setDefaultProxyForwarder, setEngineBoots, setSysDescr, setSysOID, setSysServices, setupDefaultProxyForwarder, unregisterSnmpMIBs, updateEngineBoots, updateSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trapLevel

public int trapLevel

monitor

public GgInterfaceMonitor monitor
The associated monitor with this Agent


mib

public GgInterfaceMib mib
The associated MIB with this Agent

Constructor Detail

GgSnmpAgent

public GgSnmpAgent(File configurationFile,
                   GgInterfaceMonitor monitor,
                   GgInterfaceMib mib)
            throws IllegalArgumentException
Parameters:
configurationFile - XML format
monitor - the associated monitor
mib - the associated MIB
Throws:
IllegalArgumentException
Method Detail

getMonitor

public GgInterfaceMonitor getMonitor()
Returns:
the monitor

getMib

public GgInterfaceMib getMib()
Returns:
the mib

getUptime

public long getUptime()
Returns:
the uptime in ms

getUptimeSystemTime

public long getUptimeSystemTime()
Returns:
the uptime but in System time in ms

registerManagedObjects

protected void registerManagedObjects()
Specified by:
registerManagedObjects in class org.snmp4j.agent.BaseAgent

unregisterManagedObjects

protected void unregisterManagedObjects()
Specified by:
unregisterManagedObjects in class org.snmp4j.agent.BaseAgent

unregisterManagedObject

public void unregisterManagedObject(org.snmp4j.agent.MOGroup moGroup)
Parameters:
moGroup -

addUsmUser

protected void addUsmUser(org.snmp4j.security.USM usm)
Specified by:
addUsmUser in class org.snmp4j.agent.BaseAgent

addNotificationTargets

protected void addNotificationTargets(org.snmp4j.agent.mo.snmp.SnmpTargetMIB targetMIB,
                                      org.snmp4j.agent.mo.snmp.SnmpNotificationMIB notificationMIB)
Specified by:
addNotificationTargets in class org.snmp4j.agent.BaseAgent

addViews

protected void addViews(org.snmp4j.agent.mo.snmp.VacmMIB vacm)
Specified by:
addViews in class org.snmp4j.agent.BaseAgent

addCommunities

protected void addCommunities(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB communityMIB)
Specified by:
addCommunities in class org.snmp4j.agent.BaseAgent

initTransportMappings

protected void initTransportMappings()
                              throws IOException
Overrides:
initTransportMappings in class org.snmp4j.agent.BaseAgent
Throws:
IOException

start

public void start()
           throws IOException
Start method invokes some initialization methods needed to start the agent

Throws:
IOException

sendColdStartNotification

protected void sendColdStartNotification()
Overrides:
sendColdStartNotification in class org.snmp4j.agent.BaseAgent

sendShutdownNotification

protected void sendShutdownNotification()
Send a Notification just before Shutdown the SNMP service.


stop

public void stop()
Overrides:
stop in class org.snmp4j.agent.BaseAgent


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.