goldengate.ftp.exec.database.data
Class DbTransferLog

java.lang.Object
  extended by goldengate.common.database.data.AbstractDbData
      extended by goldengate.ftp.exec.database.data.DbTransferLog

public class DbTransferLog
extends goldengate.common.database.data.AbstractDbData

Transfer Log for FtpExec

Author:
Frederic Bregier

Nested Class Summary
static class DbTransferLog.Columns
           
 
Nested classes/interfaces inherited from class goldengate.common.database.data.AbstractDbData
goldengate.common.database.data.AbstractDbData.UpdatedInfo
 
Field Summary
static int[] dbTypes
           
static String fieldseq
           
static DbTransferLog.Columns[] indexes
           
protected static String insertAllValues
           
static int NBPRKEY
          Special For DbTransferLog
protected static String selectAllFields
           
static String table
           
protected static String updateAllFields
           
static String XMLRUNNER
           
static String XMLRUNNERS
           
 
Fields inherited from class goldengate.common.database.data.AbstractDbData
allFields, dbSession, isSaved, otherFields, primaryKey
 
Constructor Summary
DbTransferLog(goldengate.common.database.DbSession dbSession, String user, String account, long specialId)
          Load from database
DbTransferLog(goldengate.common.database.DbSession dbSession, String user, String account, long specialId, boolean isSender, String filename, String mode, goldengate.common.command.ReplyCode infostatus, String info, goldengate.common.database.data.AbstractDbData.UpdatedInfo updatedInfo)
          Insert into database
 
Method Summary
 void changeUpdatedInfo(goldengate.common.database.data.AbstractDbData.UpdatedInfo info)
           
 void clear()
          Clear the runner
 void create()
          As insert but with the ability to change the SpecialId
 void delete()
           
static void finishSelectOrCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt)
          Set the current time in the given updatedPreparedStatement
static void finishSelectOrCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt, long time)
          Set the current time in the given updatedPreparedStatement
 String getAccount()
           
static goldengate.common.database.DbPreparedStatement getCountAllPrepareStatement(goldengate.common.database.DbSession session)
           
static goldengate.common.database.DbPreparedStatement getCountInfoPrepareStatement(goldengate.common.database.DbSession session)
           
static goldengate.common.database.DbPreparedStatement getCountInOutErrorPrepareStatement(goldengate.common.database.DbSession session, boolean in)
          Running or not transfers are concerned
static goldengate.common.database.DbPreparedStatement getCountInOutRunningPrepareStatement(goldengate.common.database.DbSession session, boolean in, boolean running)
          Running or not transfers are concerned
static goldengate.common.database.DbPreparedStatement getCountStatusPrepareStatement(goldengate.common.database.DbSession session)
           
 goldengate.common.command.ReplyCode getErrorInfo()
           
 String getFilename()
           
static DbTransferLog getFromStatement(goldengate.common.database.DbPreparedStatement preparedStatement)
          For instance when getting updated information
 String getInfotransf()
           
protected  String getInsertAllValues()
           
static goldengate.common.database.DbPreparedStatement getLogPrepareStament(goldengate.common.database.DbSession session, Timestamp start, Timestamp stop)
           
 String getMode()
           
static long getResultCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt)
           
static long getResultCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt, goldengate.common.database.data.AbstractDbData.UpdatedInfo info, long time)
           
static long getResultCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt, goldengate.common.command.ReplyCode error, long time)
           
protected  String getSelectAllFields()
           
 long getSpecialId()
           
 Timestamp getStart()
           
static goldengate.common.database.DbPreparedStatement getStatusPrepareStament(goldengate.common.database.DbSession session, goldengate.common.command.ReplyCode status, int limit)
           
 Timestamp getStop()
           
protected  String getTable()
           
protected  String getUpdateAllFields()
           
 goldengate.common.database.data.AbstractDbData.UpdatedInfo getUpdatedInfo()
           
 String getUser()
           
protected  String getWherePrimaryKey()
           
protected  void initObject()
           
 void insert()
           
 boolean isSender()
           
 String saveDbTransferLog(String filename)
          Save the current DbTransferLog to a file
static String saveDbTransferLogFile(goldengate.common.database.DbPreparedStatement preparedStatement, String filename)
          Export DbTransferLogs to a file and purge the corresponding DbTransferLogs
 void saveStatus()
          This method is to be called each time an operation is happening on Runner
 void setFilename(String filename)
           
protected  void setFromArray()
           
 void setInfotransf(String infotransf)
           
protected  void setPrimaryKey()
          Set the primary Key as current value
 void setReplyCodeExecutionStatus(goldengate.common.command.ReplyCode code)
          Set the ReplyCode for the UpdatedInfo
 void setStop(Timestamp stop)
           
protected  void setToArray()
           
 String toString()
           
 
Methods inherited from class goldengate.common.database.data.AbstractDbData
exist, get, getTrueValue, getValue, getValues, select, setTrueValue, setValue, setValues, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dbTypes

public static final int[] dbTypes

table

public static final String table
See Also:
Constant Field Values

