org.snmp4j.agent
Class AgentConfigManager

java.lang.Object
  extended by org.snmp4j.agent.AgentConfigManager
All Implemented Interfaces:
java.lang.Runnable

public class AgentConfigManager
extends java.lang.Object
implements java.lang.Runnable

The AgentConfigManager is the main component of a SNMP4J-Agent. It puts together agent configuration and agent components like command processor, message dispatcher, managed objects and server, USM, VACM, etc.

Since:
1.2
Version:
1.2
Author:
Frank Fock

Nested Class Summary
 class AgentConfigManager.AgentState
           
 
Field Summary
protected  CommandProcessor agent
           
protected  SnmpCommunityMIB communityMIB
           
protected  MOInputFactory configuration
           
protected  org.snmp4j.smi.OctetString defaultContext
           
protected  org.snmp4j.MessageDispatcher dispatcher
           
protected  EngineBootsProvider engineBootsProvider
           
protected  org.snmp4j.smi.OctetString engineID
           
protected  SnmpFrameworkMIB frameworkMIB
           
protected  MOFactory moFactory
           
protected  org.snmp4j.smi.UnsignedInteger32 notificaitonLogGlobalAge
           
protected  org.snmp4j.smi.UnsignedInteger32 notificaitonLogGlobalLimit
           
protected  org.snmp4j.smi.UnsignedInteger32 notificationLogDefaultLimit
           
protected  NotificationLogMib notificationLogMIB
           
protected  SnmpNotificationMIB notificationMIB
           
protected  NotificationOriginator notificationOriginator
           
protected  int persistenceImportMode
           
protected  MOPersistenceProvider persistenceProvider
           
protected  ProxyForwarder proxyForwarder
           
protected  SnmpProxyMIB proxyMIB
           
protected  AgentConfigManager.AgentState runState
           
protected  MOServer[] servers
           
protected  org.snmp4j.Session session
           
protected  Snmp4jConfigMib snmp4jConfigMIB
           
protected  Snmp4jLogMib snmp4jLogMIB
           
protected  Snmp4jProxyMib snmp4jProxyMIB
           
protected  SNMPv2MIB snmpv2MIB
           
static int STATE_CONFIGURED
           
static int STATE_CREATED
           
static int STATE_INITIALIZED
           
static int STATE_RESTORED
           
static int STATE_RUNNING
           
static int STATE_SAVED
           
static int STATE_SHUTDOWN
           
static int STATE_SUSPENDED
           
static int STATE_UNSAVED_CHANGES
           
protected  org.snmp4j.smi.OctetString sysDescr
           
protected  org.snmp4j.smi.OID sysOID
           
protected  org.snmp4j.smi.Integer32 sysServices
           
protected  MOTableSizeLimit tableSizeLimit
           
protected  SnmpTargetMIB targetMIB
           
protected  SnmpTlsTmMib tlsTmMib
           
protected  org.snmp4j.security.USM usm
           
protected  UsmMIB usmMIB
           
protected  VACM vacm
           
protected  VacmMIB vacmMIB
           
protected  org.snmp4j.util.WorkerPool workerPool
           
 
Constructor Summary
AgentConfigManager(org.snmp4j.smi.OctetString agentsOwnEngineID, org.snmp4j.MessageDispatcher messageDispatcher, VACM vacm, MOServer[] moServers, org.snmp4j.util.WorkerPool workerPool, MOInputFactory configurationFactory, MOPersistenceProvider persistenceProvider, EngineBootsProvider engineBootsProvider)
          Creates a SNMP agent configuration which can be run by calling run() later.
AgentConfigManager(org.snmp4j.smi.OctetString agentsOwnEngineID, org.snmp4j.MessageDispatcher messageDispatcher, VACM vacm, MOServer[] moServers, org.snmp4j.util.WorkerPool workerPool, MOInputFactory configurationFactory, MOPersistenceProvider persistenceProvider, EngineBootsProvider engineBootsProvider, MOFactory moFactory)
          Creates a SNMP agent configuration which can be run by calling run() later.
 
Method Summary
 void configure()
          Configures components and managed objects.
 boolean continueProcessing()
          Continues processing of SNMP requests by coupling message dispatcher and agent.
protected  CommandProcessor createCommandProcessor(org.snmp4j.smi.OctetString engineID)
          Creates the command processor.
