public class DbTransferLog extends AbstractDbData
Modifier and Type | Class and Description |
---|---|
static class |
DbTransferLog.Columns |
AbstractDbData.UpdatedInfo
Modifier and Type | Field and Description |
---|---|
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 |
allFields, dbSession, isSaved, JSON_MODEL, otherFields, primaryKey
Constructor and Description |
---|
DbTransferLog(DbSession dbSession,
String user,
String account,
long specialId)
Load from database
|
DbTransferLog(DbSession dbSession,
String user,
String account,
long specialId,
boolean isSender,
String filename,
String mode,
ReplyCode infostatus,
String info,
AbstractDbData.UpdatedInfo updatedInfo)
Insert into database
|
Modifier and Type | Method and Description |
---|---|
void |
changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
Change UpdatedInfo status
|
void |
clear()
Clear the runner
|
void |
create()
As insert but with the ability to change the SpecialId
|
void |
delete()
Delete object from table
|
static void |
finishSelectOrCountPrepareStatement(DbPreparedStatement pstt)
Set the current time in the given updatedPreparedStatement
|
static void |
finishSelectOrCountPrepareStatement(DbPreparedStatement pstt,
long time)
Set the current time in the given updatedPreparedStatement
|
String |
getAccount() |
static DbPreparedStatement |
getCountAllPrepareStatement(DbSession session) |
static DbPreparedStatement |
getCountInfoPrepareStatement(DbSession session) |
static DbPreparedStatement |
getCountInOutErrorPrepareStatement(DbSession session,
boolean in)
Running or not transfers are concerned
|
static DbPreparedStatement |
getCountInOutRunningPrepareStatement(DbSession session,
boolean in,
boolean running)
Running or not transfers are concerned
|
static DbPreparedStatement |
getCountStatusPrepareStatement(DbSession session) |
ReplyCode |
getErrorInfo() |
String |
getFilename() |
static DbTransferLog |
getFromStatement(DbPreparedStatement preparedStatement)
For instance when getting updated information
|
String |
getInfotransf() |
protected String |
getInsertAllValues() |
static DbPreparedStatement |
getLogPrepareStament(DbSession session,
Timestamp start,
Timestamp stop) |
static DbPreparedStatement |
getLogPrepareStament(DbSession session,
Timestamp start,
Timestamp stop,
ReplyCode status) |
String |
getMode() |
static long |
getResultCountPrepareStatement(DbPreparedStatement pstt) |
static long |
getResultCountPrepareStatement(DbPreparedStatement pstt,
AbstractDbData.UpdatedInfo info,
long time) |
static long |
getResultCountPrepareStatement(DbPreparedStatement pstt,
ReplyCode error,
long time) |
protected String |
getSelectAllFields() |
long |
getSpecialId() |
Timestamp |
getStart() |
static DbPreparedStatement |
getStatusPrepareStament(DbSession session,
ReplyCode status,
int limit) |
Timestamp |
getStop() |
protected String |
getTable() |
protected String |
getUpdateAllFields() |
AbstractDbData.UpdatedInfo |
getUpdatedInfo() |
String |
getUser() |
protected String |
getWherePrimaryKey() |
protected void |
initObject()
To setup primaryKey, otherFields, allFields.
|
void |
insert()
Insert object into table
|
boolean |
isSender() |
String |
saveDbTransferLog(String filename)
Save the current DbTransferLog to a file
|
static String |
saveDbTransferLogFile(DbPreparedStatement preparedStatement,
String filename)
Exports DbTransferLogs to a file and purges the corresponding
DbTransferLogs
|
static String |
saveDbTransferLogFile(DbPreparedStatement preparedStatement,
Writer outWriter,
boolean purge)
Exports DbTransferLogs to a Writer object and optionally purges 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()
Internal function to retrieve data from Array to pull data from database
|
void |
setInfotransf(String infotransf) |
protected void |
setPrimaryKey()
Set the primary Key as current value
|
void |
setReplyCodeExecutionStatus(ReplyCode code)
Set the ReplyCode for the UpdatedInfo
|
void |
setStop(Timestamp stop) |
protected void |
setToArray()
Internal function to set to Array used to push data to database
|
String |
toString() |
asJson, exist, getAllFields, getJson, getTrueValue, getValues, select, setFromJson, setTrueValue, setValues, update, validateLength, validateLength
public static final int[] dbTypes
public static final String table
public static final String fieldseq
public static final DbTransferLog.Columns[] indexes
public static final String XMLRUNNERS
public static final String XMLRUNNER
public static final int NBPRKEY
protected static final String selectAllFields
protected static final String updateAllFields
protected static final String insertAllValues
public DbTransferLog(DbSession dbSession, String user, String account, long specialId, boolean isSender, String filename, String mode, ReplyCode infostatus, String info, AbstractDbData.UpdatedInfo updatedInfo) throws WaarpDatabaseException
dbSession
- user
- account
- specialId
- isSender
- filename
- mode
- infostatus
- info
- updatedInfo
- WaarpDatabaseException
public DbTransferLog(DbSession dbSession, String user, String account, long specialId) throws WaarpDatabaseException
dbSession
- user
- account
- specialId
- WaarpDatabaseException
protected final void initObject()
AbstractDbData
initObject
in class AbstractDbData
protected final String getSelectAllFields()
getSelectAllFields
in class AbstractDbData
protected final String getTable()
getTable
in class AbstractDbData
protected final String getInsertAllValues()
getInsertAllValues
in class AbstractDbData
protected final String getUpdateAllFields()
getUpdateAllFields
in class AbstractDbData
protected final void setToArray() throws WaarpDatabaseSqlException
AbstractDbData
setToArray
in class AbstractDbData
WaarpDatabaseSqlException
protected final void setFromArray() throws WaarpDatabaseSqlException
AbstractDbData
setFromArray
in class AbstractDbData
WaarpDatabaseSqlException
protected final String getWherePrimaryKey()
getWherePrimaryKey
in class AbstractDbData
protected final void setPrimaryKey()
setPrimaryKey
in class AbstractDbData
public final void delete() throws WaarpDatabaseException
AbstractDbData
delete
in class AbstractDbData
WaarpDatabaseException
public final void insert() throws WaarpDatabaseException
AbstractDbData
insert
in class AbstractDbData
WaarpDatabaseException
public final void create() throws WaarpDatabaseException
WaarpDatabaseException
public static DbTransferLog getFromStatement(DbPreparedStatement preparedStatement) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getStatusPrepareStament(DbSession session, ReplyCode status, int limit) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- status
- limit
- limit the number of rowsWaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getLogPrepareStament(DbSession session, Timestamp start, Timestamp stop) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- start
- stop
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getLogPrepareStament(DbSession session, Timestamp start, Timestamp stop, ReplyCode status) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- start
- stop
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getCountInfoPrepareStatement(DbSession session) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static long getResultCountPrepareStatement(DbPreparedStatement pstt, AbstractDbData.UpdatedInfo info, long time)
pstt
- info
- time
- public static DbPreparedStatement getCountStatusPrepareStatement(DbSession session) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getCountAllPrepareStatement(DbSession session) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static long getResultCountPrepareStatement(DbPreparedStatement pstt, ReplyCode error, long time)
pstt
- error
- time
- public static long getResultCountPrepareStatement(DbPreparedStatement pstt)
pstt
- public static void finishSelectOrCountPrepareStatement(DbPreparedStatement pstt) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
pstt
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static void finishSelectOrCountPrepareStatement(DbPreparedStatement pstt, long time) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
pstt
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getCountInOutErrorPrepareStatement(DbSession session, boolean in) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- in
- True for Incoming, False for OutgoingWaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getCountInOutRunningPrepareStatement(DbSession session, boolean in, boolean running) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- in
- True for Incoming, False for Outgoingrunning
- True for Running only, False for allWaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public final void changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
AbstractDbData
changeUpdatedInfo
in class AbstractDbData
public final void setReplyCodeExecutionStatus(ReplyCode code)
code
- public final AbstractDbData.UpdatedInfo getUpdatedInfo()
public final ReplyCode getErrorInfo()
public final void setFilename(String filename)
filename
- the filename to setpublic final boolean isSender()
public final String getFilename()
public final long getSpecialId()
public final String getInfotransf()
public final void setInfotransf(String infotransf)
infotransf
- the infotransf to setpublic final String getUser()
public final String getAccount()
public final void setStop(Timestamp stop)
stop
- the stop to setpublic final String getMode()
public final void saveStatus() throws WaarpDatabaseException
WaarpDatabaseException
public final void clear()
public final Timestamp getStart()
public final Timestamp getStop()
public final String saveDbTransferLog(String filename)
filename
- public static String saveDbTransferLogFile(DbPreparedStatement preparedStatement, String filename)
preparedStatement
- the DbTransferLog as SELECT command to
export
(and purge)filename
- the filename where the DbLogs will be exportedpublic static String saveDbTransferLogFile(DbPreparedStatement preparedStatement, Writer outWriter, boolean purge)
preparedStatement
- the DbTransferLog as SELECT command to
export
(and purge)outWriter
- a Writer object where the DbLogs will be writtenpurge
- sets whether or not the selected results must be
purgedCopyright © 2009–2022 Waarp. All rights reserved.