com.adventnet.snmp.snmp2.agent
Class SnmpAgent

java.lang.Object
  extended by com.adventnet.snmp.snmp2.agent.Cache
      extended by com.adventnet.snmp.snmp2.agent.BaseSnmpStore
          extended by com.adventnet.snmp.snmp2.agent.BaseSnmpAgent
              extended by com.adventnet.snmp.snmp2.agent.SnmpAgent
All Implemented Interfaces:
PropertyRegistrationListener, SnmpClient, AgentEventListener, java.io.Serializable
Direct Known Subclasses:
JMXSnmpAgent

public class SnmpAgent
extends BaseSnmpAgent

This class handles all the SNMP requests by forwarding the requests to SnmpPduRequestListeners which is registered with the Agent

This class implements SnmpClient and adds itself as client to the SnmpSession.Hence if any pdu is received at the session,its clients authenticate is called.If the authenticate passes,then its SnmpClient callback method is called where the SnmpPDU is given for agents processing.

For sending back the response the send method in SnmpAgent is called.

API users can extend this class and override authenticate method for having access policies which require any special handling.

The agent doesn't require a MIB. This is especially useful when memory constraints are high and some packages can therefore be avoided.

In a JVM you could have a multiple instance of SnmpAgent.

See Also:
#SnmpSession, #SnmpAPI, #SnmpStore, #SnmpClient, Serialized Form

Field Summary
(package private)  AclTable aclTable
          The Authentication Control Table associated with this SnmpAgent.
protected static com.adventnet.utilities.ui.event.ActionHandlerListener actionHandlerListener
           
(package private)  boolean debug
           
(package private)  SnmpEngineEntry entry
           
static java.lang.String homeDirectory
          The home directory.
(package private)  boolean isRemoteConfigurable
           
(package private)  boolean isV3Adaptor
           
(package private)  boolean mibSupportForAdaptor
           
 RemoteV3Client remoteV3Client
          This interface will be called whenever the USM or VACM table is updated , provided the it is added to the SnmpAgent using the addREmoteV3Client().
(package private)  boolean strictlyV3
           
(package private)  SnmpEngineTable table
           
(package private)  java.lang.String v3AdaptorStorage
           
(package private)  V3Initialiser v3Initialiser
          The object of this class will be used if the user wants to implement his own class from which the V3 configurations have to be initialised.
(package private)  boolean v3UserConfig
           
(package private)  boolean viewBasedFlag
           
(package private)  boolean windowsSubAgent
           
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.BaseSnmpAgent
AgentScheduler, api, asyncMode, authListener, callbackThread, communityVector, communityWriter, decoder, ENABLE_SNMP_AUTHEN_TRAPS, errstat, isAuthTrapsDisabled, isStartUpTrapDisabled, outTraps, pduRequestHdlr, port, recdPdu, registrationlistener, schedulerHash, sgl, snmpLog, snmpVersion, started, startTime, statusListener, sysORTableListener, systemGroupHandler, TRANSPORT_PROVIDER, trapListener, trapSourceDefault, utilities, v1v2AccessControl, versionInInt
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.BaseSnmpStore
debugLevel, localAddress, oldAddress, oldPort, protocol, session
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.Cache
cache
 
Constructor Summary
SnmpAgent()
          Constructor which initialises the session parameters with default values of
SnmpAgent(int port)
          One argument (port) Constructor which initialises the session parameters with default values of
SnmpAgent(java.lang.String ipAddress)
          One Argument(ipAddress) Constructor which initialises the session parameters with default values of
SnmpAgent(java.lang.String ipAddress, int port)
          Two argument (ipAddress, port) Constructor which initialises the session parameters with default values of
 
Method Summary
 void addActionHandler(com.adventnet.utilities.ui.event.ActionHandlerListener ahlistener)
          Method to add ActionHandler for this class.
 void addRemoteV3Client(RemoteV3Client client)
          Provides a hook for the user to implement his own class to which all the USM and VACM updations are propogated.
 void addV3Initialiser(V3Initialiser v3Initialiser)
          Adds the V3Initialiser object from which the V3 Configurations will be read to the SnmpAgent.
 boolean authenticate(SnmpPDU pdu, java.lang.String community)
          This method is called before the callback and related processing methods are called has a simple checks based on the community of the pdu which has been received.
 boolean callback(SnmpSession session, SnmpPDU pdu, int reqid)
          The callback of SnmpClient interface for incoming PDUs which is implemented by this agent.