protected  NotificationOriginator createNotificationOriginator()
           
protected  ProxyForwarder createProxyForwarder(CommandProcessor agent)
          Creates and registers the default proxy forwarder application (ProxyForwarderImpl).
protected  org.snmp4j.Session createSnmpSession(org.snmp4j.MessageDispatcher dispatcher)
          Creates the SNMP session to be used for this agent.
protected  org.snmp4j.security.TSM createTSM()
          Creates the TSM used by this agent configuration.
protected  org.snmp4j.security.USM createUSM()
          Creates the USM used by this agent configuration.
protected  void fireLaunchNotifications()
          Fire notifications after agent start, i.e.
 NotificationOriginator getAgentNotificationOriginator()
          Returns the notification originator of the agent.
protected  org.snmp4j.smi.OctetString getContext(MOGroup mibGroup, org.snmp4j.smi.OctetString defaultContext)
          This method can be overwritten by a subagent to specify the contexts each MIB module (group) will be registered to.
 org.snmp4j.smi.OctetString getDefaultContext()
          Returns the default context - which is the context that is used by the base agent to register its MIB objects.
 NotificationLogMib getNotificationLogMIB()
          Returns the NOTIFICATION-LOG-MIB implementation used by this config manager.
 NotificationOriginator getNotificationOriginator()
          Returns the notification originator of this agent configuration.
 int getPersistenceImportMode()
          Returns the currently active import mode for the MOPersistenceProvider.
 Snmp4jConfigMib getSnmp4jConfigMIB()
          Returns the SNMP4J-CONFIG-MIB implementation used by this config manager.
 Snmp4jLogMib getSnmp4jLogMIB()
          Returns the SNMP4J-LOG-MIB implementation used by this config manager.
 Snmp4jProxyMib getSnmp4jProxyMIB()
          Returns the SNMP4J-CONFIG-MIB implementation used by this config manager.
 SnmpCommunityMIB getSnmpCommunityMIB()
          Returns the SNMP-COMMUNITY-MIB implementation used by this config manager.
 SnmpNotificationMIB getSnmpNotificationMIB()
          Returns the SNMP-NOTIFICATION-MIB implementation used by this config manager.
 SnmpTargetMIB getSnmpTargetMIB()
          Returns the SNMP-TARGET-MIB implementation used by this config manager.
 SNMPv2MIB getSNMPv2MIB()
          Returns the SNMPv2-MIB implementation used by this config manager.
 int getState()
          Returns the state of the agent.
protected  org.snmp4j.security.SecurityProtocols getSupportedSecurityProtocols()
          Gets the set of security protocols supported by this agent configuration.
 org.snmp4j.smi.OctetString getSysDescr()
          Returns the sysDescr.0 value for this agent which can be modified by altering its value.
 org.snmp4j.smi.OID getSysOID()
          Gets the system OID which can be modified by altering its value.
 org.snmp4j.smi.Integer32 getSysServices()
          Gets the system services ID which can be modified by altering its value.
 SysUpTime getSysUpTime()
          Gets the sysUpTime.0 instance for the default context.
 VACM getVACM()
          Returns the VACM used by this agent config manager.
 void initialize()
           
protected  void initMandatoryMIBs()
           
protected  void initMessageDispatcherWithMPs(org.snmp4j.MessageDispatcher mp)
           
protected  void initNotificationLogMIB(VACM vacm, SnmpNotificationMIB notifyMIB)
           
protected  void initOptionalMIBs()
           
protected  void initSecurityModels(EngineBootsProvider engineBootsProvider)
           
 void initSnmp4jConfigMIB(MOPersistenceProvider[] persistenceProvider)
           
 void initSnmp4jLogMIB()
           
 void initSnmp4jProxyMIB(org.snmp4j.smi.OctetString context)
           
protected  void launch()
          Launch the agent by registering and lauching (i.e., set to listen mode) transport mappings.
protected  void launchTransportMappings()
           
protected static void launchTransportMappings(java.util.Collection<? extends org.snmp4j.TransportMapping> transportMappings)
          Puts a list of transport mappings into listen mode.
protected  void linkCounterListener()
           
protected  void registerMIBs(org.snmp4j.smi.OctetString context)
          Register the initialized MIB modules in the specified context of the agent.
 void registerShutdownHook()
          Registers a shutdown hook Thread at the Runtime instance.
