org.snmp4j
Class SecureTarget

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

public abstract class SecureTarget
extends AbstractTarget
implements java.io.Serializable

The SecureTarget is an security model independent abstract class for all targets supporting secure SNMP communication.

Version:
1.0
Author:
Jochen Katz & Frank Fock
See Also:
Serialized Form

Constructor Summary
protected SecureTarget()
          Default constructor.
protected SecureTarget(Address address, OctetString securityName)
          Creates a SNMPv3 secure target with an address and security name.
 
Method Summary
 int getSecurityLevel()
          Gets the security level associated with this target.
 int getSecurityModel()
          Gets the security model associated with this target.
 OctetString getSecurityName()
          Gets the security name associated with this target.
 void setSecurityLevel(int securityLevel)
          Sets the security level for this target.
 void setSecurityModel(int securityModel)
          Sets the security model for this target.
 void setSecurityName(OctetString securityName)
          Sets the security name to be used with this target.
 
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

SecureTarget

protected SecureTarget()
Default constructor.


SecureTarget

protected SecureTarget(Address address,
                       OctetString securityName)
Creates a SNMPv3 secure target with an address and security name.

Parameters:
address - an Address instance denoting the transport address of the target.
securityName - a OctetString instance representing the security name of the USM user used to access the target.
Method Detail

getSecurityModel

public int getSecurityModel()
Gets the security model associated with this target.

Returns:
an int value as defined in the SecurityModel interface or any third party subclass thereof.

getSecurityName

public final OctetString getSecurityName()
Gets the security name associated with this target. The security name is used by the security model to lookup further parameters like authentication and privacy protocol settings from the security model dependent internal storage.

Returns:
an OctetString instance (never null).

getSecurityLevel

public int getSecurityLevel()
Gets the security level associated with this target.

Returns:
one of


setSecurityLevel

public void setSecurityLevel(int securityLevel)
Sets the security level for this target. The supplied security level must be supported by the security model dependent information associated with the security name set for this target.

Parameters:
securityLevel - one of


setSecurityModel

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

Parameters:
securityModel - an int value as defined in the SecurityModel interface or any third party subclass thereof.

setSecurityName

public final void setSecurityName(OctetString securityName)
Sets the security name to be used with this target.

Parameters:
securityName - an OctetString instance (must not be null).
See Also:
getSecurityName()

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.