Modifier and Type | Field and Description |
---|---|
static boolean |
allowSetOnMissingOid |
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 and Description |
---|
MockSnmpAgent(File confFile,
org.springframework.core.io.Resource moFile) |
MockSnmpAgent(File confFile,
org.springframework.core.io.Resource moFile,
String bindAddress)
Constructor for MockSnmpAgent.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCommunities(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB communityMIB) |
protected void |
addNotificationTargets(org.snmp4j.agent.mo.snmp.SnmpTargetMIB targetMIB,
org.snmp4j.agent.mo.snmp.SnmpNotificationMIB notificationMIB) |
protected void |
addUsmUser(org.snmp4j.security.USM usm) |
protected void |
addViews(org.snmp4j.agent.mo.snmp.VacmMIB vacm) |
static MockSnmpAgent |
createAgentAndRun(org.springframework.core.io.Resource moFile,
String bindAddress)
createAgentAndRun
|
protected List<org.snmp4j.agent.ManagedObject> |
createMockMOs()
createMockMOs
|
protected void |
initMessageDispatcher() |
protected void |
initTransportMappings() |
boolean |
isRunning()
isRunning
|
boolean |
isStopped()
isStopped
|
static void |
main(String[] args)
main
|
static AgentConfigData |
parseCli(String[] args)
parseCli
|
protected void |
registerManagedObjects() |
protected void |
registerSnmpMIBs() |
void |
run()
run
|
void |
shutDown()
shutDown
|
void |
shutDownAndWait()
shutDownAndWait
|
String |
toString()
toString
|
protected void |
unregisterManagedObjects() |
protected void |
unregisterSnmpMIBs() |
void |
updateCounter32Value(String oid,
int val)
updateCounter32Value
|
void |
updateCounter64Value(String oid,
long val)
updateCounter64Value
|
void |
updateIntValue(String oid,
int val)
updateIntValue
|
void |
updateStringValue(String oid,
String val)
updateStringValue
|
void |
updateValue(org.snmp4j.smi.OID oid,
org.snmp4j.smi.Variable value)
updateValue
|
void |
updateValue(String oid,
org.snmp4j.smi.Variable value)
updateValue
|
void |
updateValuesFromResource(org.springframework.core.io.Resource moFile)
updateValuesFromResource
|
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, initSnmpSession, loadConfig, saveConfig, sendColdStartNotification, setAgent, setBootCounterFile, setConfigFile, setDefaultContext, setDefaultProxyForwarder, setEngineBoots, setSysDescr, setSysOID, setSysServices, setupDefaultProxyForwarder, stop, updateEngineBoots, updateSession
public MockSnmpAgent(File confFile, org.springframework.core.io.Resource moFile)
public static MockSnmpAgent createAgentAndRun(org.springframework.core.io.Resource moFile, String bindAddress) throws InterruptedException
createAgentAndRun
moFile
- a Resource
object.bindAddress
- a String
object.MockSnmpAgent
object.InterruptedException
- if any.public static AgentConfigData parseCli(String[] args)
parseCli
args
- an array of String
objects.AgentConfigData
object.protected void initMessageDispatcher()
initMessageDispatcher
in class org.snmp4j.agent.BaseAgent
public void shutDownAndWait() throws InterruptedException
shutDownAndWait
InterruptedException
- if any.public void run()
run
public void shutDown()
shutDown
public boolean isRunning()
isRunning
public boolean isStopped()
isStopped
protected void addCommunities(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB communityMIB)
addCommunities
in class org.snmp4j.agent.BaseAgent
protected void addViews(org.snmp4j.agent.mo.snmp.VacmMIB vacm)
addViews
in class org.snmp4j.agent.BaseAgent
protected void addNotificationTargets(org.snmp4j.agent.mo.snmp.SnmpTargetMIB targetMIB, org.snmp4j.agent.mo.snmp.SnmpNotificationMIB notificationMIB)
addNotificationTargets
in class org.snmp4j.agent.BaseAgent
protected void addUsmUser(org.snmp4j.security.USM usm)
addUsmUser
in class org.snmp4j.agent.BaseAgent
protected void initTransportMappings() throws IOException
initTransportMappings
in class org.snmp4j.agent.BaseAgent
IOException
protected void registerSnmpMIBs()
registerSnmpMIBs
in class org.snmp4j.agent.BaseAgent
protected void unregisterSnmpMIBs()
unregisterSnmpMIBs
in class org.snmp4j.agent.BaseAgent
protected void registerManagedObjects()
registerManagedObjects
in class org.snmp4j.agent.BaseAgent
protected void unregisterManagedObjects()
unregisterManagedObjects
in class org.snmp4j.agent.BaseAgent
protected List<org.snmp4j.agent.ManagedObject> createMockMOs()
createMockMOs
List
object.public void updateValue(org.snmp4j.smi.OID oid, org.snmp4j.smi.Variable value)
updateValue
oid
- a OID
object.value
- a Variable
object.public void updateValue(String oid, org.snmp4j.smi.Variable value)
updateValue
oid
- a String
object.value
- a Variable
object.public void updateIntValue(String oid, int val)
updateIntValue
oid
- a String
object.val
- a int.public void updateCounter32Value(String oid, int val)
updateCounter32Value
oid
- a String
object.val
- a int.public void updateCounter64Value(String oid, long val)
updateCounter64Value
oid
- a String
object.val
- a long.public void updateValuesFromResource(org.springframework.core.io.Resource moFile)
updateValuesFromResource
moFile
- a Resource
object.Copyright © 2015. All Rights Reserved.