net.sourceforge.jdbcimporter.event
Class ImportEntityRowEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bynet.sourceforge.jdbcimporter.event.ImportEntityRowEvent
All Implemented Interfaces:
java.io.Serializable

public class ImportEntityRowEvent
extends java.util.EventObject

The ImportEntityRowEvent describes the state of a row being imported.

Version:
0.6
Author:
Chris Nagy
See Also:
Serialized Form

Field Summary
static int STATE_BATCH
          Constant that indicates the rows was processed successfully but hasn't been imported.
static int STATE_ERROR
          Constant that indicates there was an error processing the row.
static int STATE_SUCCESS
          Constant that indicates the row was imported successfully.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ImportEntityRowEvent(java.lang.Object source, ImportEntityDef entityDef, java.lang.String line, ColumnValue[] values, int state, java.lang.Exception ex)
          Constructs an ImportEntityRowEvent
 
Method Summary
 java.lang.String getCatalog()
          Returns the catalog that the entity belongs to.
 java.lang.Exception getException()
          Returns the exception that prevented the row from being imported.
 java.lang.String getRow()
          Returns the line representing the row.
 java.lang.String getSchema()
          Returns the schema that the entity belongs to.
 int getState()
          Returns the state of the import of the row.
 java.lang.String getTable()
          Returns the table name.
 ColumnValue[] getValues()
          Returns the column values of the row.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_ERROR

public static int STATE_ERROR
Constant that indicates there was an error processing the row.


STATE_SUCCESS

public static int STATE_SUCCESS
Constant that indicates the row was imported successfully.


STATE_BATCH

public static int STATE_BATCH
Constant that indicates the rows was processed successfully but hasn't been imported. The row will be imported when executeBatch is called and ImportListener.batchProcessed method is called.

Constructor Detail

ImportEntityRowEvent

public ImportEntityRowEvent(java.lang.Object source,
                            ImportEntityDef entityDef,
                            java.lang.String line,
                            ColumnValue[] values,
                            int state,
                            java.lang.Exception ex)
Constructs an ImportEntityRowEvent

Parameters:
source - the source of the event
entityDef - the configuration of the entity
line - the line representing the row
values - the column values of the row
state - the state of row's import
ex - the exception that prevented the row from being imported.
Method Detail

getTable

public java.lang.String getTable()
Returns the table name.

Returns:
the table name

getSchema

public java.lang.String getSchema()
Returns the schema that the entity belongs to.

Returns:
the schema name

getCatalog

public java.lang.String getCatalog()
Returns the catalog that the entity belongs to.

Returns:
the catalog name

getRow

public java.lang.String getRow()
Returns the line representing the row.

Returns:
the line

getState

public int getState()
Returns the state of the import of the row. The state will be one of : STATE_ERROR, STATE_SUCCESS, STATE_BATCH.

Returns:
the state

getValues

public ColumnValue[] getValues()
Returns the column values of the row.

Returns:
the column values

getException

public java.lang.Exception getException()
Returns the exception that prevented the row from being imported. The exception is only set when the state = STATE_ERROR.

Returns:
the exception