protected  void registerTransportMappings()
           
 boolean restoreState()
          Restore a previously persistently saved state - if available.
 void run()
          Initializes, configures, restores agent state, and then launches the SNMP agent depending on its current run state.
 void saveState()
          Save the state of the agent persistently - if necessary persistent storage is available.
 void setNotificationOriginator(NotificationOriginator notificationOriginator)
          Sets the notification originator of this agent configuration.
 void setPersistenceImportMode(int importMode)
          Sets the import mode for the MOPersistenceProvider.
 void setTableSizeLimit(int sizeLimit)
          Sets the table size limit for the tables in this agent.
 void setTableSizeLimits(java.util.Properties sizeLimits)
          Sets the table size limits for the tables in this agent.
 void setupProxyForwarder()
           
 void shutdown()
          Shutdown the agent by closing the internal SNMP session - including the transport mappings provided through the configured MessageDispatcher and then store the agent state to persistent storage (if available).
protected static void stopTransportMappings(java.util.Collection<? extends org.snmp4j.TransportMapping> transportMappings)
          Closes a list of transport mappings.
 void suspendProcessing()
          Suspends processing of SNMP requests.
protected  void unregisterMIBs(org.snmp4j.smi.OctetString context)
          Unregister the initialized MIB modules from the default context of the agent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_CREATED

public static final int STATE_CREATED
See Also:
Constant Field Values

STATE_INITIALIZED

public static final int STATE_INITIALIZED
See Also:
Constant Field Values

STATE_CONFIGURED

public static final int STATE_CONFIGURED
See Also:
Constant Field Values

STATE_RESTORED

public static final int STATE_RESTORED
See Also:
Constant Field Values

STATE_SUSPENDED

public static final int STATE_SUSPENDED
See Also:
Constant Field Values

STATE_RUNNING

public static final int STATE_RUNNING
See Also:
Constant Field Values

STATE_UNSAVED_CHANGES

public static final int STATE_UNSAVED_CHANGES
See Also:
Constant Field Values

STATE_SAVED

public static final int STATE_SAVED
See Also:
Constant Field Values

STATE_SHUTDOWN

public static final int STATE_SHUTDOWN
See Also:
Constant Field Values

agent

protected CommandProcessor agent

workerPool

protected org.snmp4j.util.WorkerPool workerPool

vacm

protected VACM vacm

usm

protected org.snmp4j.security.USM usm

servers

protected MOServer[] servers

session

protected org.snmp4j.Session session

dispatcher

protected org.snmp4j.MessageDispatcher dispatcher

engineID

protected org.snmp4j.smi.OctetString engineID

proxyForwarder

protected ProxyForwarder proxyForwarder

notificationOriginator

protected NotificationOriginator notificationOriginator

configuration

protected MOInputFactory configuration

persistenceProvider

protected MOPersistenceProvider persistenceProvider

persistenceImportMode

protected int persistenceImportMode

engineBootsProvider

protected EngineBootsProvider engineBootsProvider

snmpv2MIB

protected SNMPv2MIB snmpv2MIB

targetMIB

protected SnmpTargetMIB targetMIB

communityMIB

protected SnmpCommunityMIB communityMIB

notificationMIB

protected SnmpNotificationMIB notificationMIB

frameworkMIB

protected SnmpFrameworkMIB frameworkMIB

usmMIB

protected UsmMIB usmMIB

vacmMIB

protected VacmMIB vacmMIB

tlsTmMib

protected SnmpTlsTmMib tlsTmMib

proxyMIB

protected SnmpProxyMIB proxyMIB

snmp4jLogMIB

protected Snmp4jLogMib snmp4jLogMIB

snmp4jConfigMIB

protected Snmp4jConfigMib snmp4jConfigMIB

snmp4jProxyMIB

protected Snmp4jProxyMib snmp4jProxyMIB

notificationLogMIB

protected NotificationLogMib notificationLogMIB

notificationLogDefaultLimit

protected org.snmp4j.smi.UnsignedInteger32 notificationLogDefaultLimit

notificaitonLogGlobalLimit

protected org.snmp4j.smi.UnsignedInteger32 notificaitonLogGlobalLimit

notificaitonLogGlobalAge

protected org.snmp4j.smi.UnsignedInteger32 notificaitonLogGlobalAge

moFactory

