|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.snmp.snmp2.agent.Cache
com.adventnet.snmp.snmp2.agent.BaseSnmpStore
public abstract class BaseSnmpStore
This class intialises api thread and session required for SnmpAgent,SnmpProxy and SnmpTrapService.
Cleans up the common session and associated API thread if no one is using it.
Both SnmpStore and MicroSnmpStore
extend this class.
SnmpStore,
MicroSnmpStore,
Serialized Form| Field Summary | |
|---|---|
protected int |
debugLevel
this indicates the debugLevel of the agent. |
protected java.lang.String |
localAddress
local address of the agent. |
(package private) java.lang.String |
oldAddress
|
(package private) int |
oldPort
|
protected int |
protocol
|
protected SnmpSession |
session
session is the main SnmpSession which waits for requests or it can be SnmpSession which can be used for asynchronous sending of PDU . |
static Log |
snmpLog
|
| Fields inherited from class com.adventnet.snmp.snmp2.agent.Cache |
|---|
cache, debug |
| Constructor Summary | |
|---|---|
protected |
BaseSnmpStore()
The no arg constructor which initialises the SnmpStore and the API thread. |
protected |
BaseSnmpStore(int port)
The one arg(port) constructor which initialises the SnmpStore and the API thread. |
protected |
BaseSnmpStore(java.lang.String ipAddress)
The one arg(ipAddress) constructor which initialises the SnmpStore and the API thread. |
protected |
BaseSnmpStore(java.lang.String ipAddress,
int port)
The two arg(ipAddress, port) constructor which initialises the SnmpStore and the API thread. |
| Method Summary | |
|---|---|
void |
closeAll()
This method closes all the open sessions which are controlled by the common SnmpAPI thread Sets the api thread to null. |
protected ProtocolOptions |
createProtocolOptions(java.lang.String remoteHost,
int remotePort,
int localPort)
|
protected void |
finalize()
This cleans up the common session if no one is using it. |
SnmpAPI |
getSnmpAPI()
Gets the SnmpAPI. |
SnmpSession |
getSnmpSession()
This is the main Session which waits for requests and notifies interested SnmpClient (SnmpAgent). |
SnmpSession |
getSnmpSession(java.lang.String ipAddress)
This is the main Session which waits for requests and notifies interested SnmpClient (SnmpAgent). |
protected void |
initSession()
Initialises the SnmpSession and put it into Cache after assigning the default community as "public" and version as SnmpAPI.SNMP_VERSION_3. |
protected void |
initSnmpStore(BaseSnmpStore store)
|
boolean |
isAlive()
This method lets you know if the Agent and related threads used for monitoring requests are alive |
boolean |
isDebug()
Gets the status of the debug mode. |
static void |
killSnmpAgent()
This method will close all the sessions and api thread including the TrapSession. |
void |
setDebug(boolean val)
sets the debug messages true for SnmpAPI. |
| 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 |
|---|
protected int protocol
protected java.lang.String localAddress
java.lang.String oldAddress
int oldPort
protected transient SnmpSession session
This purely depends upon the implementation of SnmpStore extended classes.
SnmpSessionprotected int debugLevel
utilspublic static Log snmpLog
| Constructor Detail |
|---|
protected BaseSnmpStore()
Doesn't open sessions This must be done explicitly by classes which extend SnmpStore
protected BaseSnmpStore(java.lang.String ipAddress)
Doesn't open sessions This must be done explicitly by classes which extend SnmpStore
protected BaseSnmpStore(int port)
Doesn't open sessions This must be done explicitly by classes which extend SnmpStore
protected BaseSnmpStore(java.lang.String ipAddress,
int port)
Doesn't open sessions This must be done explicitly by classes which extend SnmpStore
| Method Detail |
|---|
public SnmpAPI getSnmpAPI()
public SnmpSession getSnmpSession()
SnmpClientpublic SnmpSession getSnmpSession(java.lang.String ipAddress)
The - IpAddress at which the session is started.
SnmpClient
protected ProtocolOptions createProtocolOptions(java.lang.String remoteHost,
int remotePort,
int localPort)
protected void initSnmpStore(BaseSnmpStore store)
protected void initSession()
public boolean isAlive()
public void closeAll()
throws java.lang.Throwable
Use this method only when you know that nobody else is using the sessions.
java.lang.Throwable - in case of error
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable - in case of finalization errorspublic void setDebug(boolean val)
setDebug in class Cacheval - true or false .SnmpAPIpublic boolean isDebug()
isDebug in class Cachepublic static void killSnmpAgent()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||