com.adventnet.snmp.ejb
Interface SnmpTargetHome


public interface SnmpTargetHome

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

create

public SnmpTarget create()
                  throws CreateException,
                         java.rmi.RemoteException
Use this method from client code, to instantiate a SnmpTarget Session bean.

Returns:
SnmpTarget
Throws:
java.rmi.RemoteException - if there is a communications or systems failure
CreateException - if there is a error creating the bean


Copyright (c)2010 ZOHO Corp., All Rights Reserved