Module org.snmp4j

Class TransportStateEvent

java.lang.Object
java.util.EventObject
org.snmp4j.transport.TransportStateEvent
All Implemented Interfaces:
Serializable

public class TransportStateEvent extends EventObject
The TransportStateEvent describes a state change for a transport connection. Optionally, connection establishment can be cancelled.
Since:
1.7
Version:
2.4
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • STATE_UNKNOWN

      public static final int STATE_UNKNOWN
      See Also:
    • STATE_CONNECTED

      public static final int STATE_CONNECTED
      See Also:
    • STATE_DISCONNECTED_REMOTELY

      public static final int STATE_DISCONNECTED_REMOTELY
      See Also:
    • STATE_DISCONNECTED_TIMEOUT

      public static final int STATE_DISCONNECTED_TIMEOUT
      See Also:
    • STATE_CLOSED

      public static final int STATE_CLOSED
      See Also:
    • newState

      private int newState
    • peerAddress

      private Address peerAddress
    • causingException

      private IOException causingException
    • discardedMessages

      private ArrayList<byte[]> discardedMessages
    • cancelled

      private boolean cancelled
  • Constructor Details

  • Method Details

    • getCausingException

      public IOException getCausingException()
    • getNewState

      public int getNewState()
    • getPeerAddress

      public Address getPeerAddress()
    • getDiscardedMessages

      public List<byte[]> getDiscardedMessages()
      Gets the messages that were discarded due to a state change of the transport connection.
      Returns:
      a (possibly empty) list of messages that were discarded or null if the event has not terminated the transport connection.
      Since:
      2.4.0
    • isCancelled

      public boolean isCancelled()
      Indicates whether this event has been canceled. Only STATE_CONNECTED events can be canceled.
      Returns:
      true if the event has been canceled.
      Since:
      1.8
    • toString

      public String toString()
      Overrides:
      toString in class EventObject
    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets the canceled state of the transport event. Only STATE_CONNECTED events can be canceled.
      Parameters:
      cancelled - true if the event should be canceled, i.e. a connection attempt should be rejected.
      Since:
      1.8