|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is the home interface for the SnmpTable EJB. Access to this interface is using JNDI and the published name. Use the create method from client code, to instantiate a SnmpTable Session bean.
To use the in an application identify the SNMP table to be used. Simply instantiate,specify the host, tableOID and then perform operations on the table. Register for table change events. For example,
SnmpTableHome home = (SnmpTableHome) ctx.lookup("SnmpTableEJB");
table = (SnmpTable) home.create();
table.setSnmpVersion (com.adventnet.snmp.ejb.SnmpTarget.VERSION2C);
table.setTargetHost ("localhost"); // set the agent hostname
table.loadMibs("mibs/RFC1213-MIB") // load the appropriate MIB file
// instantiate this class to receive table events, and register it with the table listener
com.adventnet.snmp.rmi.SnmpTableListener gettable = new EjbGetTable();
rmi.server.UnicastRemoteObject.exportObject(gettable);
table.addSnmpTableListener(gettable);
// Set the table OID in SnmpTable.
// Once specified, SnmpTable will automatically get the data and send table events
try {
table.setTableOID("ifTable"); // set the table OID to query
} catch (Exception ex) {
System.err.println("Invalid table OID: "+ex);
}
See the ejbtable.java application example in the ejbclient directory for an example.
| Method Summary | |
SnmpTable |
create()
Use this method from client code, to instantiate a SnmpTable Session bean. |
| Method Detail |
public SnmpTable create()
throws CreateException,
java.rmi.RemoteException
java.rmi.RemoteException - if there is
a communications or systems failure
CreateException - if there is a error creating the bean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||