public class TransportStateEvent
extends java.util.EventObject
TransportStateEvent
describes a state change for
a transport connection. Optionally, connection establishment can be
cancelled.Modifier and Type | Field | Description |
---|---|---|
static int |
STATE_CLOSED |
|
static int |
STATE_CONNECTED |
|
static int |
STATE_DISCONNECTED_REMOTELY |
|
static int |
STATE_DISCONNECTED_TIMEOUT |
|
static int |
STATE_UNKNOWN |
Constructor | Description |
---|---|
TransportStateEvent(AbstractTransportMapping source,
Address peerAddress,
int newState,
java.io.IOException causingException) |
|
TransportStateEvent(AbstractTransportMapping source,
Address peerAddress,
int newState,
java.io.IOException causingException,
java.util.List<byte[]> discardedMessages) |
Modifier and Type | Method | Description |
---|---|---|
java.io.IOException |
getCausingException() |
|
java.util.List<byte[]> |
getDiscardedMessages() |
Gets the messages that were discarded due to a state change of the transport connection.
|
int |
getNewState() |
|
Address |
getPeerAddress() |
|
boolean |
isCancelled() |
Indicates whether this event has been canceled.
|
void |
setCancelled(boolean cancelled) |
Sets the canceled state of the transport event.
|
java.lang.String |
toString() |
public static final int STATE_UNKNOWN
public static final int STATE_CONNECTED
public static final int STATE_DISCONNECTED_REMOTELY
public static final int STATE_DISCONNECTED_TIMEOUT
public static final int STATE_CLOSED
public TransportStateEvent(AbstractTransportMapping source, Address peerAddress, int newState, java.io.IOException causingException)
public TransportStateEvent(AbstractTransportMapping source, Address peerAddress, int newState, java.io.IOException causingException, java.util.List<byte[]> discardedMessages)
public java.io.IOException getCausingException()
public int getNewState()
public Address getPeerAddress()
public java.util.List<byte[]> getDiscardedMessages()
null
if the event has not terminated
the transport connection.public boolean isCancelled()
STATE_CONNECTED
events can be canceled.true
if the event has been canceled.public java.lang.String toString()
toString
in class java.util.EventObject
public void setCancelled(boolean cancelled)
STATE_CONNECTED
events can be canceled.cancelled
- true
if the event should be canceled, i.e. a connection
attempt should be rejected.Copyright © 2018 SNMP4J.org. All rights reserved.