org.snmp4j.agent.test
Class SnapshotAgent

java.lang.Object
  extended by org.snmp4j.agent.BaseAgent
      extended by org.snmp4j.agent.test.SnapshotAgent
All Implemented Interfaces:
java.lang.Runnable

public class SnapshotAgent
extends BaseAgent

Version:
1.0
Author:
Frank Fock

Field Summary
protected  java.lang.String address
           
protected  java.util.List groups
           
protected  java.io.File snapshot
           
 
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
SnapshotAgent(java.io.File bootCounterFile, java.io.File configFile, java.io.File snapshot)
           
 
Method Summary
protected  void addCommunities(SnmpCommunityMIB communityMIB)
          Adds community to security name mappings needed for SNMPv1 and SNMPv2c.
protected  void addNotificationTargets(SnmpTargetMIB targetMIB, SnmpNotificationMIB notificationMIB)
          Adds initial notification targets and filters.
protected  void addUsmUser(org.snmp4j.security.USM usm)
          Adds all the necessary initial users to the USM.
protected  void addViews(VacmMIB vacm)
          Adds initial VACM configuration.
protected  void initTransportMappings()
          Initializes the transport mappings (ports) to be used by the agent.
static void main(java.lang.String[] args)
           
protected  void registerManagedObjects()
          Register additional managed objects at the agent's server.
protected  void unregisterManagedObjects()
          Unregister additional managed objects from the agent's server.
 
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, sendColdStartNotification, setAgent, setBootCounterFile, setConfigFile, setDefaultContext, setDefaultProxyForwarder, setEngineBoots, setSysDescr, setSysOID, setSysServices, setupDefaultProxyForwarder, stop, unregisterSnmpMIBs, updateEngineBoots, updateSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

address

protected java.lang.String address

snapshot

protected java.io.File snapshot

groups

protected java.util.List groups
Constructor Detail

SnapshotAgent

public SnapshotAgent(java.io.File bootCounterFile,
                     java.io.File configFile,
                     java.io.File snapshot)
              throws java.io.IOException
Throws:
java.io.IOException
Method Detail

addCommunities

protected void addCommunities(SnmpCommunityMIB communityMIB)
Adds community to security name mappings needed for SNMPv1 and SNMPv2c.

Specified by:
addCommunities in class BaseAgent
Parameters:
communityMIB - the SnmpCommunityMIB holding coexistence configuration for community based security models.

addNotificationTargets

protected void addNotificationTargets(SnmpTargetMIB targetMIB,
                                      SnmpNotificationMIB notificationMIB)
Adds initial notification targets and filters.

Specified by:
addNotificationTargets in class BaseAgent
Parameters:
targetMIB - the SnmpTargetMIB holding the target configuration.
notificationMIB - the SnmpNotificationMIB holding the notification (filter) configuration.

addUsmUser

protected void addUsmUser(org.snmp4j.security.USM usm)
Adds all the necessary initial users to the USM.

Specified by:
addUsmUser in class BaseAgent
Parameters:
usm - the USM instance used by this agent.

addViews

protected void addViews(VacmMIB vacm)
Adds initial VACM configuration.

Specified by:
addViews in class BaseAgent
Parameters:
vacm - the VacmMIB holding the agent's view configuration.

registerManagedObjects

protected void registerManagedObjects()
Register additional managed objects at the agent's server.

Specified by:
registerManagedObjects in class BaseAgent

unregisterManagedObjects

protected void unregisterManagedObjects()
Unregister additional managed objects from the agent's server.

Specified by:
unregisterManagedObjects in class BaseAgent

initTransportMappings

protected void initTransportMappings()
                              throws java.io.IOException
Description copied from class: BaseAgent
Initializes the transport mappings (ports) to be used by the agent.

Overrides:
initTransportMappings in class BaseAgent
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)

Copyright 2005-2008 Frank Fock (SNMP4J.org)