Class TestSubagent
java.lang.Object
org.snmp4j.agent.agentx.subagent.test.TestSubagent
- All Implemented Interfaces:
Runnable
,EventListener
,RegistrationCallback
,org.snmp4j.transport.TransportStateListener
public class TestSubagent
extends Object
implements Runnable, org.snmp4j.transport.TransportStateListener, RegistrationCallback
The
TestSubagent
is an example implementation of a simple
AgentX subagent with shared tables and multi context registration.- Version:
- 3.0.0
- Author:
- Frank Fock
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestSubagent
(org.snmp4j.smi.Address masterAddress, org.snmp4j.smi.Address localAddress, String configFile) -
Method Summary
Modifier and TypeMethodDescriptionvoid
connectionStateChanged
(org.snmp4j.transport.TransportStateEvent change) static void
protected void
void
registrationEvent
(org.snmp4j.smi.OctetString context, org.snmp4j.agent.ManagedObject<?> mo, int status) The registration attempt of aManagedObject
succeeded or failed.void
run()
<R extends org.snmp4j.agent.mo.MOTableRow,
C extends org.snmp4j.agent.mo.MOColumn<?>, M extends org.snmp4j.agent.mo.MOTableModel<R>>
booleantableRegistrationEvent
(org.snmp4j.smi.OctetString context, AgentXSharedMOTable<R, C, M> mo, R row, boolean indexAllocation, int status, int retryCount) The registration attempt of aManagedObject
succeeded or failed.<R extends org.snmp4j.agent.mo.MOTableRow,
C extends org.snmp4j.agent.mo.MOColumn<?>, M extends org.snmp4j.agent.mo.MOTableModel<R>>
voidtableUnregistrationEvent
(org.snmp4j.smi.OctetString context, AgentXSharedMOTable<R, C, M> mo, R row, boolean indexAllocation, int status) The unregistration attempt of aManagedObject
succeeded or failed.protected void
void
unregistrationEvent
(org.snmp4j.smi.OctetString context, org.snmp4j.agent.ManagedObject<?> mo, int status) The unregistration attempt of aManagedObject
succeeded or failed.
-
Field Details
-
SUBAGENT_ID
public static final org.snmp4j.smi.OID SUBAGENT_ID
-
-
Constructor Details
-
TestSubagent
public TestSubagent(org.snmp4j.smi.Address masterAddress, org.snmp4j.smi.Address localAddress, String configFile)
-
-
Method Details
-
main
-
unregisterSessionDependent
protected void unregisterSessionDependent() -
registerSessionDependent
protected void registerSessionDependent() -
connectionStateChanged
public void connectionStateChanged(org.snmp4j.transport.TransportStateEvent change) - Specified by:
connectionStateChanged
in interfaceorg.snmp4j.transport.TransportStateListener
-
registrationEvent
public void registrationEvent(org.snmp4j.smi.OctetString context, org.snmp4j.agent.ManagedObject<?> mo, int status) Description copied from interface:RegistrationCallback
The registration attempt of aManagedObject
succeeded or failed.- Specified by:
registrationEvent
in interfaceRegistrationCallback
- Parameters:
context
- the registration context.mo
- theManagedObject
that was subject to the registration process.status
- the AgentX status of the registration response.
-
unregistrationEvent
public void unregistrationEvent(org.snmp4j.smi.OctetString context, org.snmp4j.agent.ManagedObject<?> mo, int status) Description copied from interface:RegistrationCallback
The unregistration attempt of aManagedObject
succeeded or failed.- Specified by:
unregistrationEvent
in interfaceRegistrationCallback
- Parameters:
context
- the registration context.mo
- theManagedObject
that was subject to the registration process.status
- the AgentX status of the registration response.
-
run
public void run()
-