|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.snmp4j.agent.BaseAgent
org.ow2.jasmine.interfaces.snmp.SNMPAgent
public class SNMPAgent
JASMINe SNMP agent class.
This class provides basic SNMP features and allows to register MIB objects in order to supply information through SNMP protocol.
All external interfaces
dedicated to SNMP must use this class as a base for all its communications.
This class must only be manipulated via its unique instance.
| Field Summary |
|---|
| 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 |
| Method Summary | |
|---|---|
protected void |
addCommunities(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB communityMIB)
Adds community to security name mappings needed for SNMPv1 and SNMPv2c. |
protected void |
addNotificationTargets(org.snmp4j.agent.mo.snmp.SnmpTargetMIB targetMIB,
org.snmp4j.agent.mo.snmp.SnmpNotificationMIB notificationMIB)
Adds initial notification targets and filters. |
void |
addTrapDestination(java.lang.String trapDestination)
Adds a new destination for SNMP traps. Destinations must be formatted as followed: ipaddress/port (127.0.0.1/162). |
protected void |
addUsmUser(org.snmp4j.security.USM usm)
Adds all the necessary initial users to the USM. |
protected void |
addViews(org.snmp4j.agent.mo.snmp.VacmMIB vacm)
Adds initial VACM configuration. |
static SNMPAgent |
getInstance()
Gets the only instance available. |
protected void |
initTransportMappings()
Initializes the transport mappings (ports) to be used by the agent. |
void |
notify(org.snmp4j.smi.OctetString context,
org.snmp4j.smi.OID notificationID,
org.snmp4j.smi.VariableBinding[] vbs)
Sends a notification through SNMP. |
protected void |
registerManagedObjects()
Register additional managed objects at the agent's server. |
void |
registerMIB(org.snmp4j.agent.MOGroup mib)
Registers an MIB based on the specified manager. |
void |
setRequestSource(java.lang.String source)
Defines the source to listen to GET and SET request. Source must be formatted as followed: ipaddress/port (127.0.0.1/161). |
void |
start()
Starts the agent. |
void |
stop()
Stops the agent. |
protected void |
unregisterManagedObjects()
Unregister additional managed objects from the agent's server. |
void |
unregisterMIB(org.snmp4j.agent.MOGroup mib)
Registers an MIB based on the specified manager. |
| Methods inherited from class org.snmp4j.agent.BaseAgent |
|---|
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, initMessageDispatcher, initSnmpSession, loadConfig, registerSnmpMIBs, run, saveConfig, sendColdStartNotification, setAgent, setBootCounterFile, setConfigFile, setDefaultContext, setDefaultProxyForwarder, setEngineBoots, setSysDescr, setSysOID, setSysServices, setupDefaultProxyForwarder, unregisterSnmpMIBs, updateEngineBoots, updateSession |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SNMPAgent getInstance()
public void start()
public void stop()
stop in class org.snmp4j.agent.BaseAgentpublic void setRequestSource(java.lang.String source)
requestSource - source to listen to GET and SET requestpublic void addTrapDestination(java.lang.String trapDestination)
requestSource - the destination to add.
public void notify(org.snmp4j.smi.OctetString context,
org.snmp4j.smi.OID notificationID,
org.snmp4j.smi.VariableBinding[] vbs)
context - the context name of the context on whose behalf this notification has been generated.notificationID - the object ID that uniquely identifies this notification.vbs - an array of VariableBinding instances representing the payload of the notification.public void registerMIB(org.snmp4j.agent.MOGroup mib)
manager - the manager the MIB will be based on.public void unregisterMIB(org.snmp4j.agent.MOGroup mib)
manager - the manager the MIB will be based on.protected void registerManagedObjects()
registerManagedObjects in class org.snmp4j.agent.BaseAgentprotected void unregisterManagedObjects()
unregisterManagedObjects in class org.snmp4j.agent.BaseAgentprotected void addCommunities(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB communityMIB)
addCommunities in class org.snmp4j.agent.BaseAgentcommunityMIB - the SnmpCommunityMIB holding coexistence configuration for community based security models.
protected void addNotificationTargets(org.snmp4j.agent.mo.snmp.SnmpTargetMIB targetMIB,
org.snmp4j.agent.mo.snmp.SnmpNotificationMIB notificationMIB)
addNotificationTargets in class org.snmp4j.agent.BaseAgenttargetMIB - the SnmpTargetMIB holding the target configuration.notificationMIB - the SnmpNotificationMIB holding the notification (filter) configuration.protected void addUsmUser(org.snmp4j.security.USM usm)
addUsmUser in class org.snmp4j.agent.BaseAgentusm - the USM instance used by this agent.protected void addViews(org.snmp4j.agent.mo.snmp.VacmMIB vacm)
addViews in class org.snmp4j.agent.BaseAgentvacmMIB - the VacmMIB holding the agent's view configuration.
protected void initTransportMappings()
throws java.io.IOException
initTransportMappings in class org.snmp4j.agent.BaseAgentjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||