|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--com.adventnet.snmp.snmp2.SnmpAPI
The SnmpAPI class is a root class for AdventNet SNMP API. This class extends "java.lang.Thread". Any network management application written using AdventNet SNMP API, should instantiate this class.
The various vital informations and methods that this class contains are
1. It contains the list of all SnmpSessions which are opened with the help
of this SnmpAPI instance.
2. It contains various public constants for the different SNMP versions,
SNMP operations, SNMP variables, SNMP error values, SNMP exception values,
SNMP table's row status values and the different access constants for these
SNMP variables.
3. It contains a SnmpGroup object which maintains the various group counters
for this SNMP entity.
4. It contains a list of all SecurityProviders that are installed. By
default the USM (User based Security Model) is registered. This corresponds
to the "usmUserTable" of the "SNMP-USER-BASED-SM-MIB" mib.
5. It contains a list of all Access Control Providers that are added by
users. By default the View based Access Control Model ( VACM ) is
registered. These corresponds to the "vacmContextTable",
"vacmSecurityToGroupTable", "vacmAccessTable" and "vacmViewTreeFamilyTable"
of the "SNMP-VIEW-BASED-ACM-MIB" mib.
6. It contains the SnmpEngineTable which cotains the engine information of
various SNMPv3 engines. This table the engineName, engineID, engineTime and
engineBoots of the particular SNMP entity.
7. This class holds the snmpEngineID, snmpEngineBoots and the snmpEngineTime
of this SNMP entity.
8. It contains the database connection for the tables engine table, usm
table and vacm tables.
9. It also provides methods which support persistency of the SecurityModel
specific information in the form of serialize() and deSerialized() methods.
The security configurations can be serialized so that they could be restored
when the SNMPv3 entity is restarted. The SecurityModelTable implementation
has to implement the serialize and deSerialize methods. In order to
store/restore the configuration information, the API user has to set the
file name using the setSerializeFileName method so that the
serialize/deSerialize methods use this file for their operation.
The various activities that this thread performs are
1. Monitors each and every request for their timeouts.
2. Responsible for re-transmitting a request in case of a "retry".
3. Removes the received packets from the queue, when the count exceeds a
threshold value.
To use the low-level API, instantiate an SnmpAPI. From there, you can create SNMP sessions, and perform SNMP operations. You can create multiple SnmpAPI instances, though there is little reason to do so for most applications.
The following table gives the values for the command types available in
SNMP.
SNMP command. | Value in decimal as a byte. | Value in Hex. |
GET_REQ_MSG | -96 | a0 |
GETNEXT_REQ_MSG | -95 | a1 |
GET_RSP_MSG | -94 | a2 |
SET_REQ_MSG | -93 | a3 |
TRP_REQ_MSG | -92 | a4 |
GETBULK_REQ_MSG | -91 | a5 |
INFORM_REQ_MSG | -90 | a6 |
TRP2_REQ_MSG | -89 | a7 |
The following table gives the values for SNMP Data types.
SNMP Variable | Value in decimal as a byte. | Value in Hex. |
STRING | 4 | 4 |
OBJID | 6 | 6 |
INTEGER | 2 | 2 |
NULLOBJ | 5 | 5 |
IPADDRESS | 64 | 40 |
NETWORKADDRESS | 64 | 40 |
COUNTER | 65 | 41 |
GAUGE | 66 | 42 |
UNSIGNED32 | 66 | 42 |
TIMETICKS | 67 | 43 |
OPAQUE | 68 | 44 |
COUNTER64 | 70 | 46 |
UINTEGER32 | 66 | 42 |
The following table gives the values for the
Standard SNMP Errors.
Only the first 6 errors belong to SNMPv1.
SNMP Error Type | Value in decimal as a byte | Value in Hex |
SNMP_ERR_NOERROR | 0 | 00 |
SNMP_ERR_TOOBIG | 1 | 01 |
SNMP_ERR_NOSUCHNAME | 2 | 02 |
SNMP_ERR_BADVALUE | 3 | 03 |
SNMP_ERR_READONLY | 4 | 04 |
SNMP_ERR_GENERR | 5 | 05 |
SNMP_ERR_NOACCESS | 6 | 06 |
SNMP_ERR_WRONGTYPE | 7 | 07 |
SNMP_ERR_WRONGLENGTH | 8 | 08 |
SNMP_ERR_WRONGENCODING | 9 | 09 |
SNMP_ERR_WRONGVALUE | 10 | 0a |
SNMP_ERR_NOCREATION | 11 | 0b |
SNMP_ERR_INCONSISTENTVALUE | 12 | 0c |
SNMP_ERR_RESOURCEUNAVAILABLE | 13 | 0d |
SNMP_ERR_COMMITFAILED | 14 | 0e |
SNMP_ERR_UNDOFAILED | 15 | 0f |
SNMP_ERR_AUTHORIZATIONERROR | 16 | 10 |
SNMP_ERR_NOTWRITABLE | 17 | 11 |
SNMP_ERR_INCONSISTENTNAME | 18 | 12 |
SnmpSession
,
SnmpGroup
,
SecurityModelTable
, Serialized FormField Summary | |
static int |
ACCESSFORNOTIFY
accessible-for-notify in Snmpv2. |
static int |
ACTIVE
The Active State of the Tables. |
static int |
ANY_SEC_MODEL
Constant values for "any" security model. |
static byte |
BITSTRING
Deprecated. This variable has been deprecated in SNMPv2 protocol. |
static byte |
COUNTER
SNMP Type Constants. |
static byte |
COUNTER64
SNMP Type Constants. |
static int |
CREATE_AND_GO
The createAndGo state of the Tables. |
static int |
CREATE_AND_WAIT
The createAndWait state of the Tables. |
static int |
CRITICAL
constant for critical debug messages. |
static int |
debugLevel
variable having debugLevel , by defaullt FATAL. |
static int |
DESTROY
The Destroy state of the Tables. |
static java.lang.String |
ENCODING
The Standard encoding string on which all encoding will be done. |
static byte |
ENDOFMIBVIEWEXP
SNMP v2 Null Object Exception Value. |
static int |
FATAL
constant for fatal debug messages. |
static byte |
GAUGE
SNMP Type Constants. |
static byte |
GET_REQ_MSG
Constant for SNMP get PDU type. |
static byte |
GET_RSP_MSG
Constant for SNMP response PDU type. |
static byte |
GETBULK_REQ_MSG
Constant for SNMP V2 Get Bulk PDU type. |
static byte |
GETNEXT_REQ_MSG
Constant for SNMP get next PDU type. |
static byte |
INFORM_REQ_MSG
Constant for SNMP V2 INFORM PDU type. |
static byte |
INTEGER
SNMP Type Constants. |
static byte |
IPADDRESS
SNMP Type Constants. |
static byte |
NETWORKADDRESS
SNMP Type Constants. |
static int |
NOACCESS
no access for anybody. |
static int |
NON_CRITICAL
constant for non-critical debug messages. |
static int |
NONVOLATILE
The Nonvolatile Storage type of the Tables. |
static byte |
NOSUCHINSTANCEEXP
SNMP v2 Null Object Exception Value. |
static byte |
NOSUCHOBJECTEXP
SNMP v2 Null Object Exception Value. |
static int |
NOT_IN_SERVICE
The notInService state of the Tables. |
static int |
NOT_READY
The notReady state of the Tables. |
static byte |
NSAP
Deprecated. This variable has been deprecated in SNMPv2 protocol |
static byte |
NULLOBJ
SNMP Type Constants. |
static byte |
OBJID
SNMP Type Constants. |
static byte |
OPAQUE
SNMP Type Constants. |
static int |
OTHER
The Other Storage type of the Tables. |
static int |
PERMANENT
The Permanent Storage type of the Tables. |
static int |
RCREATE
read-create value in Snmpv2. |
static int |
READONLY
The Readonly Storage type of the Tables. |
static byte |
REPORT_MSG
Constant for SNMP V2 Report PDU type. |
static int |
RONLY
read access for everyone. |
static int |
RWRITE
add write access for community. |
static byte |
SET_REQ_MSG
Constant for SNMP set request PDU type. |
static byte |
SNMP_ERR_AUTHORIZATIONERROR
SNMP error value. |
static byte |
SNMP_ERR_BADVALUE
SNMP error value. |
static byte |
SNMP_ERR_COMMITFAILED
SNMP error value. |
static byte |
SNMP_ERR_GENERR
SNMP error value. |
static byte |
SNMP_ERR_INCONSISTENTNAME
SNMP error value. |
static byte |
SNMP_ERR_INCONSISTENTVALUE
SNMP error value. |
static byte |
SNMP_ERR_NOACCESS
SNMP error value. |
static byte |
SNMP_ERR_NOCREATION
SNMP error value. |
static byte |
SNMP_ERR_NOERROR
SNMP error value. |
static byte |
SNMP_ERR_NOSUCHNAME
SNMP error value. |
static byte |
SNMP_ERR_NOTWRITABLE
SNMP error value. |
static byte |
SNMP_ERR_READONLY
SNMP error value. |
static byte |
SNMP_ERR_RESOURCEUNAVAILABLE
SNMP error value. |
static byte |
SNMP_ERR_TOOBIG
SNMP error value. |
static byte |
SNMP_ERR_UNDOFAILED
SNMP error value. |
static byte |
SNMP_ERR_WRONGENCODING
SNMP error value. |
static byte |
SNMP_ERR_WRONGLENGTH
SNMP error value. |
static byte |
SNMP_ERR_WRONGTYPE
SNMP error value. |
static byte |
SNMP_ERR_WRONGVALUE
SNMP error value. |
int |
SNMP_PORT
The snmp port value of 161 for UDP. |
int |
SNMP_TRAP_PORT
The trap port value of 162 for UDP. |
static int |
SNMP_VERSION_1
Constant for setting SNMP Version 1. |
static int |
SNMP_VERSION_2
Constant for setting SNMP Version 2 (Not supported). |
static int |
SNMP_VERSION_2C
Constant for setting SNMP Version 2c. |
static int |
SNMP_VERSION_3
Constant for the SNMP Version 3. |
static java.lang.String |
Standard_Prefix
Deprecated. instead use the setOIDPrefix(SnmpOID oid) and getOIDPrefix() methods. |
static byte |
STRING
SNMP Type Constants. |
static byte |
TIMETICKS
SNMP Type Constants. |
static byte |
TRP_REQ_MSG
Constant for SNMP trap PDU type. |
static byte |
TRP2_REQ_MSG
Constant for SNMP V2 Trap PDU type. |
static byte |
UINTEGER32
Deprecated. This variable has been deprecated in SNMP protocol. |
static byte |
UNSIGNED32
SNMP Type Constants. |
static int |
VOLATILE
The Volatile Storage type of the Tables. |
static int |
WONLY
only write access for community. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
SnmpAPI()
Creates a new SnmpAPI instance and initialises the authoritative snmpEngineID, snmpEngineBoots, snmpEngineTime and the providers, SecurityProvider and ACMProvider. |
|
SnmpAPI(boolean debug)
Creates a new SnmpAPI instance and initialises the authoritative snmpEngineID, snmpEngineBoots, snmpEngineTime and the providers, SecurityProvider and ACMProvider. |
Method Summary | |
java.util.Vector |
checkResponses()
Checks each session to see if there is any outstanding response. |
java.util.Vector |
checkTimeouts()
Checks each session to see if there is any outstanding Time-outs |
void |
close()
Stops the API thread which monitors the session for time-outs and retries. |
static boolean |
compare(int[] a,
int[] b)
An int array comparison routine. |
static void |
debugPrintHigh(java.lang.Object str)
debugPrint method for FATAL messages. |
static void |
debugPrintLow(java.lang.Object str)
debugPrint method for NON_CRITICAL messages. |
static void |
debugPrintMedium(java.lang.Object str)
debugPrint method for CRITICAL messages. |
boolean |
deSerialize()
This deSerializes the SNMPV3 Security tables from the file specified by the setSerializeFileName method. |
boolean |
deSerializeEngineBoots()
This deSerializes the engine boots into the file specified by the setSerializeFileName method. |
int |
genMsgID()
This number is unique number that is generated for this JVM. |
int |
genReqID()
This number is unique number that is generated for this JVM. |
ACMProvider |
getACMProvider()
Gets the Access Control Provider maintained bu this SnmpAPI. |
java.lang.String |
getCharacterEncoding()
Returns the Character encoding of the String values. |
java.lang.Object |
getCommunityTable()
Deprecated. use the following instead getSecurityProvider().getTable(1); // where 1 stands for v1 security model. |
static java.sql.Connection |
getConnection()
Returns the database connection instance corresponding to this SnmpAPI instance. |
boolean |
getDebug()
Defines whether debugging output is being generated. |
java.lang.String |
GetEngineBootsSerializeFileName()
Gets the fileName into which the SNMPv3 engineBoots are to be stored so that they are persistant. |
static int |
getMajorVersion()
Returns the major version of this release of SNMP Library. |
static int |
getMinorVersion()
Returns the minor version of this release of SNMP Library. |
SnmpNotifyFilterProfileTable |
getNotifyFilterProfileTable()
Gets the SnmpNotifyFilterProfileTable that is associated with this SnmpAPI instance. |
SnmpNotifyFilterTable |
getNotifyFilterTable()
Gets the SnmpNotifyFilterTable that is associated with this SnmpAPI instance. |
SnmpNotifyTable |
getNotifyTable()
Gets the SnmpNotifyTable that is associated with this SnmpAPI instance. |
static SnmpOID |
getOIDPrefix()
This method returns the OID prefix that is set before. |
static int |
getPatchVersion()
Returns the patch version of this release of SNMP Library. |
static SASClient |
getSASClient()
Returns the SASClient instance which has been created at last through the SnmpSession class. |
SecurityProvider |
getSecurityProvider()
Gets the SecurityProvider maintained by this SnmpAPI. |
java.lang.String |
getSerializeFileName()
Gets the fileName into which the SNMPv3 configuration tables are to be serialized. |
java.util.Vector |
getSessionList()
Get the List of SNMP sessions managed under this SnmpAPI instance. |
SnmpEngineTable |
getSnmpEngine()
Gets the SnmpEngineTable reference. |
int |
getSnmpEngineBoots()
Gets the SnmpEngineBoots (number of times this SNMP engine has booted of this SNMP entity. |
byte[] |
getSnmpEngineID()
Gets the authoritative SnmpEngineID associated with this SNMP entity. |
int |
getSnmpEngineTime()
Gets the SnmpEngineTime. |
SnmpGroup |
getSnmpGroup(java.lang.String local_address,
int port)
Gets the SnmpGroup Object corresponding to the SnmpSession's local_addrs and local_port. |
static java.sql.Statement |
getStatement()
Returns the Statement instance corresponding to this SnmpAPI instance |
SnmpTargetAddrExtTable |
getTargetAddrExtTable()
Gets the SnmpTargetAddrExtTable corresponding to this SnmpAPI. |
com.adventnet.snmp.snmp2.SnmpTargetAddrTable |
getTargetAddrTable()
Gets the SnmpTargetAddrTable corresponding to this SnmpAPI. |
com.adventnet.snmp.snmp2.SnmpTargetParamsTable |
getTargetParamsTable()
Gets the SnmpTargetParamsTable corresponding to this SnmpAPI. |
int |
getTimeWindow()
Gets the time window in which messages are accepted by this SNMP engine. |
java.lang.Object |
getUSMTable()
Deprecated. use the following instead. SnmpApi.getSecurityProvider().getTable(USM_SECURITY_MODEL); // where USM_SECURITY_MODEL = 3 |
java.lang.String |
getV3ConfigTable()
Gets the table name that was configured for V3. |
static java.lang.String |
getVersionString()
Returns a string describing this version of SNMP Library. |
void |
initACMProvider()
This method initializes the Access Control Provider by reading from the file acmProvider.config . |
void |
initJdbcParams(java.lang.String driverName,
java.lang.String urlString,
java.lang.String userName,
java.lang.String password)
This method should be invoked to initialize the Jdbc Parameters in case of database support. |
void |
initSecurityProvider()
This method initializes the SecurityProvider by reading from the file securityProvider.confg . |
boolean |
isCommunityAuthentication()
Gets the Community Authentication flag for this SnmpAPI instance. |
boolean |
isNotificationFiltering()
Gets the notification filtering flag for this SnmpAPI instance. |
boolean |
isV3DatabaseFlag()
Gets the Database flag for this SnmpAPI instance. |
void |
run()
This method starts the API thread which monitors the sessions to look for the requests which have timed out and retransmits the pdu if required. |
boolean |
serialize()
This serializes the SNMPV3 Security tables into the file specified by the setSerializeFileName method. |
boolean |
serializeEngineBoots()
This serializes the engine boots into the file specified by the setSerializeFileName method. |
void |
setCharacterEncoding(java.lang.String encoding)
Sets the Character encoding of the String values. |
void |
setCommunityAuthentication(boolean commAuthFlag)
Enables/Disables the community authentication flag. |
void |
setDebug(boolean debug)
Defines whether debugging output should be generated. |
static void |
setDebugLevel(int level)
sets debugLevel FATAL or CRITICAL or NON_CRITICAL. |
void |
setEngineBootsSerializeFileName(java.lang.String name)
Sets the fileName into which the SNMPv3 engineBoots are to be stored so that they are persistant. |
void |
setNotificationFiltering(boolean notifyFilterFlag)
Enables/Disables the notification filtering. |
static void |
setOIDPrefix(SnmpOID oid)
This is added to any Object ID that does not begin with a '.'. |
void |
setSerializeFileName(java.lang.String name)
Sets the fileName into which the SNMPv3 configuration tables are to be serialized. |
void |
setSnmpEngineBoots(int boots)
Sets the SnmpEngineBoots (number of times this SNMP engine has booted of this SNMP entity. |
void |
setSnmpEngineID(byte[] id)
Sets the authoritative SnmpEngineID for this SNMP entity. |
void |
setSnmpEngineTime(int time)
Sets the SnmpEngineTime, the time in seconds after this SNMP engine has booted. |
void |
setTimeWindow(int win)
Sets the time window in which messages should be accepted by this SNMP engine |
static void |
setupStdOutErr()
Deprecated. please use the logging framework instead. |
static void |
setupStdOutErr(java.lang.String dirStr)
Deprecated. please use the logging framework instead. |
void |
setV3ConfigTable(java.lang.String tableName)
Sets the configured tableName specified in the case of V3Database. |
void |
setV3DatabaseFlag(boolean dBaseFlag)
Sets the Database flag in the case of V3. |
void |
start()
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int OTHER
public static final int VOLATILE
public static final int NONVOLATILE
public static final int PERMANENT
public static final int READONLY
public static java.lang.String ENCODING
public int SNMP_PORT
public int SNMP_TRAP_PORT
public static final int SNMP_VERSION_1
public static final int SNMP_VERSION_2C
public static final int SNMP_VERSION_2
public static final int SNMP_VERSION_3
public static final byte GET_REQ_MSG
public static final byte GETNEXT_REQ_MSG
public static final byte GET_RSP_MSG
public static final byte SET_REQ_MSG
public static final byte TRP_REQ_MSG
public static final byte GETBULK_REQ_MSG
public static final byte INFORM_REQ_MSG
public static final byte TRP2_REQ_MSG
public static final byte REPORT_MSG
public static final byte SNMP_ERR_NOERROR
public static final byte SNMP_ERR_TOOBIG
public static final byte SNMP_ERR_NOSUCHNAME
public static final byte SNMP_ERR_BADVALUE
public static final byte SNMP_ERR_READONLY
public static final byte SNMP_ERR_GENERR
public static final byte SNMP_ERR_NOACCESS
public static final byte SNMP_ERR_WRONGTYPE
public static final byte SNMP_ERR_WRONGLENGTH
public static final byte SNMP_ERR_WRONGENCODING
public static final byte SNMP_ERR_WRONGVALUE
public static final byte SNMP_ERR_NOCREATION
public static final byte SNMP_ERR_INCONSISTENTVALUE
public static final byte SNMP_ERR_RESOURCEUNAVAILABLE
public static final byte SNMP_ERR_COMMITFAILED
public static final byte SNMP_ERR_UNDOFAILED
public static final byte SNMP_ERR_AUTHORIZATIONERROR
public static final byte SNMP_ERR_NOTWRITABLE
public static final byte SNMP_ERR_INCONSISTENTNAME
public static final byte INTEGER
public static final byte STRING
public static final byte BITSTRING
public static final byte OBJID
public static final byte NULLOBJ
public static final byte IPADDRESS
public static final byte NETWORKADDRESS
public static final byte COUNTER
public static final byte GAUGE
public static final byte UNSIGNED32
public static final byte TIMETICKS
public static final byte OPAQUE
public static final byte UINTEGER32
public static final byte NSAP
public static final byte COUNTER64
public static final byte NOSUCHOBJECTEXP
public static final byte NOSUCHINSTANCEEXP
public static final byte ENDOFMIBVIEWEXP
public static final int RONLY
public static final int WONLY
public static final int RWRITE
public static final int NOACCESS
public static final int RCREATE
public static final int ACCESSFORNOTIFY
public static java.lang.String Standard_Prefix
SnmpOID
public static final int ACTIVE
public static final int NOT_IN_SERVICE
public static final int NOT_READY
public static final int CREATE_AND_GO
public static final int CREATE_AND_WAIT
public static final int DESTROY
public static final int ANY_SEC_MODEL
public static final int FATAL
public static final int CRITICAL
public static final int NON_CRITICAL
public static int debugLevel
Constructor Detail |
public SnmpAPI()
The constructor also instantiates the different SnmpV3 configuration tables i.e USMUserTable, SnmpEngineTable, VacmContextTable, VacmGroupTable, VacmGroupAccessTable and VacmViewTreeTable. These tables are used to store the different users, SNMPv3 entity and the vacm information. The API user need not instantiate these configuration tables and instead, has to use the methods provided in this class to access these tables.
SnmpEngineTable
public SnmpAPI(boolean debug)
The constructor also instantiates the different SnmpV3 configuration tables i.e USMUserTable, SnmpEngineTable, VacmContextTable, VacmGroupTable, VacmGroupAccessTable and VacmViewTreeTable. These tables are used to store the different users, SNMPv3 entity and the vacm information. The API user need not instantiate these configuration tables and instead, has to use the methods provided in this class to access these tables.
debug
- The debug flag to be set for this SnmpAPI instance.SnmpEngineTable
Method Detail |
public void start()
start
in class java.lang.Thread
public com.adventnet.snmp.snmp2.SnmpTargetAddrTable getTargetAddrTable()
public void setCommunityAuthentication(boolean commAuthFlag)
commAuthFlag
- The community Authentication flag to be set.public void setNotificationFiltering(boolean notifyFilterFlag)
notifyFilterFlag
- The notification filter flag to be set.public boolean isCommunityAuthentication()
public boolean isNotificationFiltering()
public SnmpNotifyTable getNotifyTable()
public SnmpNotifyFilterTable getNotifyFilterTable()
public SnmpNotifyFilterProfileTable getNotifyFilterProfileTable()
public com.adventnet.snmp.snmp2.SnmpTargetParamsTable getTargetParamsTable()
public java.lang.Object getCommunityTable()
public SnmpTargetAddrExtTable getTargetAddrExtTable()
public java.util.Vector getSessionList()
public void setDebug(boolean debug)
SnmpClient.debugPrint(java.lang.String)
public boolean getDebug()
SnmpClient.debugPrint(java.lang.String)
public static java.sql.Statement getStatement()
public static java.sql.Connection getConnection()
public static SASClient getSASClient()
public void initJdbcParams(java.lang.String driverName, java.lang.String urlString, java.lang.String userName, java.lang.String password) throws java.sql.SQLException, java.lang.ClassNotFoundException
driverName
- Name of the DataBase driver.URL
- URL pointing to the DataBase file nameuserName
- userNamepassWord
- passwordjava.sql.SQLException
- if the database connection could not be
establishedjava.lang.ClassNotFoundException
- if the driver class is not present in
the classpathpublic void setV3ConfigTable(java.lang.String tableName)
tableName
- the name of the table that should be configured.public java.lang.String getV3ConfigTable()
public void setV3DatabaseFlag(boolean dBaseFlag)
dBaseFlag
- the flag to be set.public boolean isV3DatabaseFlag()
public void run()
run
in class java.lang.Thread
public void close()
public int genReqID()
public int genMsgID()
public java.util.Vector checkResponses()
SnmpSession
public java.util.Vector checkTimeouts()
SnmpSession
public void setCharacterEncoding(java.lang.String encoding)
encoding
- the string based on which the string encoding is to be done.getCharacterEncoding()
public java.lang.String getCharacterEncoding()
#setCharacterEncoding()
public static void setOIDPrefix(SnmpOID oid)
oid
- The prefix that will be added before oids.SnmpOID
public static SnmpOID getOIDPrefix()
public byte[] getSnmpEngineID()
public void setSnmpEngineID(byte[] id)
id
- The authoritative SnmpEngineID to be used.public int getSnmpEngineBoots()
public void setSnmpEngineBoots(int boots)
boots
- The snmpEngineBoots for this SNMPv3 entity.
Note : The boots value should be in between 0 and 2147483647.public int getSnmpEngineTime()
public void setSnmpEngineTime(int time)
time
- The time in seconds. This is used by the the
authoritative SNMP engine to set the engineTime value i.e the time
in seconds after the SNMP engine has booted.public void setTimeWindow(int win)
win
- The time in seconds to set the timeWindow attribute.public int getTimeWindow()
public java.lang.Object getUSMTable()
SnmpApi.getSecurityProvider().getTable(USM_SECURITY_MODEL); // where USM_SECURITY_MODEL = 3
public SnmpEngineTable getSnmpEngine()
SnmpEngineTable
public void initSecurityProvider() throws SnmpException
SnmpException
- if the file could not be found or if the
security model could not be registered.public void initACMProvider() throws SnmpException
SnmpException
- if the file could not be found or if the
access control model could not be registered.public SecurityProvider getSecurityProvider()
public ACMProvider getACMProvider()
public SnmpGroup getSnmpGroup(java.lang.String local_address, int port)
local_address
- The address to which the session is bound. The
local_address should be a string representation of the ipAddress.port
- The port at which the session is bound.SnmpGroup
public void setSerializeFileName(java.lang.String name)
name
- The fileName into which the SNMPv3 configuration tables
can be serialized.public java.lang.String getSerializeFileName()
public boolean serialize() throws SnmpException
SnmpException
- If the serialization throws an IOExceptionSecurityModelTable
public boolean deSerialize() throws SnmpException
SnmpException
- If the deSerialization throws an IOExceptionSecurityModelTable
public void setEngineBootsSerializeFileName(java.lang.String name)
name
- The fileName into which the engine boots
can be serialized.public java.lang.String GetEngineBootsSerializeFileName()
public boolean serializeEngineBoots() throws SnmpException
SnmpException
- If the serialization throws an IOExceptionpublic boolean deSerializeEngineBoots() throws SnmpException
SnmpException
- If the serialization throws an IOExceptionpublic static boolean compare(int[] a, int[] b)
a
- The int array to be compared.b
- The int array to be compared.public static void setDebugLevel(int level)
public static void debugPrintHigh(java.lang.Object str)
public static void debugPrintMedium(java.lang.Object str)
public static void debugPrintLow(java.lang.Object str)
public static void setupStdOutErr()
public static void setupStdOutErr(java.lang.String dirStr)
public static int getMajorVersion()
public static int getMinorVersion()
public static int getPatchVersion()
public static java.lang.String getVersionString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |