|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.adventnet.snmp.snmp2.SnmpEngineEntry
This class represents a particular SNMP entity and provides a unique mapping between the internet address and port of an entity to the engineID. An SnmpEngineEntry is created for each IPaddress and port of the SNMP entity. The SNMP entity may act as an agent or as a manager entity. This class maintains the host, port, time and boots values for each SNMP entity in addition to supporting the discovery process. The SnmpEngineTable maintains a table of SnmpEngineEntry Objects. Each SnmpEngineEntry Object created is added to the SnmpEngineTable.
For the entities acting like a manager, the attributes remoteHost, remotePort, engineID, engineBoots and engineTime, which are accessed by their respective get/set methods, represent the remote SNMP agent values. For the entities acting as an agent, the above attributes represent the entities own values.
SnmpEngineTable
, Serialized FormConstructor Summary | |
SnmpEngineEntry(java.lang.String engineName)
Constructs a new SnmpEngineEntry which represents a particular SnmpV3 entity for the specified engineName. |
|
SnmpEngineEntry(java.lang.String address,
int port)
Constructs a new SnmpEngineEntry which represents a particular SnmpV3 entity for the specified host and port. |
Method Summary | |
SnmpEngineEntry |
copy()
|
void |
discoverEngineID(SnmpSession session)
This performs the standard Snmpv3 discovery process to learn the engineID of the Snmp peer entity. |
byte[] |
discoverSnmpEngineID(SnmpSession session)
This performs the standard Snmpv3 discovery process to learn the engineID of the Snmp peer entity. |
byte[] |
discoverSnmpEngineID(SnmpSession session,
int timeout,
int retries)
This performs the standard Snmpv3 discovery process to learn the engineID of the Snmp peer entity. |
int |
getEngineBoots()
Returns the engine boots value of the corresponding SNMP entity. |
byte[] |
getEngineID()
Returns the engineid of the coresponding Snmp entity. |
java.lang.String |
getEngineName()
Returns the engineName of the corresponding Snmp entity when Independent transport provider is used. |
int |
getEngineTime()
Gets the engine time of the corresponding Snmp entity. |
java.lang.Object |
getHashKey()
Retrieve the hash key for this entry. |
int |
getLatestReceived()
|
long |
getLocalTime()
|
java.lang.String |
getRemoteHost()
Returns the host name of the corresponding Snmp entity. |
int |
getRemotePort()
Returns the port of the corresponding Snmp entity. |
int |
hashCode()
Returns the hashCode for the object. |
int |
sendDiscoverMsg(SnmpSession session)
This performs the standard Snmpv3 discovery process to learn the engineID of the Snmp peer entity. |
void |
setEngineBoots(int boots)
Sets the engineBoots value of the corresponding SNMP entity. |
void |
setEngineID(byte[] id)
Sets the engineID of the corresponding Snmp entity. |
void |
setEngineTime(int time)
Sets the engine time of the corresponding Snmp entity. |
void |
setLatestReceived(int lt)
|
void |
setLocalTime(long t)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SnmpEngineEntry(java.lang.String address, int port)
address
- The hostName for the new Snmp entity.port
- The port for the new Snmp entity.public SnmpEngineEntry(java.lang.String engineName)
engineName
- The stringified value of the engine name for the new
Snmp entity.Method Detail |
public java.lang.String getRemoteHost()
public int getRemotePort()
public byte[] getEngineID()
public void setEngineID(byte[] id)
id
- The EngineID of the Snmp entity.public int getEngineTime()
public void setEngineTime(int time)
time
- The engine time to be set.public int getLatestReceived()
public void setLatestReceived(int lt)
public void setLocalTime(long t)
public long getLocalTime()
public int getEngineBoots()
public void setEngineBoots(int boots)
boots
- The SnmpEngineBoots value to be set.public java.lang.Object getHashKey()
String
Object.public int hashCode()
hashCode
in class java.lang.Object
public int sendDiscoverMsg(SnmpSession session)
This performs an asynchronous discovery. This method sends the discovery message and returns. The response to the discovery which is a report PDU is handled in the SnmpSession receiver thread and the engineID is populated there.
session
- The SnmpSession over which the discovery message is sent.public void discoverEngineID(SnmpSession session)
This performs a synchronous discovery. This method sends the discovery message and returns only after receiving SNMP response, or timing out. Once the response is received the engineID of this SnmpEngineEntry object is populated.
session
- The SnmpSession over which the discovery message is sent.public byte[] discoverSnmpEngineID(SnmpSession session) throws SnmpException, java.sql.SQLException
This performs a synchronous discovery. This method sends the discovery message and returns only after receiving SNMP response, or timing out. Once the response is received the engineID of this SnmpEngineEntry object is populated.
session
- The SnmpSession over which the discovery message is sent.SnmpException
- throws when the synchronous request is made.java.sql.SQLException
- this will be thrown when the DatabaseFlag
connection is established and the v3DatabaseFlag is enabled.public byte[] discoverSnmpEngineID(SnmpSession session, int timeout, int retries) throws SnmpException, java.sql.SQLException
This performs a synchronous discovery. This method sends the discovery message and returns only after receiving SNMP response, or timing out. Once the response is received the engineID of this SnmpEngineEntry object is populated.
session
- The SnmpSession over which the discovery message is sent.timeout
- The timeout for this synchronous request.retries
- The retries for this request.SnmpException
- throws when the synchronous request is made.java.sql.SQLException
- this will be thrown when the DatabaseFlag
connection is established and the v3DatabaseFlag is enabled.public SnmpEngineEntry copy()
public java.lang.String getEngineName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |