org.snmp4j.transport
Class TransportStateEvent
java.lang.Object
java.util.EventObject
org.snmp4j.transport.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:
- 1.8
- Author:
- Frank Fock
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
TransportStateEvent(java.lang.Object source,
Address peerAddress,
int newState,
java.io.IOException causingException)
|
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
STATE_UNKNOWN
public static final int STATE_UNKNOWN
- See Also:
- Constant Field Values
STATE_CONNECTED
public static final int STATE_CONNECTED
- See Also:
- Constant Field Values
STATE_DISCONNECTED_REMOTELY
public static final int STATE_DISCONNECTED_REMOTELY
- See Also:
- Constant Field Values
STATE_DISCONNECTED_TIMEOUT
public static final int STATE_DISCONNECTED_TIMEOUT
- See Also:
- Constant Field Values
STATE_CLOSED
public static final int STATE_CLOSED
- See Also:
- Constant Field Values
TransportStateEvent
public TransportStateEvent(java.lang.Object source,
Address peerAddress,
int newState,
java.io.IOException causingException)
getCausingException
public java.io.IOException getCausingException()
getNewState
public int getNewState()
getPeerAddress
public Address getPeerAddress()
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
Copyright © 2011 SNMP4J.org. All Rights Reserved.