Module org.snmp4j
Package org.snmp4j

Interface Target<A extends Address>

  • All Superinterfaces:
    java.lang.Cloneable, java.io.Serializable
    All Known Implementing Classes:
    AbstractTarget, CertifiedTarget, CommunityTarget, SecureTarget, UserTarget

    public interface Target<A extends Address>
    extends java.io.Serializable, java.lang.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 Detail

      • 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.
      • 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

        java.util.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

        java.lang.Object clone()
      • 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).
      • 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:
        getSecurityName()