|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.snmp4j.agent.AgentConfigManager
org.snmp4j.agent.agentx.master.AgentXMasterAgent
public class AgentXMasterAgent
The AgentXMasterAgent is the base agent class for
AgentX master agents. It extends the AgentConfigManager class
provided by SNMP4J-Agent.
To implement a master agent, simply extend this class instead of
AgentConfigManager as you would do for a non-AgentX agent.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.snmp4j.agent.AgentConfigManager |
|---|
org.snmp4j.agent.AgentConfigManager.AgentState |
| Field Summary |
|---|
| Fields inherited from class org.snmp4j.agent.AgentConfigManager |
|---|
agent, communityMIB, configuration, defaultContext, dispatcher, engineBootsProvider, engineID, frameworkMIB, moFactory, notificaitonLogGlobalAge, notificaitonLogGlobalLimit, notificationLogDefaultLimit, notificationLogMIB, notificationMIB, notificationOriginator, persistenceImportMode, persistenceProvider, proxyForwarder, proxyMIB, runState, servers, session, snmp4jConfigMIB, snmp4jLogMIB, snmpv2MIB, STATE_CONFIGURED, STATE_CREATED, STATE_INITIALIZED, STATE_RESTORED, STATE_RUNNING, STATE_SAVED, STATE_SHUTDOWN, STATE_SUSPENDED, STATE_UNSAVED_CHANGES, sysDescr, sysOID, sysServices, tableSizeLimit, targetMIB, usm, usmMIB, vacm, vacmMIB, workerPool |
| Constructor Summary | |
|---|---|
AgentXMasterAgent(java.io.File bootCounterFile,
java.io.File configFile)
Creates a simple AgentX master agent using a boot counter file and config file for persistent storage. |
|
AgentXMasterAgent(org.snmp4j.smi.OctetString agentsOwnEngineID,
org.snmp4j.MessageDispatcher messageDispatcher,
org.snmp4j.agent.security.VACM vacm,
org.snmp4j.agent.MOServer[] moServers,
org.snmp4j.util.WorkerPool workerPool,
org.snmp4j.agent.io.MOInputFactory configurationFactory,
org.snmp4j.agent.io.MOPersistenceProvider persistenceProvider,
org.snmp4j.agent.cfg.EngineBootsProvider engineBootsProvider)
Creates a SNMP agent configuration which can be run by calling AgentConfigManager.run() later. |
|
| Method Summary | |
|---|---|
void |
addAgentXTransportMapping(org.snmp4j.TransportMapping transport)
|
void |
connectionStateChanged(org.snmp4j.transport.TransportStateEvent change)
|
protected org.snmp4j.agent.CommandProcessor |
createCommandProcessor(org.snmp4j.smi.OctetString engineID)
Creates the command processor. |
AgentXMib |
getAgentXMIB()
|
AgentXCommandProcessor |
getCommandProcessor()
|
org.snmp4j.smi.OctetString |
getLocalEngineID()
|
static short |
getMaxGetBulkRepetitions()
Gets the upper limit for AgentX Get Bulk repetitions field send on behalf of all master agents of this JVM. |
void |
initialize()
|
boolean |
isLocalhostSubagentsOnly()
Indicates whether only subagents from the local host or from any host are allowed to connect to this master agent (default is any host). |
protected void |
launchTransportMappings()
|
protected void |
registerMIBs(org.snmp4j.smi.OctetString context)
|
void |
removeAgentXTransportMapping(org.snmp4j.TransportMapping transport)
|
void |
setLocalEngineID(org.snmp4j.smi.OctetString localEngineID)
|
void |
setLocalhostSubagentsOnly(boolean localhostSubagentsOnly)
Sets the local host only connection filter flag. |
static void |
setMaxGetBulkRepetitions(short maxRepetitions)
Sets the maximum repetitions value used by this master agent for its AgentX Get Bulk requests to subagents. |
void |
shutdown()
|
protected void |
unregisterMIBs(org.snmp4j.smi.OctetString context)
|
| Methods inherited from class org.snmp4j.agent.AgentConfigManager |
|---|
configure, continueProcessing, createNotificationOriginator, createProxyForwarder, createSnmpSession, createUSM, fireLaunchNotifications, getAgentNotificationOriginator, getContext, getDefaultContext, getNotificationLogMIB, getNotificationOriginator, getPersistenceImportMode, getsnmp4jConfigMIB, getSnmp4jLogMIB, getSnmpCommunityMIB, getSnmpNotificationMIB, getSnmpTargetMIB, getSNMPv2MIB, getState, getSupportedSecurityProtocols, getSysDescr, getSysOID, getSysServices, getSysUpTime, getVACM, initMandatoryMIBs, initMessageDispatcherWithMPs, initNotificationLogMIB, initOptionalMIBs, initSecurityModels, initSnmp4jConfigMIB, initSnmp4jLogMIB, launch, launchTransportMappings, linkCounterListener, registerShutdownHook, registerTransportMappings, restoreState, run, saveState, setNotificationOriginator, setPersistenceImportMode, setTableSizeLimit, setTableSizeLimits, setupProxyForwarder, stopTransportMappings, suspendProcessing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AgentXMasterAgent(org.snmp4j.smi.OctetString agentsOwnEngineID,
org.snmp4j.MessageDispatcher messageDispatcher,
org.snmp4j.agent.security.VACM vacm,
org.snmp4j.agent.MOServer[] moServers,
org.snmp4j.util.WorkerPool workerPool,
org.snmp4j.agent.io.MOInputFactory configurationFactory,
org.snmp4j.agent.io.MOPersistenceProvider persistenceProvider,
org.snmp4j.agent.cfg.EngineBootsProvider engineBootsProvider)
AgentConfigManager.run() later.
agentsOwnEngineID - the authoritative engine ID of the agent.messageDispatcher - the MessageDispatcher to use. The message dispatcher must be configured
outside, i.e. transport mappings have to be added before this
constructor is being called.vacm - a view access control model. Typically, this parameter is set to
null to use the default VACM associated with the
VacmMIB.moServers - the managed object server(s) that server the managed objects available
to this agent.workerPool - the WorkerPool to be used to process incoming request.configurationFactory - a MOInputFactory that creates a MOInput stream
with containing serialized ManagedObject information with the agent's
configuration or null otherwise.persistenceProvider - the primary MOPersistenceProvider to be used to load
and store persistent MOs.engineBootsProvider - the provider of engine boots counter.
public AgentXMasterAgent(java.io.File bootCounterFile,
java.io.File configFile)
bootCounterFile - a file that stores the boot counter.configFile - a file that stores persistent MIB data.| Method Detail |
|---|
public void initialize()
initialize in class org.snmp4j.agent.AgentConfigManagerprotected org.snmp4j.agent.CommandProcessor createCommandProcessor(org.snmp4j.smi.OctetString engineID)
createCommandProcessor in class org.snmp4j.agent.AgentConfigManagerengineID - the engine ID of the agent.
public void addAgentXTransportMapping(org.snmp4j.TransportMapping transport)
public void removeAgentXTransportMapping(org.snmp4j.TransportMapping transport)
public static short getMaxGetBulkRepetitions()
setMaxGetBulkRepetitions(short)public AgentXMib getAgentXMIB()
public AgentXCommandProcessor getCommandProcessor()
public org.snmp4j.smi.OctetString getLocalEngineID()
public boolean isLocalhostSubagentsOnly()
true if only connections from the local host are allowed
and false if connections from any host are allowed.public static void setMaxGetBulkRepetitions(short maxRepetitions)
The NET-SNMP AgentX sub-agent has a bug in its AgentX Get Bulk processing that causes endless loops in the sub-agent when the max-repetitions value is greater than one. Since this bug is in NET-SNMP since v4.2 and still present in version 5.4, it is likely, that you will need to set this value to one, if your master agent should ever communicate with a NET-SNMP sub-agent.
maxRepetitions - the upper limit of the maximum repetitions for AgentX Get Bulk
sub-requests.public void setLocalEngineID(org.snmp4j.smi.OctetString localEngineID)
public void setLocalhostSubagentsOnly(boolean localhostSubagentsOnly)
localhostSubagentsOnly - true if only connections from the local host are allowed
and false if connections from any host are allowed.public void connectionStateChanged(org.snmp4j.transport.TransportStateEvent change)
connectionStateChanged in interface org.snmp4j.transport.TransportStateListener
protected void registerMIBs(org.snmp4j.smi.OctetString context)
throws org.snmp4j.agent.DuplicateRegistrationException
registerMIBs in class org.snmp4j.agent.AgentConfigManagerorg.snmp4j.agent.DuplicateRegistrationExceptionprotected void unregisterMIBs(org.snmp4j.smi.OctetString context)
unregisterMIBs in class org.snmp4j.agent.AgentConfigManager
protected void launchTransportMappings()
throws java.io.IOException
launchTransportMappings in class org.snmp4j.agent.AgentConfigManagerjava.io.IOExceptionpublic void shutdown()
shutdown in class org.snmp4j.agent.AgentConfigManager
|
Copyright 2005-2010 Frank Fock (SNMP4J.org) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||