protected  void decodePdu(SnmpPDU pdu)
           
 void enableUsmSpinLock(boolean usm)
           
 AclTable getAclTableInstance()
          Getter for the AclTable instance of this Agent.
 java.lang.String getEngineBootsFileName()
          Getter for EngineBoots File Name
 RemoteV3Client getRemoteV3Client()
          Getter for RemoteV3Client.
 java.lang.String getSerializeFileName()
          Get the name of the serialized file which the SnmpAgent uses to configure the V3 settings.
 SnmpCommunityTableRequestHandler getSnmpCommunityTableListener()
          The method to get the SnmpCommunityTableListener.
 SnmpNotifyFilterProfileTableRequestHandler getSnmpNotifyFilterProfileTableListener()
          The method to get the SnmpNotifyFilterProfileTableListener.
 SnmpNotifyFilterTableRequestHandler getSnmpNotifyFilterTableListener()
          The method to get the SnmpNotifyFilterTableListener.
 SnmpNotifyTableRequestHandler getSnmpNotifyTableListener()
          The method to get the SnmpNotifyTableListener.
 SnmpTargetAddrExtTableRequestHandler getSnmpTargetAddrExtTableListener()
          The method to get the SnmpTargetAddrExtTableListener.
 SnmpTargetAddrTableRequestHandler getSnmpTargetAddrTableListener()
          The method to get the SnmpTargetAddrTableListener.
 SnmpTargetParamsTableRequestHandler getSnmpTargetParamsTableListener()
          The method to get the SnmpTargetParamsTableListener.
 SnmpVacm getSnmpVacm()
          The Getter for SNMP Vacm.
 boolean getSpinLock()
          Get the SpinLock flag set in the agent.This flag is primarily for USMUserTable remote configuration in the agent.API Users need not require this method.
 java.lang.String[] getSubAgent()
          Return the properties of the sub agent.
 UsmUserTableRequestHandler getUsmUserTableListener()
          The method to get the UsmUserTableListener.
 java.lang.String getV3AdaptorStorageMode()
          The method to get the Adaptor Storage Type.
 boolean getV3Configuration()
          Getter for the V3Configuration flag.
 V3Initialiser getV3Initialiser()
          Getter of V3Initialiser
 VacmAccessTableRequestHandler getVacmAccessTableListener()
          The method to get the VacmAccessTableListener.
 VacmContextTableRequestHandler getVacmContextTableListener()
          The method to get the VacmContextTableListener.
 VacmSecurityToGroupTableRequestHandler getVacmSecurityToGroupTableListener()
          The method to get the VacmSecurityToGroupTableListener.
 VacmViewTreeFamilyTableRequestHandler getVacmViewTreeFamilyTableListener()
          The method to get the VacmViewTreeFamilyTableListener.
(package private)  NativeSnmpVar getValue(NativeSnmpVar var, byte req)
          Set methods from dll
(package private)  SnmpVar getValue(SnmpVarBind varbind, byte req)
          returns the variable requested
(package private)  NativeSnmpVar getValue(java.lang.String OidString, byte req)
          Get Requests From DLL
 boolean getViewBasedFlag()
          Getter for the ViewBasedFlag.
 boolean getWindowsSubAgent()
          gets the windows subagent flag
 void initializeAdaptorV3Settings(java.lang.String format, boolean communityAndTargetSupport)
          The method is to set the Storage type for the V3 Tables and the Community Target and Notificaiton MibSupport in Snmp Adaptor.
(package private)  void initSnmpAgent()
           
 boolean isRemoteConfigurable()
          Getter of mode of VACM RemoteConfiguration for the V3agent.
 boolean isSnmpV3Compliance()
          Getter for the V3Compliance flag.
 boolean isStrictlyV3()
           
 boolean isUsmSpinLockEnabled()
           
