Module org.snmp4j

Class TransportStateEvent

  • All Implemented Interfaces:
    java.io.Serializable

    public class TransportStateEvent
    extends java.util.EventObject
    The TransportStateEvent describes a state change for a transport connection. Optionally, connection establishment can be cancelled.
    Since:
    1.7
    Version:
    2.4
    Author:
    Frank Fock
    See Also:
    Serialized Form
    • Constructor Detail

      • TransportStateEvent

        public TransportStateEvent​(AbstractTransportMapping<?> source,
                                   Address peerAddress,
                                   int newState,
                                   java.io.IOException causingException)
      • TransportStateEvent

        public TransportStateEvent​(AbstractTransportMapping<?> source,
                                   Address peerAddress,
                                   int newState,
                                   java.io.IOException causingException,
                                   java.util.List<byte[]> discardedMessages)
    • Method Detail

      • getCausingException

        public java.io.IOException getCausingException()
      • getNewState

        public int getNewState()
      • getPeerAddress

        public Address getPeerAddress()
      • getDiscardedMessages

        public java.util.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 java.lang.String toString()
        Overrides:
        toString in class java.util.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