toc

Description

SNMPProtocol Bean

This bean provides SNMP Manager services. All the frequently used SNMP commands are implemented by this bean and provided in the form of an API.

The SNMPProtocol Bean listens for commands from other beans which implement the user interface. Commands can be passed to the bean either wrapped as a MessageEvent class or by calling the handleRequest methods, both of which process the desired request. It listens for MessageEvents from the SNMPUI Bean by implementing MessageListener. The MessageEventcarries the command name to be executed. Alternatively, SNMP commands may also be issued by invoking the handleRequestwith the proper parameters.

This bean throws three events containing relevant data which a system providing a user interface for this bean would need to interpret. These events contain information about the response to the request made, status of the last issued request, and any traps that may be received from an agent. The SNMPUI Bean needs to listen to these events, retrieve the data and display it to the user.

Significant events

The bean throws the following events, which a user interface component would need to capture :

Significant methods

The SNMPProtocol Bean implements the following significant methods, the exact syntax for each is provided in the API Reference.

  1. Adding/removing listeners for events (described above) thrown by this class:
    addResponseListener / removeResponseListener
    addStatusListener / removeStatusListener
    addTrapListener / removeTrapListener

  2. Methods that accept external events (these are all polymorphic forms and provide same functionality)
    processMessageEvent - listens for message events and makes requests to the agents
    handleRequest - accepts a message object and makes requests to the agents
    handleRequest - accepts the request variables as individual parameters rather than an object

  3. Methods that implement SNMP commands (only a representative sample are documented here)
    snmpGetRequest - issues a get request to specified agent snmp
    snmpGetNextRequest - issues a get-next request to the agent snmp
    snmpSetRequest - issues a set request to the agent
    setTrapEnabled - sets on/off the logic for receiving trap messages from agents
    getResponseObject - method for retrieving a response object if the event cannot be decoded
    getStatus - method for retrieving a status object if the event cannot be decoded
    getTrapObject - method for retrieving a trap object if the trap-event cannot be decoded

  4. Methods used to configure the system
    getPort - get the port number for sending/receiving messages
    setPort - set the port number for sending/receiving messages

Customization

The following attributes of the SNMPProtocol Bean can be customized :


{short description of image} SNMPUI Bean

The SNMPUI Bean implements a user interface for the SNMPProtocol Bean. It provides a mechanism for interacting with the SNMPProtocol Bean for making connections to SNMP Agents and requesting data and setting the variables at the Agent.

The SNMPUI Bean issues commands to the SNMPProtocol Bean by throwing a MessageEventwhich wraps the command issued and the operands and sends it to the SNMPProtocol bean which is the listener. The SNMPProtocol Bean receives theMessageEvent, recovers its contents and executes a corresponding request to the named agent.

The SNMPUI Bean receives feedback about the status of the issued command from the SNMPProtocol Bean through the StatusEvent, requested system variable data is returned to the user interface bean through a ResponseEventand trap information received from an agent is returned through a TrapEvent. The data returned by the StatusEventand ResponseEventare shown in the SNMPUI Bean's response area, while a new window is popped up when a trap is received, as the user may want to view this data immediately.

Significant Events

MessageEvent- this event is thrown to the protocol bean whenever the user issues an SNMP command. The event contains the command and any associated parameters like the agent and object identifiers.

Significant Methods

  1. Methods that listen to events from the protocol bean

Customization

The following attributes of the SNMPUI Bean can be customized :


Refer to the section Usage Scenarios for information on how to use the SNMP Bean in different ways.