fieldseq

public static final String fieldseq
See Also:
Constant Field Values

indexes

public static final DbTransferLog.Columns[] indexes

XMLRUNNERS

public static final String XMLRUNNERS
See Also:
Constant Field Values

XMLRUNNER

public static final String XMLRUNNER
See Also:
Constant Field Values

NBPRKEY

public static final int NBPRKEY
Special For DbTransferLog

See Also:
Constant Field Values

selectAllFields

protected static final String selectAllFields

updateAllFields

protected static final String updateAllFields

insertAllValues

protected static final String insertAllValues
See Also:
Constant Field Values
Constructor Detail

DbTransferLog

public DbTransferLog(goldengate.common.database.DbSession dbSession,
                     String user,
                     String account,
                     long specialId,
                     boolean isSender,
                     String filename,
                     String mode,
                     goldengate.common.command.ReplyCode infostatus,
                     String info,
                     goldengate.common.database.data.AbstractDbData.UpdatedInfo updatedInfo)
              throws goldengate.common.database.exception.GoldenGateDatabaseException
Insert into database

Parameters:
dbSession -
user -
account -
specialId -
isSender -
filename -
mode -
infostatus -
info -
updatedInfo -
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

DbTransferLog

public DbTransferLog(goldengate.common.database.DbSession dbSession,
                     String user,
                     String account,
                     long specialId)
              throws goldengate.common.database.exception.GoldenGateDatabaseException
Load from database

Parameters:
dbSession -
user -
account -
specialId -
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException
Method Detail

initObject

protected void initObject()
Specified by:
initObject in class goldengate.common.database.data.AbstractDbData

getSelectAllFields

protected String getSelectAllFields()
Specified by:
getSelectAllFields in class goldengate.common.database.data.AbstractDbData

getTable

protected String getTable()
Specified by:
getTable in class goldengate.common.database.data.AbstractDbData

getInsertAllValues

protected String getInsertAllValues()
Specified by:
getInsertAllValues in class goldengate.common.database.data.AbstractDbData

getUpdateAllFields

protected String getUpdateAllFields()
Specified by:
getUpdateAllFields in class goldengate.common.database.data.AbstractDbData

setToArray

protected void setToArray()
Specified by:
setToArray in class goldengate.common.database.data.AbstractDbData

setFromArray

protected void setFromArray()
                     throws goldengate.common.database.exception.GoldenGateDatabaseSqlException
Specified by:
setFromArray in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getWherePrimaryKey

protected String getWherePrimaryKey()
Specified by:
getWherePrimaryKey in class goldengate.common.database.data.AbstractDbData
Returns:
The Where condition on Primary Key

setPrimaryKey

protected void setPrimaryKey()
Set the primary Key as current value

Specified by:
setPrimaryKey in class goldengate.common.database.data.AbstractDbData

delete

public void delete()
            throws goldengate.common.database.exception.GoldenGateDatabaseException
Overrides:
delete in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

insert

public void insert()
            throws goldengate.common.database.exception.GoldenGateDatabaseException
Overrides:
insert in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

create

public void create()
            throws goldengate.common.database.exception.GoldenGateDatabaseException
As insert but with the ability to change the SpecialId

Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

getFromStatement

public static DbTransferLog getFromStatement(goldengate.common.database.DbPreparedStatement preparedStatement)
                                      throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                             goldengate.common.database.exception.GoldenGateDatabaseSqlException
For instance when getting updated information

Parameters:
preparedStatement -
Returns:
the next updated DbTaskRunner
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getStatusPrepareStament

public static goldengate.common.database.DbPreparedStatement getStatusPrepareStament(goldengate.common.database.DbSession session,
                                                                                     goldengate.common.command.ReplyCode status,
                                                                                     int limit)
                                                                              throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                     goldengate.common.database.exception.GoldenGateDatabaseSqlException
Parameters:
session -
status -
limit - limit the number of rows
Returns:
the DbPreparedStatement for getting TransferLog according to status ordered by start
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getLogPrepareStament

public static goldengate.common.database.DbPreparedStatement getLogPrepareStament(goldengate.common.database.DbSession session,
                                                                                  Timestamp start,
                                                                                  Timestamp stop)
                                                                           throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                  goldengate.common.database.exception.GoldenGateDatabaseSqlException
Parameters:
session -
start -
stop -
Returns:
the DbPreparedStatement for getting Selected Object, whatever their status
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getCountInfoPrepareStatement

public static goldengate.common.database.DbPreparedStatement getCountInfoPrepareStatement(goldengate.common.database.DbSession session)
                                                                                   throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                          goldengate.common.database.exception.GoldenGateDatabaseSqlException
Parameters:
session -
Returns:
the DbPreparedStatement for getting Updated Object
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getResultCountPrepareStatement

public static long getResultCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt,
                                                  goldengate.common.database.data.AbstractDbData.UpdatedInfo info,
                                                  long time)
Parameters:
pstt -
info -
time -
Returns:
the number of elements (COUNT) from the statement

getCountStatusPrepareStatement

