Package weka.gui.sql.event
Class ConnectionEvent
java.lang.Object
java.util.EventObject
weka.gui.sql.event.ConnectionEvent
- All Implemented Interfaces:
Serializable
An event that is generated when a connection is established or dropped.
- Version:
- $Revision: 8034 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
it was a connect trystatic final int
it was a disconnect -
Constructor Summary
ConstructorDescriptionConnectionEvent
(Object source, int type, DbUtils utils) constructs the eventConnectionEvent
(Object source, int type, DbUtils utils, Exception ex) constructs the event -
Method Summary
Modifier and TypeMethodDescriptionboolean
failed()
whether an exception happened and is storedreturns the DbUtils instance that is responsible for the connect/disconnect.returns the stored exception, if any (can be NULL)int
getType()
returns the type of this event, CONNECT or DISCONNECTboolean
returns whether the connection is still open.toString()
returns the event in a string representationMethods inherited from class java.util.EventObject
getSource
-
Field Details
-
CONNECT
public static final int CONNECTit was a connect try- See Also:
-
DISCONNECT
public static final int DISCONNECTit was a disconnect- See Also:
-
-
Constructor Details
-
ConnectionEvent
constructs the event- Parameters:
source
- the source that generated this eventtype
- whether CONNECT or DISCONNECT happenedutils
- the DatabaseUtils isntance responsible for the connection
-
ConnectionEvent
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 Details
-
getType
public int getType()returns the type of this event, CONNECT or DISCONNECT- Returns:
- the type of this event
- See Also:
-
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
returns the stored exception, if any (can be NULL) -
getDbUtils
returns the DbUtils instance that is responsible for the connect/disconnect.- Returns:
- the responsible DbUtils instance
-
toString
returns the event in a string representation- Overrides:
toString
in classEventObject
- Returns:
- the event in a string representation
-