protected MOFactory moFactory

sysDescr

protected org.snmp4j.smi.OctetString sysDescr

sysOID

protected org.snmp4j.smi.OID sysOID

sysServices

protected org.snmp4j.smi.Integer32 sysServices

defaultContext

protected org.snmp4j.smi.OctetString defaultContext

runState

protected AgentConfigManager.AgentState runState

tableSizeLimit

protected MOTableSizeLimit tableSizeLimit
Constructor Detail

AgentConfigManager

public AgentConfigManager(org.snmp4j.smi.OctetString agentsOwnEngineID,
                          org.snmp4j.MessageDispatcher messageDispatcher,
                          VACM vacm,
                          MOServer[] moServers,
                          org.snmp4j.util.WorkerPool workerPool,
                          MOInputFactory configurationFactory,
                          MOPersistenceProvider persistenceProvider,
                          EngineBootsProvider engineBootsProvider)
Creates a SNMP agent configuration which can be run by calling run() later.

Parameters:
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 serve 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.

AgentConfigManager

public AgentConfigManager(org.snmp4j.smi.OctetString agentsOwnEngineID,
                          org.snmp4j.MessageDispatcher messageDispatcher,
                          VACM vacm,
                          MOServer[] moServers,
                          org.snmp4j.util.WorkerPool workerPool,
                          MOInputFactory configurationFactory,
                          MOPersistenceProvider persistenceProvider,
                          EngineBootsProvider engineBootsProvider,
                          MOFactory moFactory)
Creates a SNMP agent configuration which can be run by calling run() later.

Parameters:
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 serve 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.
moFactory - the MOFactory to be used to create ManagedObjects created by this config manager. If null the DefaultMOFactory will be used.
Since:
1.4
Method Detail

run

public void run()
Initializes, configures, restores agent state, and then launches the SNMP agent depending on its current run state. For example, if initialize() has not yet been called it will be called before the agent is being configured in the next step.

See also initialize(), configure(), restoreState(), and launch().

Specified by:
run in interface java.lang.Runnable

getState

public int getState()
Returns the state of the agent.

Returns:
a integer constant from STATE_CREATED thru STATE_RUNNING.

getVACM

public VACM getVACM()
Returns the VACM used by this agent config manager.

Returns:
the VACM instance of this agent.
Since:
1.4

getSNMPv2MIB

public SNMPv2MIB getSNMPv2MIB()
Returns the SNMPv2-MIB implementation used by this config manager.

Returns:
the SNMPv2MIB instance of this agent.
Since:
1.4

getSnmpTargetMIB

public SnmpTargetMIB getSnmpTargetMIB()
Returns the SNMP-TARGET-MIB implementation used by this config manager.

Returns:
the SnmpTargetMIB instance of this agent.
Since:
1.4

getSnmpNotificationMIB

public SnmpNotificationMIB getSnmpNotificationMIB()
Returns the SNMP-NOTIFICATION-MIB implementation used by this config manager.

Returns:
the SnmpNotificationMIB instance of this agent.
Since:
1.4

getSnmpCommunityMIB

public SnmpCommunityMIB getSnmpCommunityMIB()
Returns the SNMP-COMMUNITY-MIB implementation used by this config manager.

Returns:
the SnmpCommunityMIB instance of this agent.
Since:
1.4

getNotificationLogMIB

public NotificationLogMib getNotificationLogMIB()
Returns the NOTIFICATION-LOG-MIB implementation used by this config manager.

Returns:
the NotificationLogMib instance of this agent.
Since:
1.4.2

getSnmp4jLogMIB

public Snmp4jLogMib getSnmp4jLogMIB()
Returns the SNMP4J-LOG-MIB implementation used by this config manager.

Returns:
the Snmp4jLogMib instance of this agent.
Since:
1.4.2

getSnmp4jConfigMIB

public Snmp4jConfigMib getSnmp4jConfigMIB()
Returns the SNMP4J-CONFIG-MIB implementation used by this config manager.

Returns:
the Snmp4jConfigMib instance of this agent.
Since:
1.4.2

getSnmp4jProxyMIB

public Snmp4jProxyMib getSnmp4jProxyMIB()
Returns the SNMP4J-CONFIG-MIB implementation used by this config manager.

Returns:
the Snmp4jConfigMib instance of this agent.
Since:
2.0

launch

