Module org.snmp4j
Package org.snmp4j

Class UserTarget<A extends Address>

All Implemented Interfaces:
Serializable, Cloneable, Target<A>
Direct Known Subclasses:
DirectUserTarget

public class UserTarget<A extends Address> extends SecureTarget<A>
User based target for SNMPv3 or later.
Version:
3.1.0
Author:
Frank Fock
See Also:
  • Field Details

    • authoritativeEngineID

      protected OctetString authoritativeEngineID
  • Constructor Details

    • UserTarget

      public UserTarget()
      Creates a target for a user based security model target.
    • UserTarget

      public UserTarget(UserTarget<A> userTarget)
      Creates a target for a user based security model target that references security information (protocols and keys) from a USM.
      Parameters:
      userTarget - another UserTarget (or subclass thereof) to create a new instance from, by copying all data relevant for a UserTarget.
      Since:
      3.4.0
    • UserTarget

      public UserTarget(A address, OctetString securityName, byte[] authoritativeEngineID)
      Creates a SNMPv3 USM target with security level noAuthNoPriv, one second time-out without retries.
      Parameters:
      address - the transport Address of the target.
      securityName - the USM security name to be used to access the target.
      authoritativeEngineID - the authoritative engine ID as a possibly zero length byte array which must not be null.
    • UserTarget

      public UserTarget(A address, OctetString securityName, byte[] authoritativeEngineID, int securityLevel)
      Creates a SNMPv3 USM target with the supplied security level, one second time-out without retries.
      Parameters:
      address - the transport Address of the target.
      securityName - the USM security name to be used to access the target.
      authoritativeEngineID - the authoritative engine ID as a possibly zero length byte array which must not be null.
      securityLevel - the SecurityLevel to use.
      Since:
      1.1
  • Method Details

    • setAuthoritativeEngineID

      public void setAuthoritativeEngineID(byte[] authoritativeEngineID)
      Sets the authoritative engine ID of this target.
      Parameters:
      authoritativeEngineID - a possibly zero length byte array (must not be null).
    • getAuthoritativeEngineID

      public byte[] getAuthoritativeEngineID()
      Gets the authoritative engine ID of this target.
      Returns:
      a possibly zero length byte array.
    • toString

      public String toString()
      Overrides:
      toString in class SecureTarget<A extends Address>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractTarget<A extends Address>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractTarget<A extends Address>
    • duplicate

      public Target<A> duplicate()
      Description copied from interface: Target
      Creates a new copy of this target with the same address type.
      Returns:
      a copy of this target with the same address type.