Module org.snmp4j
Package org.snmp4j

Interface Target<A extends Address>

All Superinterfaces:
Cloneable, Serializable
All Known Implementing Classes:
AbstractTarget, CertifiedTarget, CommunityTarget, DirectUserTarget, SecureTarget, TlsX509CertifiedTarget, UserTarget

public interface Target<A extends Address> extends Serializable, Cloneable
A Target interface defines an abstract representation of a remote SNMP entity. It represents a target with an Address object, as well protocol parameters such as retransmission and timeout policy.
Version:
3.1.0
Author:
Frank Fock
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Creates a new copy of this target with the same address type.
    Gets the address of this target.
    int
    Gets the maximum size of request PDUs that this target is able to respond to.
    Gets the prioritised list of transport mappings to be used for this target.
    int
    Gets the number of retries.
    int
    Gets the security level associated with this target.
    int
    Gets the security model associated with this target.
    Gets the security name associated with this target.
    long
    Gets the timeout for a target.
    int
    Gets the SNMP version (NMP messagen processing model) of the target.
    void
    setAddress(A address)
    Sets the address of the target.
    void
    setMaxSizeRequestPDU(int maxSizeRequestPDU)
    Sets the maximum size of request PDUs that this target is able to receive.
    void
    setRetries(int retries)
    Sets the number of retries to be performed before a request is timed out.
    void
    setSecurityLevel(int securityLevel)
    Sets the security level for this target.
    void
    setSecurityModel(int securityModel)
    Sets the security model for this target.
    void
    Sets the security name to be used with this target.
    void
    setTimeout(long timeout)
    Sets the timeout for a target.
    void
    setVersion(int version)
    Sets the SNMP version (thus the SNMP message processing model) of the target.
  • Method Details

    • getAddress

      A getAddress()
      Gets the address of this target.
      Returns:
      an Address instance.
    • setAddress

      void setAddress(A address)
      Sets the address of the target.
      Parameters:
      address - an Address instance.
    • setVersion

      void setVersion(int version)
      Sets the SNMP version (thus the SNMP message processing model) of the target.
      Parameters:
      version - the message processing model ID.
      See Also:
    • getVersion

      int getVersion()
      Gets the SNMP version (NMP messagen processing model) of the target.
      Returns:
      the message processing model ID.
      See Also:
    • setRetries

      void setRetries(int retries)
      Sets the number of retries to be performed before a request is timed out.
      Parameters:
      retries - the number of retries. Note: If the number of retries is set to 0, then the request will be sent out exactly once.
    • getRetries

      int getRetries()
      Gets the number of retries.
      Returns:
      an integer >= 0.
    • setTimeout

      void setTimeout(long timeout)
      Sets the timeout for a target.
      Parameters:
      timeout - timeout in milliseconds before a confirmed request is resent or timed out.
    • getTimeout

      long getTimeout()
      Gets the timeout for a target.
      Returns:
      the timeout in milliseconds.
    • getMaxSizeRequestPDU

      int getMaxSizeRequestPDU()
      Gets the maximum size of request PDUs that this target is able to respond to. The default is 65535.
      Returns:
      the maximum PDU size of request PDUs for this target. Which is always greater than 484.
    • setMaxSizeRequestPDU

      void setMaxSizeRequestPDU(int maxSizeRequestPDU)
      Sets the maximum size of request PDUs that this target is able to receive.
      Parameters:
      maxSizeRequestPDU - the maximum PDU (SNMP message) size this session will be able to process.
    • getPreferredTransports

      List<TransportMapping<? super A>> getPreferredTransports()
      Gets the prioritised list of transport mappings to be used for this target. The first mapping in the list that matches the target address is chosen for sending new requests.
      Returns:
      an ordered list of TransportMapping instances.
      Since:
      2.0
    • clone

      Object clone()
    • duplicate

      Target<A> duplicate()
      Creates a new copy of this target with the same address type.
      Returns:
      a copy of this target with the same address type.
      Since:
      3.2.0
    • getSecurityModel

      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

      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

      int getSecurityLevel()
      Gets the security level associated with this target.
      Returns:
      one of
    • setSecurityLevel

      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

      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

      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: