org.webdocwf.util.loader
Class DataCleaning

java.lang.Object
  extended byorg.webdocwf.util.loader.DataCleaning

public class DataCleaning
extends java.lang.Object

DataCleaning class contain method for executing data cleaning process

Version:
1.0
Author:
Radoslav Dutina

Constructor Summary
DataCleaning(ConfigReader configReader)
          Constructor of DataCleaning class, without parameters.
 
Method Summary
 void cleaningColumnValues(java.lang.String tableName, java.lang.String columnName, java.lang.String replacement, int rowNumber, java.sql.Connection conn, java.lang.String typeOfInsert, java.lang.String importDefinitionName)
          This method write message in to log table if some data in sql statements has value
 void cleaningInsert(java.lang.String tableName, java.sql.Connection conn, int rowNumber, java.lang.String typeOfInsert, java.lang.String msg, java.lang.String importDefinitionName, java.lang.String logFailedStatement)
          This method write message in to log table if insert/update fails
 java.lang.String cleaningRelationValues(java.lang.String tableName, java.lang.String columnName, java.lang.String replacement, java.lang.String dataType, int rowNumber, java.sql.Connection conn, java.lang.String typeOfInsert, int currentVersion, boolean oid, java.lang.String importDefinitionName, java.lang.String versionColumnName, java.lang.String logFailedStatement)
          This method write message in to log table if relations between table faild to insert/update
 void cutingDataLenght(java.lang.String tableName, java.sql.Connection conn, java.lang.String strQuery, int rowNumber, java.lang.String onErrorContinue, java.lang.String msg, java.lang.String importDefinitionName, java.lang.String logFailedStatement)
          This method write message in to log table if some data must be truncated
 void cutingDataLenghtUpdate(java.lang.String tableName, java.sql.Connection conn, java.lang.String strQuery, int rowNumber, java.lang.String update, java.lang.String onErrorContinue, java.lang.String importDefinitionName, java.lang.String logFailedStatement)
          This method write message in to log table if some data must be truncated
 java.lang.String getLogColumnName()
          This method read value from parameter logColumnName
 java.lang.String getLogFailedStatement()
          This method returns value of primary key for column which data wasn't succesufuly loaded
 java.lang.String getLogImportDefinitionName()
          This method read value from parameter logImportDefinitionName
 java.lang.String getLogNewValue()
          This method read value from parameter logNewValue
 java.lang.String getLogOperationName()
          This method read value from parameter logImportDefinitionName
 java.lang.String getLogOriginalValue()
          This method read value from parameter logOriginalValue
 java.lang.String getLogRowNumber()
          This method read value from parameter logRowNumber
 java.lang.String getLogTable()
          This method read value from parameter logTable
 java.lang.String getLogTableName()
          This method read value from parameter logTableName
 java.lang.String getLogTime()
          This method returns time when log was occured
 java.lang.String getLogTypeName()
          This method read value from parameter logTypeName
 void setLogColumnName(java.lang.String logColumnName)
          This method set the value of parameter logColumnName
 void setLogger(Logger logger)
          Set Logger object
 void setLogImportDefinitionName(java.lang.String logImportDefinitionName)
          This method set the value of parameter logImportDefinitionName
 void setLogNewValue(java.lang.String logNewValue)
          This method set the value of parameter logNewValue
 void setLogOperationName(java.lang.String logOperationName)
          This method set the value of parameter logOperationName
 void setLogOriginalValue(java.lang.String logOriginalValue)
          This method set the value of parameter logOriginalValue
 void setLogPrimaryKeyValue(java.lang.String string)
          This method set value of primary key for column which data wasn't succesufuly loaded
 void setLogRowNumber(java.lang.String logRowNumber)
          This method set the value of parameter logRowNumber
 void setLogTable(java.lang.String logTable)
          This method set the value of parameter logTable
 void setLogTableName(java.lang.String logTableName)
          This method set the value of parameter logTableName
 void setLogTime(java.lang.String string)
          This method set time when log was occured
 void setLogTypeName(java.lang.String logTypeName)
          This method set the value of parameter logTypeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataCleaning

public DataCleaning(ConfigReader configReader)
Constructor of DataCleaning class, without parameters.

Method Detail

setLogTableName

public void setLogTableName(java.lang.String logTableName)
This method set the value of parameter logTableName

Parameters:
logTableName - is value of parameter

setLogTable

public void setLogTable(java.lang.String logTable)
This method set the value of parameter logTable

Parameters:
logTable - is value of parameter

setLogColumnName

public void setLogColumnName(java.lang.String logColumnName)
This method set the value of parameter logColumnName

Parameters:
logColumnName - is value of parmeter

setLogRowNumber

public void setLogRowNumber(java.lang.String logRowNumber)
This method set the value of parameter logRowNumber

Parameters:
logRowNumber - is value of parameter

setLogOriginalValue

public void setLogOriginalValue(java.lang.String logOriginalValue)
This method set the value of parameter logOriginalValue

Parameters:
logOriginalValue - is value of parameter

setLogNewValue

public void setLogNewValue(java.lang.String logNewValue)
This method set the value of parameter logNewValue

Parameters:
logNewValue - is value of parameter

setLogImportDefinitionName

public void setLogImportDefinitionName(java.lang.String logImportDefinitionName)
This method set the value of parameter logImportDefinitionName

Parameters:
logImportDefinitionName - is value of parameter

setLogOperationName

public void setLogOperationName(java.lang.String logOperationName)
This method set the value of parameter logOperationName

Parameters:
logOperationName - is value of parameter

setLogTypeName

public void setLogTypeName(java.lang.String logTypeName)
This method set the value of parameter logTypeName

Parameters:
logTypeName - is value of parameter

getLogTableName

public java.lang.String getLogTableName()
This method read value from parameter logTableName

Returns:
value of parameter

getLogTable

public java.lang.String getLogTable()
This method read value from parameter logTable

Returns:
value of parameter

getLogColumnName

public java.lang.String getLogColumnName()
This method read value from parameter logColumnName

Returns:
value of parameter

getLogRowNumber

public java.lang.String getLogRowNumber()
This method read value from parameter logRowNumber

Returns:
value of parameter

getLogOriginalValue

public java.lang.String getLogOriginalValue()
This method read value from parameter logOriginalValue

Returns:
value of parameter

getLogNewValue

public java.lang.String getLogNewValue()
This method read value from parameter logNewValue

Returns:
value of parameter

getLogImportDefinitionName

public java.lang.String getLogImportDefinitionName()
This method read value from parameter logImportDefinitionName

Returns:
value of parameter

getLogOperationName

public java.lang.String getLogOperationName()
This method read value from parameter logImportDefinitionName

Returns:
value of parameter

getLogTypeName

public java.lang.String getLogTypeName()
This method read value from parameter logTypeName

Returns:
value of parameter

cleaningInsert

public void cleaningInsert(java.lang.String tableName,
                           java.sql.Connection conn,
                           int rowNumber,
                           java.lang.String typeOfInsert,
                           java.lang.String msg,
                           java.lang.String importDefinitionName,
                           java.lang.String logFailedStatement)
This method write message in to log table if insert/update fails

Parameters:
tableName - is name of the table which is in the process
conn - is connection to target database (table)
rowNumber - is current row number
typeOfInsert - is the parameter which may be 'insert' or 'update'
msg - is error message
importDefinitionName - is name of the import definition job

cleaningColumnValues

public void cleaningColumnValues(java.lang.String tableName,
                                 java.lang.String columnName,
                                 java.lang.String replacement,
                                 int rowNumber,
                                 java.sql.Connection conn,
                                 java.lang.String typeOfInsert,
                                 java.lang.String importDefinitionName)
This method write message in to log table if some data in sql statements has value

Parameters:
tableName - is name of the table which is in the process
columnName - is the name of column in current table
replacement - is new value of data
rowNumber - is current row number
conn - is connection to target database (table)
typeOfInsert - is the parameter which may be 'insert' or 'update'
importDefinitionName - is name of the import definition job

cleaningRelationValues

public java.lang.String cleaningRelationValues(java.lang.String tableName,
                                               java.lang.String columnName,
                                               java.lang.String replacement,
                                               java.lang.String dataType,
                                               int rowNumber,
                                               java.sql.Connection conn,
                                               java.lang.String typeOfInsert,
                                               int currentVersion,
                                               boolean oid,
                                               java.lang.String importDefinitionName,
                                               java.lang.String versionColumnName,
                                               java.lang.String logFailedStatement)
                                        throws LoaderException
This method write message in to log table if relations between table faild to insert/update

Parameters:
tableName - is name of the table which is in the process
columnName - is the name of column in current table
replacement - is new value of data
dataType - is type of relation column
rowNumber - is current row number
conn - is connection to target database (table)
typeOfInsert - represents type of operation (insert or update)
currentVersion - represents update version
oid - define if the oid logic is present
importDefinitionName - is name of the import definition job
Returns:
value of parameter
Throws:
LoaderException

cutingDataLenghtUpdate

public void cutingDataLenghtUpdate(java.lang.String tableName,
                                   java.sql.Connection conn,
                                   java.lang.String strQuery,
                                   int rowNumber,
                                   java.lang.String update,
                                   java.lang.String onErrorContinue,
                                   java.lang.String importDefinitionName,
                                   java.lang.String logFailedStatement)
                            throws java.sql.SQLException,
                                   LoaderException
This method write message in to log table if some data must be truncated

Parameters:
tableName - is name of the table which is in the process
conn - is connection to target database (table)
strQuery - is string representing sql statement
rowNumber - is current row number
update - is the parameter which may be 'insert' or 'update'
onErrorContinue - is value of onErrorContinue attribute
importDefinitionName - is name of the import definition job
Throws:
java.sql.SQLException
LoaderException

cutingDataLenght

public void cutingDataLenght(java.lang.String tableName,
                             java.sql.Connection conn,
                             java.lang.String strQuery,
                             int rowNumber,
                             java.lang.String onErrorContinue,
                             java.lang.String msg,
                             java.lang.String importDefinitionName,
                             java.lang.String logFailedStatement)
                      throws java.sql.SQLException
This method write message in to log table if some data must be truncated

Parameters:
tableName - is name of the table which is in the process
conn - is connection to target database (table)
strQuery - is string represented sql statement
rowNumber - is current row number
onErrorContinue - represents onErrorContinue tag
msg - represents error message
importDefinitionName - is name of the import definition job
Throws:
java.sql.SQLException

setLogger

public void setLogger(Logger logger)
Set Logger object

Parameters:
logger - Logger object which is used for log file

setLogPrimaryKeyValue

public void setLogPrimaryKeyValue(java.lang.String string)
This method set value of primary key for column which data wasn't succesufuly loaded


setLogTime

public void setLogTime(java.lang.String string)
This method set time when log was occured


getLogFailedStatement

public java.lang.String getLogFailedStatement()
This method returns value of primary key for column which data wasn't succesufuly loaded

Returns:
String value which is value of primary key for column

getLogTime

public java.lang.String getLogTime()
This method returns time when log was occured

Returns:
String value which is time when log is inserted in table


Copyright © 2002-2007 Together - the Workgroup. All Rights Reserved.