static void killSnmpAgent()
          Method to kill this Snmp Agent.
 void nativeInit(java.lang.String mibFile, java.lang.String homeDir)
          Called in the case when SnmpAgent acts as a sub agent for windows.
static void nativeStdOutErr(java.lang.String logfile)
          Deprecated. - as logging is included. Setter for standard out and standard error messges.
 void readValuesFromConf(AgentParamOptions options, java.lang.String dirPath)
          Method to start this Agent by reading the Values from a conf file.
 void removeRemoteV3Client()
          Removes the RemoteV3Client from the SnmpAgent.
 boolean restartSnmpAgent(int agentPort)
          Restarts the receiver Thread for receiving requests
 void send(SnmpPDU newPdu)
          Sends the PDU out from the agent.
 void serializeTable()
          Serializes the Snmp Version 3 Tables
 void setAclTableInstance(AclTable table)
          Setter for the AclTable for Authentication of this SnmpAgent.
 void setDebug(boolean val)
          Deprecated. - use Logging Setter for debug flag. Sets the debug mode as on or off.
 void setDebugOff()
          Deprecated. - use Logging. Sets debug flag of the agent as false
 void setDebugOn()
          Deprecated. - use the Logging. Sets debug flag of the agent as true.
 void setEngineBootsFileName(java.lang.String name)
          Setter for EngineBoots File Name
 void setSerializeFileName(java.lang.String fileName)
          Set the fileName into which the SNMPv3 configuration tables are serialized.
 void setSnmpV3Compliance(boolean snmpV3Compliance)
          Setter for V3Compliance flag.
 void setSnmpVersion(java.lang.String snmpVersion, boolean restart)
          The version in which the agent is going to run.
 void setSpinLock(boolean flag)
          Set the spinLock flag in the agent.This is also useful in the USMUserTable configuration in the agent.API users need not require this method
 void setStrictlyV3(boolean flag)
           
 void setSubAgent(java.lang.String[] props)
          Sets the sub agent properties.
 void setTrapSourceDefault(boolean value)
          Deprecated. Make use of the method setDefaultTrap(boolean isDefault) This method switches the trapSource (DEFAULT/TFTABLE) ie, specifies whether the manager to which the trap to be sent must be taken from TFTABLE / DEFAULT. In the case of default, the traps can be sent to only one manager and by default , it is Users should set this flag to false to use the TrapForwardingTable. localhost - port number 162.
 void setV3Configuration(boolean v3Config)
          Setter for the V3Configuration.
 void setVacmRemoteConfiguration(boolean value)
          This method turns on the VACM RemoteConfiguration for the V3agent.
 void setViewBasedFlag(boolean vbac)
          Setter for the ViewBasedFlag.
 void setWarmStart(boolean warmStart)
          Hook method to send warmStart trap.
 void setWindowsSubAgent(boolean value)
          allows agent to act as a sub-agent.
 void stopSnmpAgent()
          Stops the receiver Thread and closes the socket used by this agent.
 
Methods inherited from class com.adventnet.snmp.snmp2.agent.BaseSnmpAgent
addAccessListener, addAuthenticationListener, addClientAndOpenSession, addRegistrationListener, addSnmpPduRequestListener, addSnmpSetGroupListener, addSysORTableListener, addSystemGroupListener, addTrapRequestListener, authenticateReceivedCommunity, checkManagerAccess, checkVersion, createProtocolOptions, createStatusEvent, debugPrint, disableAuthTraps, disableStartUpTrap, genPort, getAccessListener, getAsyncMode, getCommunityVector, getDebugLevel, getInetAddresses, getLocalAddress, getMaxThreads, getNoAccessCommunities, getPort, getReadCommunities, getReadCommunity, getRegistrationListener, getSnmpGroup, getSnmpVersion, getSystemGroupListener, getUpTime, getV1v2AccessControl, getV1v2AccessControlTable, getWriteCommunities, getWriteCommunity, handleGetCommunities, handleGetCommunities, handleInformRequest, handleSetCommunity, incrementSnmpOutTraps, isCallbackThread, isStarted, isTrapSourceDefault, removeAuthenticationListener, removeSnmpClient, removeSnmpPduRequestListener, removeSysORTableListener, restartSnmpAgent, scheduleAndProcessRequestEvent, sendAuthenticationFailureTrap, sendGenericTrap, setAgentScheduler, setAsyncMode, setCallbackThread, setCommunityVector, setDebugLevel, setDefaultTrap, setEnableAuthenTraps, setLocalAddress, setMaxThreads, setPort, setPort, setProtocol, setReadCommunities, setReadCommunity, setSnmpVersion, setStarted, setV1v2AccessControl, setV1v2AccessControlTable, setWriteCommunities, setWriteCommunity
 
