org.snmp4j
Class UserTarget

java.lang.Object
  extended by org.snmp4j.AbstractTarget
      extended by org.snmp4j.SecureTarget
          extended by org.snmp4j.UserTarget
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Target

public class UserTarget
extends SecureTarget

User based target for SNMPv3 or later.

Version:
1.0
Author:
Frank Fock
See Also:
Serialized Form

Constructor Summary
UserTarget()
          Creates 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
 byte[] getAuthoritativeEngineID()
          Gets the authoritative engine ID of this target.
 int getSecurityModel()
          Gets the security model for the user target.
 void setAuthoritativeEngineID(byte[] authoritativeEngineID)
          Sets the authoritative engine ID of this target.
 void setSecurityModel(int securityModel)
          Sets the security model for the user target.
 
Methods inherited from class org.snmp4j.SecureTarget
getSecurityLevel, getSecurityName, setSecurityLevel, setSecurityName
 
Methods inherited from class org.snmp4j.AbstractTarget
clone, getAddress, getMaxSizeRequestPDU, getRetries, getTimeout, getVersion, setAddress, setMaxSizeRequestPDU, setRetries, setTimeout, setVersion, toString, toStringAbstractTarget
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserTarget

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


UserTarget

public UserTarget(Address 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(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 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 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 be null).

getAuthoritativeEngineID

public byte[] getAuthoritativeEngineID()
Gets the authoritative engine ID of this target.

Returns:
a possibly zero length byte array.

getSecurityModel

public int getSecurityModel()
Gets the security model for the user target.

Overrides:
getSecurityModel in class SecureTarget
Returns:
SecurityModel.SECURITY_MODEL_USM

setSecurityModel

public void setSecurityModel(int securityModel)
Sets the security model for the user target.

Overrides:
setSecurityModel in class SecureTarget
Parameters:
securityModel - SecurityModel.SECURITY_MODEL_USM, for any other value a IllegalArgumentException is thrown.

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.