![]() |
Usage Scenarios |
This section is aimed at describing the various scenarios in which the SNMP beans may be used and how they should be used in each scenario. Some of the scenarios in which the SNMP beans may be used are:
In this scenario application builders would use both the SNMP UI and Protocol beans in their applications. This would require wiring of two kinds, wiring the SNMPUI Bean to the protocol bean and wiring the application container requests to the UI/protocol beans.
Wiring the user interface bean to the protocol bean in this case is extremely simple, and would require the following four connections :
The SNMPProtocol Bean has functionality where in the Trap can be set on/off . Also the application builder can read Agent names from his own file. The same holds true for the Object Identifiers. The look and feel of the entire user interface is customizable.
This scenario assumes that the application developer wants to develop a custom user interface for the SNMPProtocol bean, and that they do not plan to use an existing user interface. In this scenario, it is recommended that the developer analyze the four events which are generated or received by the protocol bean, namely MessageEvent, ResponseEvent, StatusEvent and TrapEvent.This is one option; alternatively, the user interface bean can have corresponding methods which take in ResponseObject, TrapObject or Status (as a String) . A more flexible option is to have methods which take in the domain related parameters in each case. The user interface bean can pass all the parameters required by the protocol bean for encoding in one of three ways - either understand the MessageEvent or the MessageObject or the individual parameters (using handleRequest method). This gives the developer of the user interface bean a lot of flexibility.
Using any of the mechanisms outlined above, the protocol bean can be made to work with any user interface bean.
For the SNMPProtocol bean to be usable with an existing user interface, the following criteria would need to be met :
The user interface component should have APIs using which an adapter class can feed it data about the Response,Trap message or Status information received from the protocol bean. The user interface component should also throw events which would initiate SNMP commands on the protocol bean. The events thrown by the user interface component would need to be trapped by the adapter class and either a MessageEvent created from this data, or the adapter class could call the corresponding methods on the protocol bean.
Events generated by the SNMPProtocol Bean would also be trapped by the adaptor class, the data would need to be extracted, and this data would need to be passed to the user interface bean for display through the appropriate methods.