Methods inherited from class com.adventnet.snmp.snmp2.agent.BaseSnmpStore
closeAll, finalize, getSnmpAPI, getSnmpSession, getSnmpSession, initSession, initSnmpStore, isAlive, isDebug
 
Methods inherited from class com.adventnet.snmp.snmp2.agent.Cache
getFromCache, getMibOperations, putInCache, setMibOperations
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

windowsSubAgent

boolean windowsSubAgent

v3UserConfig

boolean v3UserConfig

mibSupportForAdaptor

boolean mibSupportForAdaptor

v3AdaptorStorage

java.lang.String v3AdaptorStorage

isV3Adaptor

boolean isV3Adaptor

strictlyV3

boolean strictlyV3

entry

SnmpEngineEntry entry

table

SnmpEngineTable table

aclTable

AclTable aclTable
The Authentication Control Table associated with this SnmpAgent.


debug

boolean debug

homeDirectory

public static java.lang.String homeDirectory
The home directory. This is required for InterprettedAgent to resolve relative paths for FILE-COMMAND when running as a Windows sub agent


remoteV3Client

public RemoteV3Client remoteV3Client
This interface will be called whenever the USM or VACM table is updated , provided the it is added to the SnmpAgent using the addREmoteV3Client().


v3Initialiser

V3Initialiser v3Initialiser
The object of this class will be used if the user wants to implement his own class from which the V3 configurations have to be initialised.


isRemoteConfigurable

boolean isRemoteConfigurable

viewBasedFlag

boolean viewBasedFlag

actionHandlerListener

protected static com.adventnet.utilities.ui.event.ActionHandlerListener actionHandlerListener
Constructor Detail

SnmpAgent

public SnmpAgent()
Constructor which initialises the session parameters with default values of

Read/Write Community = "public"

It starts agent at a random port.

Also it initialises the SnmpV3 parameters.

See Also:
SnmpAgent(String ipAddress), SnmpAgent(int port), SnmpStore()

SnmpAgent

public SnmpAgent(java.lang.String ipAddress)
One Argument(ipAddress) Constructor which initialises the session parameters with default values of

Read/Write Community = "public"

It starts agent at a random port and a given ipAddress.

Also it initialises the SnmpV3 parameters.

See Also:
SnmpAgent(), SnmpAgent(int port), SnmpStore(String ipAddress)

SnmpAgent

public SnmpAgent(int port)
One argument (port) Constructor which initialises the session parameters with default values of

Read/Write Community = "public"

It starts the agent at the specified port and address.

Also it initialises the SnmpV3 parameters.

See Also:
SnmpAgent(), SnmpAgent(String ipAddress), SnmpStore(int port)

SnmpAgent

public SnmpAgent(java.lang.String ipAddress,
                 int port)
Two argument (ipAddress, port) Constructor which initialises the session parameters with default values of

Read/Write Community = "public"

It starts the agent at the specified port and address.

Also it initialises the SnmpV3 parameters.

See Also:
SnmpAgent(), SnmpAgent(int port), SnmpAgent(String ipAddress), SnmpStore(String ipAddress, int port)
Method Detail

setWindowsSubAgent

public void setWindowsSubAgent(boolean value)
allows agent to act as a sub-agent.

Parameters:
value - boolean value to set agent as a subagent or stand alone agent.

getWindowsSubAgent

public boolean getWindowsSubAgent()
gets the windows subagent flag

