com.adventnet.snmp.rmi
Interface SnmpTrapReceiver

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
SnmpTrapReceiverImpl_Stub

public interface SnmpTrapReceiver
extends java.rmi.Remote

This RMI interface is an SNMP Trap Receiver for use with RMI clients. This RMI interface defines the set of services accessible remotely from an RMI client to the RMI server. By obtaining a remote reference to the object implementing this interface, the RMI client application can perform RMI calls.

Please see the RMI client examples for more information on getting started using the RMI APIs. You will find it very useful to get familiar with the com.adventnet.snmp.beans package before using the RMI APIs, since the RMI APIs mirror and are derived from the beans equivalents.


Method Summary
 void addTrapListener(TrapListener l)
          Add a listener for events from this target.
 void cleanup()
          This cleans up the common connection if no one using
 void createUserEntry(byte[] engineID, byte secLevel)
          v3 only to create a User entry in USMUser Table
 java.lang.String getAuthPassword()
          v3 only get AuthPassword
 int getAuthProtocol()
          v3 only get AuthProtocol
 java.lang.String getCommunity()
          Get the SNMP Community
 java.lang.String getcontextID()
          Deprecated. Replaced with getContextID()
 java.lang.String getContextName()
          v3 only Get the SNMP V3 Context name
 java.lang.String[] getLocalAddresses()
          Get the local addresses to listen on.
 java.lang.String getMibModules()
          Get the MIBs loaded in this applet/application - a white-space separated list of mib files.
 MibOperations getMibOperations()
          Get the MibOperations object reference.
 int getPort()
          Get the local SNMP port number to listen on.
 java.lang.String getPrincipal()
          v3 only get Principal ie userName
 java.lang.String getPrivPassword()
          v3 only get AuthPassword
 int getReceiveBufferSize()
          v3 only This method returns the buffer size of this SnmpTrapReceiver.
 int getSecurityModel()
          v3 only get the SNMP V3 securityModel
 java.lang.Object getSecurityTable(int secModel)
           
 int getSnmpVersion()
          v2c and v3 only Get the SNMP Version
 void initSecurityProvider()
           
 boolean isSupportedSecurityModel(int secModel)
           
 void loadMibs(java.lang.String mibs)
          Load the mibs specified by white-space separated list of mibs.
 void releaseResources()
          Though the resources will be cleaned up by the garbage collector, if the application is no more using the SnmpTrapReceiver instances, this method can be used to immediately release the resources.
 void removeTrapListener(TrapListener l)
          Remove a listener for events from this target.
 void setAuthPassword(java.lang.String passwd)
          v3 only set the Authentication password
 void setAuthProtocol(int protocol)
          v3 only set the Authentication protocol
 void setCommunity(java.lang.String s)
          Set the SNMP Community
 void setcontextID(byte[] ctxtID)
          Deprecated. Replaced with setContextID(byte[] ctxtID)
 void setContextID(byte[] ctxtID)
          v3 only set the SNMP V3 contextID
 void setContextName(java.lang.String cName)
          v3 only Set the SNMP V3 Context name
 void setDebug(boolean debug)
          determine is debug output will be printed
 void setLocalAddresses(java.lang.String[] addresses)
          Set the local SNMP port number to listen on.
 void setMibModules(java.lang.String mibs)
          Set the MIBs loaded in this applet/application - a white-space separated list of mib files.
 void setPort(int i)
          Set the local SNMP port number to listen on.
 void setPortWithExceptionMsg(int i)
          set the local SNMP port number to listen on and throws SnmpException in case of BindException.
 void setPrincipal(java.lang.String principal)
          v3 only Set the Username
 void setPrivPassword(java.lang.String passwd)
          v3 only set the Privacy password
 void setReceiveBufferSize(int size)
          v3 only This method sets the buffer size of this SnmpTrapReceiver.
 void setSecurityModel(int securityModel)
          v3 only set the SNMP V3 SecurityModel
 void setSnmpVersion(int version)
          v2c and v3 only Set the SNMP Version
 