public static goldengate.common.database.DbPreparedStatement getCountStatusPrepareStatement(goldengate.common.database.DbSession session)
                                                                                     throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                            goldengate.common.database.exception.GoldenGateDatabaseSqlException
Parameters:
session -
Returns:
the DbPreparedStatement for getting Runner according to status ordered by start
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getCountAllPrepareStatement

public static goldengate.common.database.DbPreparedStatement getCountAllPrepareStatement(goldengate.common.database.DbSession session)
                                                                                  throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                         goldengate.common.database.exception.GoldenGateDatabaseSqlException
Parameters:
session -
Returns:
the DbPreparedStatement for getting All according to status ordered by start
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getResultCountPrepareStatement

public static long getResultCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt,
                                                  goldengate.common.command.ReplyCode error,
                                                  long time)
Parameters:
pstt -
error -
time -
Returns:
the number of elements (COUNT) from the statement

getResultCountPrepareStatement

public static long getResultCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt)
Parameters:
pstt -
Returns:
the number of elements (COUNT) from the statement

finishSelectOrCountPrepareStatement

public static void finishSelectOrCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt)
                                                throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                       goldengate.common.database.exception.GoldenGateDatabaseSqlException
Set the current time in the given updatedPreparedStatement

Parameters:
pstt -
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

finishSelectOrCountPrepareStatement

public static void finishSelectOrCountPrepareStatement(goldengate.common.database.DbPreparedStatement pstt,
                                                       long time)
                                                throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                       goldengate.common.database.exception.GoldenGateDatabaseSqlException
Set the current time in the given updatedPreparedStatement

Parameters:
pstt -
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getCountInOutErrorPrepareStatement

public static goldengate.common.database.DbPreparedStatement getCountInOutErrorPrepareStatement(goldengate.common.database.DbSession session,
                                                                                                boolean in)
                                                                                         throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                                goldengate.common.database.exception.GoldenGateDatabaseSqlException
Running or not transfers are concerned

Parameters:
session -
in - True for Incoming, False for Outgoing
Returns:
the DbPreparedStatement for getting Runner according to in or out going way and Error
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getCountInOutRunningPrepareStatement

public static goldengate.common.database.DbPreparedStatement getCountInOutRunningPrepareStatement(goldengate.common.database.DbSession session,
                                                                                                  boolean in,
                                                                                                  boolean running)
                                                                                           throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                                  goldengate.common.database.exception.GoldenGateDatabaseSqlException
Running or not transfers are concerned

Parameters:
session -
in - True for Incoming, False for Outgoing
running - True for Running only, False for all
Returns:
the DbPreparedStatement for getting Runner according to in or out going way
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

changeUpdatedInfo

public void changeUpdatedInfo(goldengate.common.database.data.AbstractDbData.UpdatedInfo info)
Specified by:
changeUpdatedInfo in class goldengate.common.database.data.AbstractDbData

setReplyCodeExecutionStatus

public void setReplyCodeExecutionStatus(goldengate.common.command.ReplyCode code)
Set the ReplyCode for the UpdatedInfo

Parameters:
code -

getUpdatedInfo

public goldengate.common.database.data.AbstractDbData.UpdatedInfo getUpdatedInfo()
Returns:
The current UpdatedInfo value

getErrorInfo

public goldengate.common.command.ReplyCode getErrorInfo()
Returns:
the ReplyCode code associated with the Updated Info

setFilename

public void setFilename(String filename)
Parameters:
filename - the filename to set

isSender

public boolean isSender()
Returns:
the isSender

getFilename

public String getFilename()
Returns:
the filename

getSpecialId

public long getSpecialId()
Returns:
the specialId

getInfotransf

public String getInfotransf()
Returns:
the infotransf

setInfotransf

public void setInfotransf(String infotransf)
Parameters:
infotransf - the infotransf to set

getUser

public String getUser()
Returns:
the user

getAccount

public String getAccount()
Returns:
the account

setStop

public void setStop(Timestamp stop)
Parameters:
stop - the stop to set

getMode

public String getMode()
Returns:
the mode

saveStatus

public void saveStatus()
                throws goldengate.common.database.exception.GoldenGateDatabaseException
This method is to be called each time an operation is happening on Runner

Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

clear

public void clear()
Clear the runner


toString

public String toString()
Overrides:
toString in class Object

getStart

public Timestamp getStart()
Returns:
the start

getStop

public Timestamp getStop()
Returns:
the stop

saveDbTransferLog

public String saveDbTransferLog(String filename)
Save the current DbTransferLog to a file

Parameters:
filename -
Returns:
The message for the HTTPS interface

saveDbTransferLogFile

public static String saveDbTransferLogFile(goldengate.common.database.DbPreparedStatement preparedStatement,
                                           String filename)
Export DbTransferLogs to a file and purge the corresponding DbTransferLogs

Parameters:
preparedStatement - the DbTransferLog as SELECT command to export (and purge)
filename - the filename where the DbLogs will be exported
Returns:
The message for the HTTPS interface


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.