- java.lang.Object
-
- org.snmp4j.security.UsmUserEntry
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<UsmUserEntry>
public class UsmUserEntry extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<UsmUserEntry>
TheUsmUserEntryclass represents a user in the Local Configuration Datastore (LCD).- Version:
- 3.6.3
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]authenticationKeyprivate OctetStringengineIDprivate java.lang.ref.WeakReference<java.lang.Object>ownerReferenceSpecifies the owner of this entry - this value is used during event processing to avoid cyclic event updatesprivate byte[]privacyKeyprivate static longserialVersionUIDprivate SnmpConstants.StorageTypeEnumstorageTypeprivate OctetStringuserNameprivate UsmUserusmUser
-
Constructor Summary
Constructors Constructor Description UsmUserEntry()Creates a new user entry with empty engine ID and empty user.UsmUserEntry(byte[] engineID, OctetString securityName, OID authProtocol, byte[] authKey, OID privProtocol, byte[] privKey)Creates a localized user entry.UsmUserEntry(OctetString userName, UsmUser user)Creates a user with user name and associatedUsmUser.UsmUserEntry(OctetString userName, OctetString engineID, UsmUser user)Creates a user with username and associatedUsmUser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(UsmUserEntry other)Compares this user entry with another one by engine ID then by their user names.byte[]getAuthenticationKey()OctetStringgetEngineID()java.lang.ObjectgetOwnerReference()Gets the owner of this user entry (if set).byte[]getPrivacyKey()SnmpConstants.StorageTypeEnumgetStorageType()OctetStringgetUserName()UsmUsergetUsmUser()voidsetAuthenticationKey(byte[] authenticationKey)voidsetEngineID(OctetString engineID)voidsetOwnerReference(java.lang.Object ownerReference)Sets the (weak) owner reference of this user entry.voidsetPrivacyKey(byte[] privacyKey)voidsetStorageType(SnmpConstants.StorageTypeEnum storageType)voidsetUserName(OctetString userName)voidsetUsmUser(UsmUser usmUser)java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
engineID
private OctetString engineID
-
userName
private OctetString userName
-
usmUser
private UsmUser usmUser
-
authenticationKey
private byte[] authenticationKey
-
privacyKey
private byte[] privacyKey
-
storageType
private SnmpConstants.StorageTypeEnum storageType
-
ownerReference
private volatile java.lang.ref.WeakReference<java.lang.Object> ownerReference
Specifies the owner of this entry - this value is used during event processing to avoid cyclic event updates
-
-
Constructor Detail
-
UsmUserEntry
public UsmUserEntry()
Creates a new user entry with empty engine ID and empty user.
-
UsmUserEntry
public UsmUserEntry(OctetString userName, UsmUser user)
Creates a user with user name and associatedUsmUser.- Parameters:
userName- the username of the new entry.user- theUsmUserrepresenting the security information of the user.
-
UsmUserEntry
public UsmUserEntry(OctetString userName, OctetString engineID, UsmUser user)
Creates a user with username and associatedUsmUser.- Parameters:
userName- the username of the new entry.engineID- the authoritative engine ID associated with the user.user- theUsmUserrepresenting the security information of the user.
-
UsmUserEntry
public UsmUserEntry(byte[] engineID, OctetString securityName, OID authProtocol, byte[] authKey, OID privProtocol, byte[] privKey)Creates a localized user entry.- Parameters:
engineID- the engine ID for which the users has bee localized.securityName- the user and security name of the new entry.authProtocol- the authentication protocol ID.authKey- the authentication key.privProtocol- the privacy protocol ID.privKey- the privacy key.
-
-
Method Detail
-
getEngineID
public OctetString getEngineID()
-
setEngineID
public void setEngineID(OctetString engineID)
-
setUserName
public void setUserName(OctetString userName)
-
getUserName
public OctetString getUserName()
-
setUsmUser
public void setUsmUser(UsmUser usmUser)
-
getUsmUser
public UsmUser getUsmUser()
-
setAuthenticationKey
public void setAuthenticationKey(byte[] authenticationKey)
-
getAuthenticationKey
public byte[] getAuthenticationKey()
-
setPrivacyKey
public void setPrivacyKey(byte[] privacyKey)
-
getPrivacyKey
public byte[] getPrivacyKey()
-
compareTo
public int compareTo(UsmUserEntry other)
Compares this user entry with another one by engine ID then by their user names.- Specified by:
compareToin interfacejava.lang.Comparable<UsmUserEntry>- Parameters:
other- aUsmUserEntryinstance.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-
getStorageType
public SnmpConstants.StorageTypeEnum getStorageType()
-
setStorageType
public void setStorageType(SnmpConstants.StorageTypeEnum storageType)
-
getOwnerReference
public java.lang.Object getOwnerReference()
Gets the owner of this user entry (if set).- Returns:
- an object previously set by
setOwnerReference(Object)ornull(default). - Since:
- 3.6.3
-
setOwnerReference
public void setOwnerReference(java.lang.Object ownerReference)
Sets the (weak) owner reference of this user entry. If the owner is deleted, this reference disappears andgetOwnerReference()returnsnull.- Parameters:
ownerReference- an object identifying itself as owner of this entry (i.e. this object may ignoreUsmUserEvents of this object while this reference is present.- Since:
- 3.6.3
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-