Method Detail

releaseResources

public void releaseResources()
                      throws java.rmi.RemoteException
Though the resources will be cleaned up by the garbage collector, if the application is no more using the SnmpTrapReceiver instances, this method can be used to immediately release the resources.

java.rmi.RemoteException

loadMibs

public void loadMibs(java.lang.String mibs)
              throws java.rmi.RemoteException
Load the mibs specified by white-space separated list of mibs. If first SnmpTrapReceiver has been opened with applet parameter, then URLs will be used. MIB loading applies across all beans in this package, i.e. MIBs can be loaded in any of the bean instances, and will be available across all beans in this package, across the VM.

Throws:
MibException - is thrown upon parse errors.
java.io.IOException - is thrown upon IO errors.
java.io.FileNotFoundException - is thrown if the file is not found.
java.rmi.RemoteException

addTrapListener

public void addTrapListener(TrapListener l)
                     throws java.rmi.RemoteException
Add a listener for events from this target. The listener listens for events from any or all SNMP requests.

java.rmi.RemoteException

removeTrapListener

public void removeTrapListener(TrapListener l)
                        throws java.rmi.RemoteException
Remove a listener for events from this target.

java.rmi.RemoteException

getMibOperations

public MibOperations getMibOperations()
                               throws java.rmi.RemoteException
Get the MibOperations object reference. This allows using additonal MibOperations functions if needed.

java.rmi.RemoteException

setDebug

public void setDebug(boolean debug)
              throws java.rmi.RemoteException
determine is debug output will be printed

java.rmi.RemoteException

getMibModules

public java.lang.String getMibModules()
                               throws java.rmi.RemoteException
Get the MIBs loaded in this applet/application - a white-space separated list of mib files.

java.rmi.RemoteException

setMibModules

public void setMibModules(java.lang.String mibs)
                   throws java.rmi.RemoteException
Set the MIBs loaded in this applet/application - a white-space separated list of mib files.

java.rmi.RemoteException

cleanup

public void cleanup()
             throws java.rmi.RemoteException
This cleans up the common connection if no one using

Throws:
java.lang.Throwable - in case of finalization errors
java.rmi.RemoteException

getLocalAddresses

public java.lang.String[] getLocalAddresses()
                                     throws java.rmi.RemoteException
Get the local addresses to listen on.

java.rmi.RemoteException

setLocalAddresses

public void setLocalAddresses(java.lang.String[] addresses)
                       throws java.rmi.RemoteException
Set the local SNMP port number to listen on.

java.rmi.RemoteException

getPort

public int getPort()
            throws java.rmi.RemoteException
Get the local SNMP port number to listen on.

java.rmi.RemoteException

setPort

public void setPort(int i)
             throws java.rmi.RemoteException
Set the local SNMP port number to listen on.

java.rmi.RemoteException

setPortWithExceptionMsg

public void setPortWithExceptionMsg(int i)
                             throws java.rmi.RemoteException
set the local SNMP port number to listen on and throws SnmpException in case of BindException. This will allow the api users to catch the exception and dispaly a message.

Throws:
SnmpException - if the socket could not be opened, or the socket could not bind to the specified local port.
java.rmi.RemoteException
Since:
Release 2.2

getCommunity

public java.lang.String getCommunity()
                              throws java.rmi.RemoteException
Get the SNMP Community

java.rmi.RemoteException

setCommunity

public void setCommunity(java.lang.String s)
                  throws java.rmi.RemoteException
Set the SNMP Community

java.rmi.RemoteException

getSnmpVersion

public int getSnmpVersion()
                   throws java.rmi.RemoteException
v2c and v3 only Get the SNMP Version

java.rmi.RemoteException

setSnmpVersion

public void setSnmpVersion(int version)
                    throws java.rmi.RemoteException