Specified by:
getWindowsSubAgent in interface PropertyRegistrationListener
Overrides:
getWindowsSubAgent in class BaseSnmpAgent
Returns:
whether the agent is configured as windows subagent

getSnmpVacm

public SnmpVacm getSnmpVacm()
The Getter for SNMP Vacm.

Specified by:
getSnmpVacm in interface PropertyRegistrationListener
Overrides:
getSnmpVacm in class BaseSnmpAgent
Returns:
The SnmpVacm for this agent.

getSpinLock

public boolean getSpinLock()
Get the SpinLock flag set in the agent.This flag is primarily for USMUserTable remote configuration in the agent.API Users need not require this method.

Returns:
true if spinlock is set, false if not.
See Also:
setSpinLock(boolean flag)

setSpinLock

public void setSpinLock(boolean flag)
Set the spinLock flag in the agent.This is also useful in the USMUserTable configuration in the agent.API users need not require this method

Parameters:
flag - the spinLock flag value to be set.
See Also:
getSpinLock()

enableUsmSpinLock

public void enableUsmSpinLock(boolean usm)

isUsmSpinLockEnabled

public boolean isUsmSpinLockEnabled()

initSnmpAgent

void initSnmpAgent()

setDebug

public void setDebug(boolean val)
Deprecated. - use Logging Setter for debug flag. Sets the debug mode as on or off.

Description copied from class: BaseSnmpStore
sets the debug messages true for SnmpAPI.

Overrides:
setDebug in class BaseSnmpStore
Parameters:
val - the value for debug mode.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
SnmpAPI

setDebugOn

public void setDebugOn()
Deprecated. - use the Logging. Sets debug flag of the agent as true.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setDebugOff()

setDebugOff

public void setDebugOff()
Deprecated. - use Logging. Sets debug flag of the agent as false

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setDebugOn()

nativeInit

public void nativeInit(java.lang.String mibFile,
                       java.lang.String homeDir)
Called in the case when SnmpAgent acts as a sub agent for windows.

Parameters:
mibFile - the name of the mib file.
homeDir - the home directory of the mibfile.

send

public void send(SnmpPDU newPdu)
          throws SnmpException
Sends the PDU out from the agent. This is an asynchronous send which SnmpPduRequestListeners could use to send back responses.

Overrides:
send in class BaseSnmpAgent
Parameters:
newPdu - the response PDU.
Throws:
SnmpException - on send errors or if the session is not alive

setStrictlyV3

public void setStrictlyV3(boolean flag)

isStrictlyV3

public boolean isStrictlyV3()

callback

public boolean callback(SnmpSession session,
                        SnmpPDU pdu,
                        int reqid)
Description copied from class: BaseSnmpAgent
The callback of SnmpClient interface for incoming PDUs which is implemented by this agent.

When a pdu reached at the session for which this SnmpAgent is registered as SnmpClient, then the client(here BaseSnmpAgent) callback is called.

Specified by:
callback in interface SnmpClient
Overrides:
callback in class BaseSnmpAgent
Parameters:
session - the session on which agent is communicating.
pdu - the Snmp PDU.
reqid - the value of reqid.

getSerializeFileName

public java.lang.String getSerializeFileName()
Get the name of the serialized file which the SnmpAgent uses to configure the V3 settings.

Specified by:
getSerializeFileName in interface PropertyRegistrationListener
Overrides:
getSerializeFileName in class BaseSnmpAgent
Returns:
fileName The Serialized file name where the configurations are stored if the version is V3, null otherwise.

setSerializeFileName

public void setSerializeFileName(java.lang.String fileName)
                          throws SnmpException
Set the fileName into which the SNMPv3 configuration tables are serialized. This method enables the agent to initialize the V3 configurations as defined in the given serialized file provided the agent is running in v3. Otherwise restart the agent with version v3 for getting initialized with this fileName.

Specified by:
setSerializeFileName in interface PropertyRegistrationListener
Overrides:
setSerializeFileName in class BaseSnmpAgent
Parameters:
fileName - The fileName into which the SNMPv3 configuration tables can be serialized
Throws:
SnmpException - if problem occurs while deserializing the file if the agent is already started in v3.

getValue

