Package weka.gui.sql.event
Class ConnectionEvent
- java.lang.Object
-
- java.util.EventObject
-
- weka.gui.sql.event.ConnectionEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class ConnectionEvent extends java.util.EventObject
An event that is generated when a connection is established or dropped.- Version:
- $Revision: 1.2 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
ConnectionListener
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
CONNECT
it was a connect trystatic int
DISCONNECT
it was a disconnect
-
Constructor Summary
Constructors Constructor Description ConnectionEvent(java.lang.Object source, int type, DbUtils utils)
constructs the eventConnectionEvent(java.lang.Object source, int type, DbUtils utils, java.lang.Exception ex)
constructs the event
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
failed()
whether an exception happened and is storedDbUtils
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 DISCONNECTboolean
isConnected()
returns whether the connection is still open.java.lang.String
toString()
returns the event in a string representation
-
-
-
Field Detail
-
CONNECT
public static final int CONNECT
it was a connect try- See Also:
- Constant Field Values
-
DISCONNECT
public static final int DISCONNECT
it was a disconnect- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConnectionEvent
public ConnectionEvent(java.lang.Object source, int type, DbUtils utils)
constructs the event- Parameters:
source
- the source that generated this eventtype
- whether CONNECT or DISCONNECT happenedutils
- the DatabaseUtils isntance responsible for the connection
-
ConnectionEvent
public ConnectionEvent(java.lang.Object source, int type, DbUtils utils, java.lang.Exception ex)
constructs the event- Parameters:
source
- the source that generated this eventtype
- whether CONNECT or DISCONNECT happenedutils
- the DatabaseUtils isntance responsible for the connectionex
- a possible exception, if not successful
-
-
Method Detail
-
getType
public int getType()
returns the type of this event, CONNECT or DISCONNECT- Returns:
- the type of this event
- See Also:
CONNECT
,DISCONNECT
-
failed
public boolean failed()
whether an exception happened and is stored- Returns:
- whether an exception happened
-
isConnected
public boolean isConnected()
returns whether the connection is still open.- Returns:
- whether the connection is still open
-
getException
public java.lang.Exception getException()
returns the stored exception, if any (can be NULL)
-
getDbUtils
public DbUtils getDbUtils()
returns the DbUtils instance that is responsible for the connect/disconnect.- Returns:
- the responsible DbUtils instance
-
toString
public java.lang.String toString()
returns the event in a string representation- Overrides:
toString
in classjava.util.EventObject
- Returns:
- the event in a string representation
-
-