Class UsmDiscoveryBean

java.lang.Object
uk.co.westhawk.snmp.beans.UsmDiscoveryBean

public class UsmDiscoveryBean extends 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.

See SNMP-USER-BASED-SM-MIB.

Version:
$Revision: 1.21 $ $Date: 2009/03/05 15:51:42 $
Author:
Birgit Arkesteijn
  • Constructor Details

  • Method Details

    • setAuthenticationDetails

      public void setAuthenticationDetails(String newUserName, String newUserPassword, int protocol)
      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 name
      newUserPassword - The user authentication password
      protocol - The user authentication protocol
      See Also:
    • setPrivacyDetails

      public void setPrivacyDetails(String newUserPassword, int protocol)
      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

      public void startDiscovery() throws PduException, IOException
      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:
    • freeResources

      public void freeResources()
      Destroy the context in use.