NativeSnmpVar getValue(java.lang.String OidString,
                       byte req)
                 throws AgentSnmpException,
                        RowCreationException
Get Requests From DLL

Throws:
AgentSnmpException
RowCreationException

getValue

NativeSnmpVar getValue(NativeSnmpVar var,
                       byte req)
                 throws AgentSnmpException,
                        RowCreationException
Set methods from dll

Throws:
AgentSnmpException
RowCreationException

getValue

SnmpVar getValue(SnmpVarBind varbind,
                 byte req)
           throws AgentSnmpException,
                  RowCreationException
returns the variable requested

Throws:
AgentSnmpException
RowCreationException

decodePdu

protected void decodePdu(SnmpPDU pdu)
Overrides:
decodePdu in class BaseSnmpAgent

authenticate

public boolean authenticate(SnmpPDU pdu,
                            java.lang.String community)
This method is called before the callback and related processing methods are called has a simple checks based on the community of the pdu which has been received.

Specified by:
authenticate in interface SnmpClient
Overrides:
authenticate in class BaseSnmpAgent
Parameters:
pdu - the Snmp PDU.
community - the value of the community.
Returns:
false if the PDU doesnt satisfy authentication mechanism
See Also:
SnmpClient

nativeStdOutErr

public static void nativeStdOutErr(java.lang.String logfile)
Deprecated. - as logging is included. Setter for standard out and standard error messges.

Parameters:
logFile - the file name to set the standard out and error messages.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

restartSnmpAgent

public boolean restartSnmpAgent(int agentPort)
                         throws AgentRuntimeException
Restarts the receiver Thread for receiving requests

Overrides:
restartSnmpAgent in class BaseSnmpAgent
Parameters:
agentPort - the port number on which the SnmpAgent will run.
Returns:
false if unsuccessful
Throws:
AgentRuntimeException - if the specified port is already in use.
See Also:
BaseSnmpStore.isAlive(), BaseSnmpAgent.restartSnmpAgent()

stopSnmpAgent

public void stopSnmpAgent()
Stops the receiver Thread and closes the socket used by this agent.

This thread doesn't kill all the threads and sessions.

Overrides:
stopSnmpAgent in class BaseSnmpAgent
See Also:
SnmpStore

setWarmStart

public void setWarmStart(boolean warmStart)
Hook method to send warmStart trap. call this method with true before calling restartSnmpAgent.

Overrides:
setWarmStart in class BaseSnmpAgent
Parameters:
warmStart - The warmStart trap flag.
Since:
AdventNet Agent Toolkit (Java Edition) 4.2 release.

setSnmpVersion

public void setSnmpVersion(java.lang.String snmpVersion,
                           boolean restart)
The version in which the agent is going to run.

The values could be either v1,v2,v2c or v3. restart SnmpAgent to get this change into effect.

Overrides:
setSnmpVersion in class BaseSnmpAgent
Parameters:
snmpVersion - the version number.
restart - specifies whether the agent needs to be restarted after setting the version.
See Also:
BaseSnmpAgent.getSnmpVersion(), BaseSnmpAgent.setSnmpVersion(String snmpVersion)

setSubAgent

public void setSubAgent(java.lang.String[] props)
Sets the sub agent properties.

Parameters:
props - Properties of sub agent.
See Also:
getSubAgent()

getSubAgent

public java.lang.String[] getSubAgent()
Return the properties of the sub agent.

Returns:
Sub agent properties.
See Also:
setSubAgent(String[] props)

serializeTable

public void serializeTable()
Serializes the Snmp Version 3 Tables


setTrapSourceDefault

public void setTrapSourceDefault(boolean value)
Deprecated. Make use of the method setDefaultTrap(boolean isDefault) This method switches the trapSource (DEFAULT/TFTABLE) ie, specifies whether the manager to which the trap to be sent must be taken from TFTABLE / DEFAULT. In the case of default, the traps can be sent to only one manager and by default , it is Users should set this flag to false to use the TrapForwardingTable. localhost - port number 162.

Parameters:
value - The Default option flag, if true the Default option is taken.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
BaseSnmpAgent.isTrapSourceDefault()

