public class UsmDiscoveryBean
extends java.lang.Object
This bean performs the SNMPv3 USM discovery process.
The process consists of two steps: first the SNMP engine ID has to be discovered, second the timeline details of the SNMP engine ID have to be discovered. For the last step the username of the principal is needed.
Constructor and Description |
---|
UsmDiscoveryBean(java.lang.String host,
int port)
Constructor.
|
UsmDiscoveryBean(java.lang.String host,
int port,
java.lang.String bindAddr,
java.lang.String typeSocketA)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
discoveryEngineId()
Starts the discovery of the SNMP engine ID.
|
protected void |
discoveryTimeLine()
Starts the discovery of the Time line.
|
void |
freeResources()
Destroy the context in use.
|
void |
setAuthenticationDetails(java.lang.String newUserName,
java.lang.String newUserPassword,
int protocol)
Sets the user's authentication details.
|
void |
setPrivacyDetails(java.lang.String newUserPassword,
int protocol)
Sets the user's privacy details.
|
void |
setRetryIntervals(int[] rinterval)
Sets the retry intervals of the PDU.
|
void |
startDiscovery()
Starts the discovery.
|
public UsmDiscoveryBean(java.lang.String host, int port) throws java.io.IOException
host
- The host to discoverport
- The port to discoverjava.io.IOException
SnmpContextv3.SnmpContextv3(String, int)
,
startDiscovery()
public UsmDiscoveryBean(java.lang.String host, int port, java.lang.String bindAddr, java.lang.String typeSocketA) throws java.io.IOException
host
- The host to discoverport
- The port to discoverbindAddr
- The local address the server will bind totypeSocketA
- The type of socket to use.java.io.IOException
SnmpContextv3.SnmpContextv3(String, int, String, String)
,
startDiscovery()
public void setAuthenticationDetails(java.lang.String newUserName, java.lang.String newUserPassword, int protocol)
The time line details only need to be known when the user want to send authenticated message to this SNMP engine.
newUserName
- The user namenewUserPassword
- The user authentication passwordprotocol
- The user authentication protocolSnmpContextv3Basis.setUserName(String)
,
SnmpContextv3Basis.setUserAuthenticationPassword(String)
,
SnmpContextv3Basis.setAuthenticationProtocol(int)
public void setPrivacyDetails(java.lang.String newUserPassword, int protocol)
The time line details only need to be known when the user want to send authenticated message to this SNMP engine.
newUserPassword
- The user privacy passwordSnmpContextv3Basis.setUserPrivacyPassword(String)
public void setRetryIntervals(int[] rinterval)
If used, please set before sending!
The default is {500, 1000, 2000, 5000, 5000}. It is good practice to make the interval bigger with each retry, if the numbers are the same the chance of collision is higher.rinterval
- The interval in msec of each retryPdu.setRetryIntervals(int[])
public void startDiscovery() throws PduException, java.io.IOException
This is a blocking call! It will return when it has done the whole discovery.
PduException
java.io.IOException
setAuthenticationDetails(String, String, int)
,
discoveryEngineId()
,
discoveryTimeLine()
public void freeResources()
protected void discoveryEngineId() throws PduException, java.io.IOException
This is a blocking call! It will return when it has done the whole discovery.
PduException
java.io.IOException
startDiscovery()
,
discoveryTimeLine()
protected void discoveryTimeLine() throws PduException, java.io.IOException
This is a blocking call! It will return when it has done the whole discovery.
PduException
java.io.IOException
startDiscovery()
,
discoveryEngineId()