org.snmp4j.transport
Class TransportStateEvent

java.lang.Object
  extended by java.util.EventObject
      extended by 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

Field Summary
static int STATE_CLOSED
           
static int STATE_CONNECTED
           
static int STATE_DISCONNECTED_REMOTELY
           
static int STATE_DISCONNECTED_TIMEOUT
           
static int STATE_UNKNOWN
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
TransportStateEvent(java.lang.Object source, Address peerAddress, int newState, java.io.IOException causingException)
           
 
Method Summary
 java.io.IOException getCausingException()
           
 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()
           
 
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
 

Field Detail

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
Constructor Detail

TransportStateEvent

public TransportStateEvent(java.lang.Object source,
                           Address peerAddress,
                           int newState,
                           java.io.IOException causingException)
Method Detail

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 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.