protected void launch()
Launch the agent by registering and lauching (i.e., set to listen mode) transport mappings.


fireLaunchNotifications

protected void fireLaunchNotifications()
Fire notifications after agent start, i.e. sending a coldStart trap.


continueProcessing

public boolean continueProcessing()
Continues processing of SNMP requests by coupling message dispatcher and agent. To succeed, the current state of the agent must be STATE_SUSPENDED.

Returns:
true if the running state could be restored, false otherwise.

suspendProcessing

public void suspendProcessing()
Suspends processing of SNMP requests. This call decouples message dispatcher and agent. All transport mappings remain unchanged and thus all ports remain opened.


shutdown

public void shutdown()
Shutdown the agent by closing the internal SNMP session - including the transport mappings provided through the configured MessageDispatcher and then store the agent state to persistent storage (if available).


registerShutdownHook

public void registerShutdownHook()
Registers a shutdown hook Thread at the Runtime instance.


initSnmp4jLogMIB

public void initSnmp4jLogMIB()

initSnmp4jConfigMIB

public void initSnmp4jConfigMIB(MOPersistenceProvider[] persistenceProvider)

initSnmp4jProxyMIB

public void initSnmp4jProxyMIB(org.snmp4j.smi.OctetString context)

initNotificationLogMIB

protected void initNotificationLogMIB(VACM vacm,
                                      SnmpNotificationMIB notifyMIB)

initSecurityModels

protected void initSecurityModels(EngineBootsProvider engineBootsProvider)

initMessageDispatcherWithMPs

protected void initMessageDispatcherWithMPs(org.snmp4j.MessageDispatcher mp)

registerTransportMappings

protected void registerTransportMappings()

launchTransportMappings

protected void launchTransportMappings()
                                throws java.io.IOException
Throws:
java.io.IOException

launchTransportMappings

protected static void launchTransportMappings(java.util.Collection<? extends org.snmp4j.TransportMapping> transportMappings)
                                       throws java.io.IOException
Puts a list of transport mappings into listen mode.

Parameters:
transportMappings - a list of TransportMapping instances.
Throws:
java.io.IOException - if a transport cannot listen to incoming messages.

stopTransportMappings

protected static void stopTransportMappings(java.util.Collection<? extends org.snmp4j.TransportMapping> transportMappings)
                                     throws java.io.IOException
Closes a list of transport mappings.

Parameters:
transportMappings - a list of TransportMapping instances.
Throws:
java.io.IOException - if a transport cannot be closed.

saveState

public void saveState()
Save the state of the agent persistently - if necessary persistent storage is available.


restoreState

public boolean restoreState()
Restore a previously persistently saved state - if available.

Returns:
true if the agent state could be restored successfully, false otherwise.

configure

public void configure()
Configures components and managed objects.


initMandatoryMIBs

protected void initMandatoryMIBs()

linkCounterListener

protected void linkCounterListener()

getSupportedSecurityProtocols

protected org.snmp4j.security.SecurityProtocols getSupportedSecurityProtocols()
Gets the set of security protocols supported by this agent configuration.

Returns:
SecurityProtocols.getInstance() by default after initialization by SecurityProtocols.addDefaultProtocols().

createUSM

protected org.snmp4j.security.USM createUSM()
Creates the USM used by this agent configuration.

Returns:
an USM initialized by the engine boots from the engineBootsProvider and engineID.

createTSM

protected org.snmp4j.security.TSM createTSM()
Creates the TSM used by this agent configuration.

Returns:
an USM initialized by the engine boots from the engineBootsProvider and engineID.

getSysServices

public org.snmp4j.smi.Integer32 getSysServices()
Gets the system services ID which can be modified by altering its value.

Returns:
72 by default.

getSysOID

public org.snmp4j.smi.OID getSysOID()
Gets the system OID which can be modified by altering its value.

Returns:
an OID - by default the SNMP4J root OID is returned.

getSysDescr

public org.snmp4j.smi.OctetString getSysDescr()
Returns the sysDescr.0 value for this agent which can be modified by altering its value.

Returns:
an OctetString describing the node of the form
SNMP4J-Agent version [SNMP4J-version] -
          -  - 
.

getSysUpTime

public SysUpTime getSysUpTime()
Gets the sysUpTime.0 instance for the default context.

Returns:
a SysUpTime instance.

