Package org.snmp4j.transport
Class TransportStateEvent
java.lang.Object
java.util.EventObject
org.snmp4j.transport.TransportStateEvent
- All Implemented Interfaces:
 Serializable
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:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class java.util.EventObject
source - 
Constructor Summary
ConstructorsConstructorDescriptionTransportStateEvent(TcpTransportMapping source, Address peerAddress, int newState, IOException causingException) TransportStateEvent(TcpTransportMapping source, Address peerAddress, int newState, IOException causingException, List<byte[]> discardedMessages)  - 
Method Summary
Modifier and TypeMethodDescriptionList<byte[]>Gets the messages that were discarded due to a state change of the transport connection.intbooleanIndicates whether this event has been canceled.voidsetCancelled(boolean cancelled) Sets the canceled state of the transport event.toString()Methods inherited from class java.util.EventObject
getSource 
- 
Field Details
- 
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:
 
 
 - 
 - 
Constructor Details
- 
TransportStateEvent
public TransportStateEvent(TcpTransportMapping source, Address peerAddress, int newState, IOException causingException)  - 
TransportStateEvent
public TransportStateEvent(TcpTransportMapping source, Address peerAddress, int newState, IOException causingException, List<byte[]> discardedMessages)  
 - 
 - 
Method Details
- 
getCausingException
 - 
getNewState
public int getNewState() - 
getPeerAddress
 - 
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 
nullif the event has not terminated the transport connection. - Since:
 - 2.4.0
 
 - 
isCancelled
public boolean isCancelled()Indicates whether this event has been canceled. OnlySTATE_CONNECTEDevents can be canceled.- Returns:
 trueif the event has been canceled.- Since:
 - 1.8
 
 - 
toString
- Overrides:
 toStringin classEventObject
 - 
setCancelled
public void setCancelled(boolean cancelled) Sets the canceled state of the transport event. OnlySTATE_CONNECTEDevents can be canceled.- Parameters:
 cancelled-trueif the event should be canceled, i.e. a connection attempt should be rejected.- Since:
 - 1.8
 
 
 -