- java.lang.Object
-
- org.snmp4j.AbstractTarget<A>
-
- org.snmp4j.SecureTarget<A>
-
- org.snmp4j.UserTarget<A>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected OctetString
authoritativeEngineID
-
Fields inherited from class org.snmp4j.AbstractTarget
securityLevel, securityModel, securityName
-
-
Constructor Summary
Constructors Constructor Description UserTarget()
Creates a target for a user based security model target.UserTarget(A address, OctetString securityName, byte[] authoritativeEngineID)
Creates a SNMPv3 USM target with security level noAuthNoPriv, one second time-out without retries.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.UserTarget(UserTarget<A> userTarget)
Creates a target for a user based security model target that references security information (protocols and keys) from aUSM
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Target<A>
duplicate()
Creates a new copy of this target with the same address type.boolean
equals(java.lang.Object o)
byte[]
getAuthoritativeEngineID()
Gets the authoritative engine ID of this target.int
hashCode()
void
setAuthoritativeEngineID(byte[] authoritativeEngineID)
Sets the authoritative engine ID of this target.java.lang.String
toString()
-
Methods inherited from class org.snmp4j.AbstractTarget
clone, getAddress, getMaxSizeRequestPDU, getPreferredTransports, getRetries, getSecurityLevel, getSecurityModel, getSecurityName, getTimeout, getVersion, setAddress, setMaxSizeRequestPDU, setPreferredTransports, setRetries, setSecurityLevel, setSecurityModel, setSecurityName, setTimeout, setVersion, toStringAbstractTarget
-
-
-
-
Field Detail
-
authoritativeEngineID
protected OctetString authoritativeEngineID
-
-
Constructor Detail
-
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 aUSM
.- Parameters:
userTarget
- anotherUserTarget
(or subclass thereof) to create a new instance from, by copying all data relevant for aUserTarget
.- 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 transportAddress
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 benull
.
-
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 transportAddress
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 benull
.securityLevel
- theSecurityLevel
to use.- Since:
- 1.1
-
-
Method Detail
-
setAuthoritativeEngineID
public void setAuthoritativeEngineID(byte[] authoritativeEngineID)
Sets the authoritative engine ID of this target.- Parameters:
authoritativeEngineID
- a possibly zero length byte array (must not benull
).
-
getAuthoritativeEngineID
public byte[] getAuthoritativeEngineID()
Gets the authoritative engine ID of this target.- Returns:
- a possibly zero length byte array.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classSecureTarget<A extends Address>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classAbstractTarget<A extends Address>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractTarget<A extends Address>
-
-