getNotificationOriginator

public NotificationOriginator getNotificationOriginator()
Returns the notification originator of this agent configuration. To get the (multi-threaded) NotificationOriginator of the agent, use getAgentNotificationOriginator() instead.

Returns:
a NotificationOriginator instance.

getAgentNotificationOriginator

public NotificationOriginator getAgentNotificationOriginator()
Returns the notification originator of the agent. Use this method to get a NotificationOriginator for sending your notifications.

Returns:
the NotificationOriginator instance.
Since:
1.4

setNotificationOriginator

public void setNotificationOriginator(NotificationOriginator notificationOriginator)
Sets the notification originator of this agent configuration.

Parameters:
notificationOriginator - a NotificationOriginator instance.

initialize

public void initialize()

setTableSizeLimits

public void setTableSizeLimits(java.util.Properties sizeLimits)
Sets the table size limits for the tables in this agent. If this method is called while the agent's registration is being changed, a ConcurrentModificationException might be thrown.

Parameters:
sizeLimits - a set of properties as defined by MOTableSizeLimit.
Since:
1.4

setTableSizeLimit

public void setTableSizeLimit(int sizeLimit)
Sets the table size limit for the tables in this agent. If this method is called while the agent's registration is being changed, a ConcurrentModificationException might be thrown.

Parameters:
sizeLimit - the maximum size (numer of rows) of tables allowed for this agent.
Since:
1.4

initOptionalMIBs

protected void initOptionalMIBs()

getDefaultContext

public org.snmp4j.smi.OctetString getDefaultContext()
Returns the default context - which is the context that is used by the base agent to register its MIB objects. By default it is null which causes the objects to be registered virtually for all contexts. In that case, subagents for example my not register their own objects under the same subtree(s) in any context. To allow subagents to register their own instances of those MIB modules, an empty OctetString should be used as default context instead.

Returns:
null or an OctetString (normally the empty string) denoting the context used for registering default MIBs.

getContext

protected org.snmp4j.smi.OctetString getContext(MOGroup mibGroup,
                                                org.snmp4j.smi.OctetString defaultContext)
This method can be overwritten by a subagent to specify the contexts each MIB module (group) will be registered to.

Parameters:
mibGroup - a group of ManagedObjects (i.e., a MIB module).
defaultContext - the context to be used by default (i.e., the null context)
Returns:
the context for which the module should be registered.

registerMIBs

protected void registerMIBs(org.snmp4j.smi.OctetString context)
                     throws DuplicateRegistrationException
Register the initialized MIB modules in the specified context of the agent.

Parameters:
context - the context to register the internal MIB modules. This should be null by default.
Throws:
DuplicateRegistrationException - if some of the MIB modules registration regions conflict with already registered regions.

unregisterMIBs

protected void unregisterMIBs(org.snmp4j.smi.OctetString context)
Unregister the initialized MIB modules from the default context of the agent.

Parameters:
context - the context where the MIB modules have been previously registered.

setupProxyForwarder

public void setupProxyForwarder()

createNotificationOriginator

protected NotificationOriginator createNotificationOriginator()

createProxyForwarder

protected ProxyForwarder createProxyForwarder(CommandProcessor agent)
Creates and registers the default proxy forwarder application (ProxyForwarderImpl).

Parameters:
agent - the command processor that uses the proxy forwarder.
Returns:
a ProxyForwarder instance.

createCommandProcessor

protected CommandProcessor createCommandProcessor(org.snmp4j.smi.OctetString engineID)
Creates the command processor.

Parameters:
engineID - the engine ID of the agent.
Returns:
a new CommandProcessor instance.

createSnmpSession

protected org.snmp4j.Session createSnmpSession(org.snmp4j.MessageDispatcher dispatcher)
Creates the SNMP session to be used for this agent.

Parameters:
dispatcher - the message dispatcher to be associated with the session.
Returns:
a SNMP session (a Snmp instance by default).

setPersistenceImportMode

public void setPersistenceImportMode(int importMode)
Sets the import mode for the MOPersistenceProvider.

Parameters:
importMode - one of the import modes defined by ImportModes.
Since:
1.4

getPersistenceImportMode

public int getPersistenceImportMode()
Returns the currently active import mode for the MOPersistenceProvider.

Returns:
one of the import modes defined by ImportModes.
Since:
1.4

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.