addRemoteV3Client

public void addRemoteV3Client(RemoteV3Client client)
Provides a hook for the user to implement his own class to which all the USM and VACM updations are propogated.

Parameters:
client - The RemoteV3Client implementation.
See Also:
removeRemoteV3Client()

removeRemoteV3Client

public void removeRemoteV3Client()
Removes the RemoteV3Client from the SnmpAgent.

See Also:
addRemoteV3Client(RemoteV3Client client)

getRemoteV3Client

public RemoteV3Client getRemoteV3Client()
Getter for RemoteV3Client.

Returns:
the RemoteV3Client.
See Also:
addRemoteV3Client(RemoteV3Client client)

addV3Initialiser

public void addV3Initialiser(V3Initialiser v3Initialiser)
Adds the V3Initialiser object from which the V3 Configurations will be read to the SnmpAgent.

Parameters:
v3Initialiser - The V3Initialiser implemented by the user.
See Also:
getV3Initialiser()

getV3Initialiser

public V3Initialiser getV3Initialiser()
Getter of V3Initialiser

Returns:
The V3Initialiser implementation.
See Also:
addV3Initialiser(V3Initialiser v3Initialiser)

setVacmRemoteConfiguration

public void setVacmRemoteConfiguration(boolean value)
This method turns on the VACM RemoteConfiguration for the V3agent.

Parameters:
value - The flag of VACM RemoteConfiguration of the V3 Agent.
See Also:
isRemoteConfigurable()

isRemoteConfigurable

public boolean isRemoteConfigurable()
Getter of mode of VACM RemoteConfiguration for the V3agent.

Returns:
true if the V3 Agent if remotely configurable, false if not.
See Also:
setVacmRemoteConfiguration(boolean value)

setEngineBootsFileName

public void setEngineBootsFileName(java.lang.String name)
Setter for EngineBoots File Name

Parameters:
name - The EngineBoots file Name with full path.
See Also:
getEngineBootsFileName()

getEngineBootsFileName

public java.lang.String getEngineBootsFileName()
Getter for EngineBoots File Name

Returns:
The EngineBoots file Name with full path.
See Also:
setEngineBootsFileName(String name)

setSnmpV3Compliance

public void setSnmpV3Compliance(boolean snmpV3Compliance)
Setter for V3Compliance flag.

Parameters:
snmpV3Compliance - The SNMP Version 3 compliance flag
See Also:
isSnmpV3Compliance()

isSnmpV3Compliance

public boolean isSnmpV3Compliance()
Getter for the V3Compliance flag.

Returns:
The SNMP V3 Compliance flag.
See Also:
setV3Compliance

setViewBasedFlag

public void setViewBasedFlag(boolean vbac)
Setter for the ViewBasedFlag. Setting this true will remove the authentication process. API users may not need this method.

Parameters:
vbac - boolean to be set as viewBasedFlag
See Also:
getViewBasedFlag()

getViewBasedFlag

public boolean getViewBasedFlag()
Getter for the ViewBasedFlag.

Returns:
the viewBasedFlag of this Agent.
See Also:
setViewBasedFlag(boolean vbac)

getV3Configuration

public boolean getV3Configuration()
Getter for the V3Configuration flag.

Returns:
the v3Configuration flag - true if the v3 settings are user configured.
See Also:
setV3Configuration(boolean v3Config)

setV3Configuration

public void setV3Configuration(boolean v3Config)
Setter for the V3Configuration. Setting this true will not do the default v3 initializations. API users can use this method to avoid the default v3 settings.

Parameters:
v3Config - boolean to be set as v3Configuration
See Also:
getV3Configuration()

initializeAdaptorV3Settings

public void initializeAdaptorV3Settings(java.lang.String format,
                                        boolean communityAndTargetSupport)
The method is to set the Storage type for the V3 Tables and the Community Target and Notificaiton MibSupport in Snmp Adaptor. API User need not use this method.

Parameters:
format - the Storage Type for the V3Tables(eg., "xml", "ser").
communityAndTargetSupport - true to specify the Community, Target and Notificaion Mib Support.

getV3AdaptorStorageMode

