|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is the home interface for the SnmpTarget EJB. Access to this interface is using JNDI and the published name. Use the create method from client code, to instantiate a SnmpTarget Session bean.
To use in an application, simply instantiate, specify the object IDs, and perform operations. For example,
SnmpTargetHome home = (SnmpTargetHome) ctx.lookup("SnmpTargetEJB");
SnmpTarget target = (SnmpTarget) home.create(); //where ctx is the naming context.
target.setSnmpVersion (com.adventnet.snmp.ejb.SnmpTarget.VERSION2C);
target.setTargetHost ("localhost"); // set the agent hostname
target.setObjectID(".1.3.6.1.2.1.1.1.0"); // or 1.1.0 with standard prefix
String result = target.snmpGet();
if (result == null)
System.err.println("Failed: "+target.getErrorString());
else System.out.println("Response: "+result);
See the ejbget.java application example in the ejbclient directory for an example.
| Method Summary | |
SnmpTarget |
create()
Use this method from client code, to instantiate a SnmpTarget Session bean. |
| Method Detail |
public SnmpTarget 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 | |||||||||