Package org.snmp4j
Class UserTarget
java.lang.Object
org.snmp4j.AbstractTarget
org.snmp4j.SecureTarget
org.snmp4j.UserTarget
- All Implemented Interfaces:
Serializable
,Cloneable
,Target
User based target for SNMPv3 or later.
- Version:
- 2.0
- Author:
- Frank Fock
- See Also:
-
Field Summary
Fields inherited from class org.snmp4j.AbstractTarget
securityLevel, securityModel, securityName
-
Constructor Summary
ConstructorDescriptionCreates a target for a user based security model target.UserTarget
(Address address, OctetString securityName, byte[] authoritativeEngineID) Creates a SNMPv3 USM target with security level noAuthNoPriv, one second time-out without retries.UserTarget
(Address address, OctetString securityName, byte[] authoritativeEngineID, int securityLevel) Creates a SNMPv3 USM target with the supplied security level, one second time-out without retries. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new copy of this target with the same address type.boolean
byte[]
Gets the authoritative engine ID of this target.int
hashCode()
void
setAuthoritativeEngineID
(byte[] authoritativeEngineID) Sets the authoritative engine ID of this target.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
-
Constructor Details
-
UserTarget
public UserTarget()Creates a target for a user based security model target. -
UserTarget
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(Address 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 Details
-
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.
-
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
- Overrides:
toString
in classSecureTarget
-
equals
- Overrides:
equals
in classAbstractTarget
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractTarget
-