public java.lang.String getV3AdaptorStorageMode()
The method to get the Adaptor Storage Type.

Returns:
The string representation of the Storage Type.

getUsmUserTableListener

public UsmUserTableRequestHandler getUsmUserTableListener()
The method to get the UsmUserTableListener.

Returns:
the UsmUserTableRequestHandler reference of this Agent's SnmpAPI.

getVacmAccessTableListener

public VacmAccessTableRequestHandler getVacmAccessTableListener()
The method to get the VacmAccessTableListener.

Returns:
the VacmAccessTableRequestHandler reference of this Agent's SnmpAPI.

getVacmContextTableListener

public VacmContextTableRequestHandler getVacmContextTableListener()
The method to get the VacmContextTableListener.

Returns:
the VacmContextTableRequestHandler reference of this Agent's SnmpAPI.

getVacmSecurityToGroupTableListener

public VacmSecurityToGroupTableRequestHandler getVacmSecurityToGroupTableListener()
The method to get the VacmSecurityToGroupTableListener.

Returns:
the VacmSecurityToGroupTableRequestHandler reference of this Agent's SnmpAPI.

getVacmViewTreeFamilyTableListener

public VacmViewTreeFamilyTableRequestHandler getVacmViewTreeFamilyTableListener()
The method to get the VacmViewTreeFamilyTableListener.

Returns:
the VacmViewTreeFamilyTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpCommunityTableListener

public SnmpCommunityTableRequestHandler getSnmpCommunityTableListener()
The method to get the SnmpCommunityTableListener.

Returns:
the SnmpCommunityTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpTargetAddrTableListener

public SnmpTargetAddrTableRequestHandler getSnmpTargetAddrTableListener()
The method to get the SnmpTargetAddrTableListener.

Returns:
the SnmpTargetAddrTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpTargetAddrExtTableListener

public SnmpTargetAddrExtTableRequestHandler getSnmpTargetAddrExtTableListener()
The method to get the SnmpTargetAddrExtTableListener.

Returns:
the SnmpTargetAddrExtTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpTargetParamsTableListener

public SnmpTargetParamsTableRequestHandler getSnmpTargetParamsTableListener()
The method to get the SnmpTargetParamsTableListener.

Returns:
the SnmpTargetParamsTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpNotifyTableListener

public SnmpNotifyTableRequestHandler getSnmpNotifyTableListener()
The method to get the SnmpNotifyTableListener.

Returns:
the SnmpNotifyTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpNotifyFilterTableListener

public SnmpNotifyFilterTableRequestHandler getSnmpNotifyFilterTableListener()
The method to get the SnmpNotifyFilterTableListener.

Returns:
the SnmpNotifyFilterTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpNotifyFilterProfileTableListener

public SnmpNotifyFilterProfileTableRequestHandler getSnmpNotifyFilterProfileTableListener()
The method to get the SnmpNotifyFilterProfileTableListener.

Returns:
the SnmpNotifyFilterProfileTableRequestHandler reference of this Agent's SnmpAPI.

readValuesFromConf

public void readValuesFromConf(AgentParamOptions options,
                               java.lang.String dirPath)
Method to start this Agent by reading the Values from a conf file. The name of the File should be "agent_startup_conf.xml"

Parameters:
options - The AgentparamOptions for this Agent.
dirPath - the directory Location where the file exists.

addActionHandler

public void addActionHandler(com.adventnet.utilities.ui.event.ActionHandlerListener ahlistener)
Method to add ActionHandler for this class.

Parameters:
ahlistener - ActionHandlerListener to be added with this class.

killSnmpAgent

public static void killSnmpAgent()
Method to kill this Snmp Agent. This method clears all the Threads spawned by this Agent.


setAclTableInstance

public void setAclTableInstance(AclTable table)
Setter for the AclTable for Authentication of this SnmpAgent.

Parameters:
the - AclTable instance to be set.
See Also:
getAclTableInstance()

getAclTableInstance

public AclTable getAclTableInstance()
Getter for the AclTable instance of this Agent.

Returns:
the AclTable associated with this Agent.
See Also:
setAclTableInstance(AclTable table)