Package uk.co.westhawk.snmp.beans
Class UsmDiscoveryBean
java.lang.Object
uk.co.westhawk.snmp.beans.UsmDiscoveryBean
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.
- Version:
- $Revision: 1.21 $ $Date: 2009/03/05 15:51:42 $
- Author:
- Birgit Arkesteijn
-
Constructor Summary
ConstructorsConstructorDescriptionUsmDiscoveryBean
(String host, int port) Constructor.UsmDiscoveryBean
(String host, int port, String bindAddr, String typeSocketA) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Destroy the context in use.void
setAuthenticationDetails
(String newUserName, String newUserPassword, int protocol) Sets the user's authentication details.void
setPrivacyDetails
(String newUserPassword, int protocol) Sets the user's privacy details.void
setRetryIntervals
(int[] rinterval) Sets the retry intervals of the PDU.void
Starts the discovery.
-
Constructor Details
-
UsmDiscoveryBean
Constructor.- Parameters:
host
- The host to discoverport
- The port to discover- Throws:
IOException
- See Also:
-
UsmDiscoveryBean
public UsmDiscoveryBean(String host, int port, String bindAddr, String typeSocketA) throws IOException Constructor.- Parameters:
host
- The host to discoverport
- The port to discoverbindAddr
- The local address the server will bind totypeSocketA
- The type of socket to use.- Throws:
IOException
- See Also:
-
-
Method Details
-
setAuthenticationDetails
Sets the user's authentication details. With these details the time line details will be retrieved. If the user details are not set, only the engine ID will be discovered.The time line details only need to be known when the user want to send authenticated message to this SNMP engine.
- Parameters:
newUserName
- The user namenewUserPassword
- The user authentication passwordprotocol
- The user authentication protocol- See Also:
-
setPrivacyDetails
Sets the user's privacy details. With these details the time line details will be retrieved if needed.The time line details only need to be known when the user want to send authenticated message to this SNMP engine.
- Parameters:
newUserPassword
- The user privacy password- See Also:
-
setRetryIntervals
public void setRetryIntervals(int[] rinterval) Sets the retry intervals of the PDU. The length of the array corresponds with the number of retries. Each entry in the array is the number of milliseconds of each try.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.- Parameters:
rinterval
- The interval in msec of each retry- See Also:
-
startDiscovery
Starts the discovery. This method will send a Pdu to discover the SNMP engine ID. Set the user details before calling this method, if you want the time line details to be discovered as well.This is a blocking call! It will return when it has done the whole discovery.
- Throws:
PduException
IOException
- See Also:
-
setAuthenticationDetails(String, String, int)
discoveryEngineId()
discoveryTimeLine()
-
freeResources
public void freeResources()Destroy the context in use.
-