- java.lang.Object
-
- org.snmp4j.agent.BaseAgent
-
- org.snmp4j.agent.test.SnapshotAgent
-
- All Implemented Interfaces:
java.lang.Runnable
public class SnapshotAgent extends BaseAgent
- Version:
- 1.0
- Author:
- Frank Fock
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringaddressprotected java.util.List<StaticMOGroup>groupsprotected java.io.Filesnapshot-
Fields inherited from class org.snmp4j.agent.BaseAgent
agent, agentState, bootCounterFile, configFileURI, defaultContext, defaultPersistenceProvider, defaultProxyForwarder, dispatcher, mpv3, notificationOriginator, server, session, snmp4jConfigMIB, snmp4jLogMIB, snmpCommunityMIB, snmpFrameworkMIB, snmpMpdMib, 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
Constructors Constructor Description SnapshotAgent(java.io.File bootCounterFile, java.io.File configFile, java.io.File snapshot)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCommunities(SnmpCommunityMIB communityMIB)Adds community to security name mappings needed for SNMPv1 and SNMPv2c.protected voidaddNotificationTargets(SnmpTargetMIB targetMIB, SnmpNotificationMIB notificationMIB)Adds initial notification targets and filters.protected voidaddUsmUser(org.snmp4j.security.USM usm)Adds all the necessary initial users to the USM.protected voidaddViews(VacmMIB vacm)Adds initial VACM configuration.protected voidinitTransportMappings()Initializes the transport mappings (ports) to be used by the agent.static voidmain(java.lang.String[] args)protected voidregisterManagedObjects()Register additional managed objects at the agent's server.protected voidunregisterManagedObjects()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, getSnmpMpdMib, getSnmpNotificationMIB, getSnmpProxyMIB, getSnmpTargetMIB, getSnmpv2MIB, getSysDescr, getSysOID, getSysServices, getUsm, getUsmMIB, getVacmMIB, init, initConfigMIB, initMessageDispatcher, initSnmpSession, loadConfig, registerSnmpMIBs, run, saveConfig, sendColdStartNotification, setAgent, setBootCounterFile, setConfigFile, setDefaultContext, setDefaultProxyForwarder, setSysDescr, setSysOID, setSysServices, setupDefaultProxyForwarder, stop, unregisterSnmpMIBs, updateEngineBoots, updateSession
-
-
-
-
Field Detail
-
address
protected java.lang.String address
-
snapshot
protected java.io.File snapshot
-
groups
protected java.util.List<StaticMOGroup> groups
-
-
Method Detail
-
addCommunities
protected void addCommunities(SnmpCommunityMIB communityMIB)
Adds community to security name mappings needed for SNMPv1 and SNMPv2c.- Specified by:
addCommunitiesin classBaseAgent- 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:
addNotificationTargetsin classBaseAgent- 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:
addUsmUserin classBaseAgent- Parameters:
usm- the USM instance used by this agent.
-
addViews
protected void addViews(VacmMIB vacm)
Adds initial VACM configuration.
-
registerManagedObjects
protected void registerManagedObjects()
Register additional managed objects at the agent's server.- Specified by:
registerManagedObjectsin classBaseAgent
-
unregisterManagedObjects
protected void unregisterManagedObjects()
Unregister additional managed objects from the agent's server.- Specified by:
unregisterManagedObjectsin classBaseAgent
-
initTransportMappings
protected void initTransportMappings() throws java.io.IOExceptionDescription copied from class:BaseAgentInitializes the transport mappings (ports) to be used by the agent.- Overrides:
initTransportMappingsin classBaseAgent- Throws:
java.io.IOException- if an IO exception occurs while initializing the default transport mapping on all local IP addresses on port 161.
-
main
public static void main(java.lang.String[] args)
-
-