public class ConnectionEvent
extends java.util.EventObject
ConnectionListener
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
CONNECT
it was a connect try
|
static int |
DISCONNECT
it was a disconnect
|
Constructor and Description |
---|
ConnectionEvent(java.lang.Object source,
int type,
DbUtils utils)
constructs the event
|
ConnectionEvent(java.lang.Object source,
int type,
DbUtils utils,
java.lang.Exception ex)
constructs the event
|
Modifier and Type | Method and Description |
---|---|
boolean |
failed()
whether an exception happened and is stored
|
DbUtils |
getDbUtils()
returns the DbUtils instance that is responsible for the
connect/disconnect.
|
java.lang.Exception |
getException()
returns the stored exception, if any (can be NULL)
|
int |
getType()
returns the type of this event, CONNECT or DISCONNECT
|
boolean |
isConnected()
returns whether the connection is still open.
|
java.lang.String |
toString()
returns the event in a string representation
|
public static final int CONNECT
public static final int DISCONNECT
public ConnectionEvent(java.lang.Object source, int type, DbUtils utils)
source
- the source that generated this eventtype
- whether CONNECT or DISCONNECT happenedutils
- the DatabaseUtils isntance responsible for the
connectionpublic ConnectionEvent(java.lang.Object source, int type, DbUtils utils, java.lang.Exception ex)
source
- the source that generated this eventtype
- whether CONNECT or DISCONNECT happenedutils
- the DatabaseUtils isntance responsible for the
connectionex
- a possible exception, if not successfulpublic int getType()
CONNECT
,
DISCONNECT
public boolean failed()
public boolean isConnected()
public java.lang.Exception getException()
public DbUtils getDbUtils()
public java.lang.String toString()
toString
in class java.util.EventObject