v2c and v3 only Set the SNMP Version

java.rmi.RemoteException

setPrincipal

public void setPrincipal(java.lang.String principal)
                  throws java.rmi.RemoteException
v3 only Set the Username

java.rmi.RemoteException

setAuthProtocol

public void setAuthProtocol(int protocol)
                     throws java.rmi.RemoteException
v3 only set the Authentication protocol

java.rmi.RemoteException

setAuthPassword

public void setAuthPassword(java.lang.String passwd)
                     throws java.rmi.RemoteException
v3 only set the Authentication password

java.rmi.RemoteException

setPrivPassword

public void setPrivPassword(java.lang.String passwd)
                     throws java.rmi.RemoteException
v3 only set the Privacy password

java.rmi.RemoteException

createUserEntry

public void createUserEntry(byte[] engineID,
                            byte secLevel)
                     throws java.rmi.RemoteException
v3 only to create a User entry in USMUser Table

java.rmi.RemoteException

getContextName

public java.lang.String getContextName()
                                throws java.rmi.RemoteException
v3 only Get the SNMP V3 Context name

java.rmi.RemoteException

setContextName

public void setContextName(java.lang.String cName)
                    throws java.rmi.RemoteException
v3 only Set the SNMP V3 Context name

java.rmi.RemoteException

getcontextID

public java.lang.String getcontextID()
                              throws java.rmi.RemoteException
Deprecated. Replaced with getContextID()

v3 only get the SNMP V3 contextID

java.rmi.RemoteException

setcontextID

public void setcontextID(byte[] ctxtID)
                  throws java.rmi.RemoteException
Deprecated. Replaced with setContextID(byte[] ctxtID)

v3 only set the SNMP V3 contextID

java.rmi.RemoteException

setContextID

public void setContextID(byte[] ctxtID)
                  throws java.rmi.RemoteException
v3 only set the SNMP V3 contextID

java.rmi.RemoteException

getSecurityModel

public int getSecurityModel()
                     throws java.rmi.RemoteException
v3 only get the SNMP V3 securityModel

java.rmi.RemoteException

setSecurityModel

public void setSecurityModel(int securityModel)
                      throws java.rmi.RemoteException
v3 only set the SNMP V3 SecurityModel

java.rmi.RemoteException

getPrincipal

public java.lang.String getPrincipal()
                              throws java.rmi.RemoteException
v3 only get Principal ie userName

java.rmi.RemoteException

getAuthProtocol

public int getAuthProtocol()
                    throws java.rmi.RemoteException
v3 only get AuthProtocol

java.rmi.RemoteException

getAuthPassword

public java.lang.String getAuthPassword()
                                 throws java.rmi.RemoteException
v3 only get AuthPassword

java.rmi.RemoteException

getPrivPassword

public java.lang.String getPrivPassword()
                                 throws java.rmi.RemoteException
v3 only get AuthPassword

java.rmi.RemoteException

initSecurityProvider

public void initSecurityProvider()
                          throws java.rmi.RemoteException
java.rmi.RemoteException

getSecurityTable

public java.lang.Object getSecurityTable(int secModel)
                                  throws java.rmi.RemoteException
java.rmi.RemoteException

isSupportedSecurityModel

public boolean isSupportedSecurityModel(int secModel)
                                 throws java.rmi.RemoteException
java.rmi.RemoteException

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws java.rmi.RemoteException
v3 only This method sets the buffer size of this SnmpTrapReceiver. This method SHOULD be called only when jdk1.2 and higher version is used.

Parameters:
size - the size of the buffer.
java.rmi.RemoteException

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws java.rmi.RemoteException
v3 only This method returns the buffer size of this SnmpTrapReceiver. This method SHOULD be called only when jdk1.2 and higher version is used.

Returns:
the buffer size of this receiver.
java.rmi.RemoteException


Copyright (c)ZOHO Corp. 1996-2012