|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.snmp4j.agent.BaseAgent
org.snmp4j.agent.test.TestAgent
public class TestAgent
The TestAgent is a sample SNMP agent implementation of all
features (MIB implementations) provided by the SNMP4J-Agent framework.
The TestAgent extends the BaseAgent which provides
a framework for custom agent implementations through hook methods. Those
abstract hook methods need to be implemented by extending the
BaseAgent.
This IF-MIB implementation part of this test agent, is instrumentation as a simulation MIB. Thus, by changing the agentppSimMode (1.3.6.1.4.1.4976.2.1.1.0) from 'oper(1)' to 'config(2)' any object of the IF-MIB is writable and even creatable (columnar objects) via SNMP. Check it out!
| Field Summary | |
|---|---|
protected java.lang.String |
address
|
| 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 | |
|---|---|
TestAgent(java.io.File bootCounterFile,
java.io.File configFile)
Creates the test agent with a file to read and store the boot counter and a file to read and store its configuration. |
|
| 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 |
registerSnmpMIBs()
Register the basic MIB modules at the agent's MOServer. |
protected void |
unregisterManagedObjects()
Unregister additional managed objects from the agent's server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String address
| Constructor Detail |
|---|
public TestAgent(java.io.File bootCounterFile,
java.io.File configFile)
throws java.io.IOException
bootCounterFile - a file containing the boot counter in serialized form (as expected by
BaseAgent).configFile - a configuration file with serialized management information.
java.io.IOException - if the boot counter or config file cannot be read properly.| Method Detail |
|---|
protected void registerManagedObjects()
BaseAgent
registerManagedObjects in class BaseAgent
protected void addNotificationTargets(SnmpTargetMIB targetMIB,
SnmpNotificationMIB notificationMIB)
BaseAgent
addNotificationTargets in class BaseAgenttargetMIB - the SnmpTargetMIB holding the target configuration.notificationMIB - the SnmpNotificationMIB holding the notification (filter)
configuration.protected void addViews(VacmMIB vacm)
BaseAgent
addViews in class BaseAgentvacm - the VacmMIB holding the agent's view configuration.protected void addUsmUser(org.snmp4j.security.USM usm)
BaseAgent
addUsmUser in class BaseAgentusm - the USM instance used by this agent.
protected void initTransportMappings()
throws java.io.IOException
BaseAgent
initTransportMappings in class BaseAgentjava.io.IOExceptionpublic static void main(java.lang.String[] args)
protected void unregisterManagedObjects()
BaseAgent
unregisterManagedObjects in class BaseAgentprotected void addCommunities(SnmpCommunityMIB communityMIB)
BaseAgent
addCommunities in class BaseAgentcommunityMIB - the SnmpCommunityMIB holding coexistence configuration for community
based security models.protected void registerSnmpMIBs()
BaseAgentMOServer.
registerSnmpMIBs in class BaseAgent
|
Copyright 2005-2008 Frank Fock (SNMP4J.org) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||