public class DbTaskRunner extends AbstractDbDataDao<Transfer>
Modifier and Type | Class and Description |
---|---|
static class |
DbTaskRunner.Columns |
static class |
DbTaskRunner.TASKSTEP
GlobalStep Bounds
|
AbstractDbData.UpdatedInfo
Modifier and Type | Field and Description |
---|---|
static String |
AND |
static int[] |
dbTypes |
static String |
fieldseq |
static DbTaskRunner.Columns[][] |
indexes |
static String[] |
indexesNames |
static String |
JSON_COMPRESSION |
static String |
JSON_ORIGINALSIZE |
static String |
JSON_RESCHEDULE |
static String |
JSON_THROUGHMODE |
static String[] |
PRIMARY_KEY
Special For DbTaskRunner
|
static String |
SELECT_COUNT |
protected static String |
selectAllFields |
static String |
table |
static String |
TRACE_FOR_ERROR |
static String |
XMLEXTENSION |
static String |
XMLRUNNER |
static String |
XMLRUNNERS |
JSON_MODEL, pojo, SHOULD_NOT_BE_CALLED
allFields, dbSession, isSaved, otherFields, primaryKey
Constructor and Description |
---|
DbTaskRunner(DbRule rule,
boolean isSender,
RequestPacket requestPacket,
String requested,
Timestamp startTime)
Constructor for submission (no transfer session), from database.
|
DbTaskRunner(long id,
String requested)
Constructor to initiate a request with a valid previous Special Id so
loaded from database.
|
DbTaskRunner(long id,
String requester,
String requested)
Minimal constructor from database
|
DbTaskRunner(long id,
String requester,
String requested,
String owner)
Minimal constructor from database
|
DbTaskRunner(com.fasterxml.jackson.databind.node.ObjectNode source)
To create a new DbTaskRunner (specialId could be invalid) without making
any entry in the database
|
DbTaskRunner(R66Session session,
DbRule rule,
boolean isSender,
RequestPacket requestPacket)
Constructor from a request without a valid Special Id to be inserted into
databases
|
DbTaskRunner(R66Session session,
DbRule rule,
long id,
String requester,
String requested)
Constructor from a request with a valid Special Id so loaded from
database
|
DbTaskRunner(Transfer transfer) |
Modifier and Type | Method and Description |
---|---|
void |
addToTransferMap(String key,
Object value)
Helper to set a new (key, value) in the map Transfer
|
String |
asXML() |
String |
backendXmlFilename() |
static void |
changeFinishedToDone()
Change CompleteOk+ALLDONETASK to Updated = DONE TaskRunner from database.
|
void |
changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
Change UpdatedInfo status
|
boolean |
checkFromDbForSubmit()
Shall be called to ensure that item is really available in database
|
void |
checkThroughMode() |
protected void |
checkValues() |
void |
clean() |
void |
clear()
Clear the runner
|
static int |
clearCache()
To enable clear of oldest entries in the cache
|
boolean |
continueTransfer() |
static void |
createLruCache(int limit,
long ttl)
Create the LRU cache
|
void |
delete()
Delete object from table
|
void |
deleteTempFile()
Delete the temporary empty file (retrieved file at rank 0)
|
boolean |
exist()
Test the existence of the current object
|
void |
finalizeTransfer(LocalChannelReference localChannelReference,
R66File file,
R66Result finalValue,
boolean status)
Once the transfer is over, finalize the Runner by running the error or
post
operation according to the
status.
|
static void |
finishSelectOrCountPrepareStatement(DbPreparedStatement pstt,
long time)
Set the current time in the given updatedPreparedStatement
|
int |
finishTransferTask(ErrorCode code)
Set the status of the transfer
|
boolean |
forceSaveStatus()
This method is to be called each time an operation is happening on Runner
and it is forced (for SelfRequest
handling)
|
long |
freespace(R66Session session,
boolean isWorkingPath) |
long |
freespaceMB(R66Session session) |
static DbTaskRunner |
fromStringXml(String xml,
boolean reverse)
Reload a to submitted runner from a remote partner's log (so reversing
isSender should be true)
|
int |
getBlocksize() |
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) |
static DbPreparedStatement |
getCountStatusRunningPrepareStatement(DbSession session,
ErrorCode status)
Only running transfers
|
static DbPreparedStatement |
getCountStepPrepareStatement(DbSession session,
DbTaskRunner.TASKSTEP globalstep) |
protected AbstractDAO<Transfer> |
getDao(boolean isCacheable) |
ErrorCode |
getErrorInfo() |
String |
getFileInformation() |
String |
getFilename() |
static DbPreparedStatement |
getFilterPrepareStatement(DbSession session,
int limit,
boolean orderBySpecialId,
String startid,
String stopid,
Timestamp start,
Timestamp stop,
String rule,
String req,
boolean pending,
boolean transfer,
boolean error,
boolean done,
boolean all) |
static DbPreparedStatement |
getFilterPrepareStatement(DbSession session,
int limit,
boolean orderBySpecialId,
String startid,
String stopid,
Timestamp start,
Timestamp stop,
String rule,
String req,
boolean pending,
boolean transfer,
boolean error,
boolean done,
boolean all,
String owner) |
String |
getFollowId() |
static Filter |
getFollowIdFilter(String followId) |
static DbTaskRunner |
getFromStatement(DbPreparedStatement preparedStatement)
For instance from Commander when getting updated information
|
static DbTaskRunner |
getFromStatementNoDbRule(DbPreparedStatement preparedStatement)
For REST interface, to prevent DbRule issue
|
static DbTaskRunner |
getFromStatementNoRule(DbPreparedStatement preparedStatement)
For instance from Commander when getting updated information
This version tries to load DbRule but will not make any error if not found!
|
Object |
getFromTransferMap(String key) |
String |
getFullFilePath() |
int |
getGloballaststep() |
DbTaskRunner.TASKSTEP |
getGlobalStep() |
com.fasterxml.jackson.databind.node.ObjectNode |
getJson()
Create the equivalent object in Json (no database access)
|
static String |
getJson(DbPreparedStatement preparedStatement,
int limit)
Write selected TaskRunners to a Json String
|
String |
getJsonAsString() |
String |
getKey()
Used internally
|
DbTaskRunner.TASKSTEP |
getLastGlobalStep() |
LocalChannelReference |
getLocalChannelReference() |
static DbPreparedStatement |
getLogPrepareStatement(DbSession session,
Timestamp start,
Timestamp stop) |
static Map<String,Object> |
getMapFromString(String smap) |
int |
getMode() |
String |
getOriginalFilename() |
long |
getOriginalSize() |
static String |
getOutOfMapFromString(String smap) |
static Filter |
getOwnerFilter() |
protected String |
getPrimaryField()
|
protected String |
getPrimaryKey()
|
int |
getRank() |
RequestPacket |
getRequest() |
String |
getRequested() |
static String |
getRequested(R66Session session,
RequestPacket requestPacket) |
String |
getRequester() |
static String |
getRequester(R66Session session,
RequestPacket requestPacket) |
static long |
getResultCountPrepareStatement(DbPreparedStatement pstt) |
static long |
getResultCountPrepareStatement(DbPreparedStatement pstt,
AbstractDbData.UpdatedInfo info,
long time) |
static long |
getResultCountPrepareStatement(DbPreparedStatement pstt,
ErrorCode error,
long time) |
DbRule |
getRule() |
String |
getRuleId() |
static DbTaskRunner[] |
getSelectFromInfoPrepareStatement(AbstractDbData.UpdatedInfo info,
boolean orderByStart,
int limit) |
static DbTaskRunner[] |
getSelectSameFollowId(String followId,
boolean orderByStart,
int limit,
boolean allOwner) |
static boolean |
getSenderByRequestPacket(RequestPacket request)
Helper
|
long |
getSpecialId() |
Timestamp |
getStart() |
ErrorCode |
getStatus() |
int |
getStep() |
Timestamp |
getStop() |
protected String |
getTable() |
AbstractTask |
getTask(String[] task,
R66Session tempSession) |
String |
getTransferInfo() |
Map<String,Object> |
getTransferMap() |
AbstractDbData.UpdatedInfo |
getUpdatedInfo() |
static String |
hashStatus() |
static String |
headerHtml() |
void |
incrementRank()
Increment the rank of the transfer
|
protected void |
initObject()
To setup primaryKey, otherFields, allFields.
|
void |
insert()
Insert object into table
|
boolean |
isAllDone() |
boolean |
isBlockCompression() |
boolean |
isFileMoved() |
boolean |
isFinished() |
boolean |
isInError() |
boolean |
isInTransfer() |
boolean |
isPreTaskStarting()
To be called before executing Pre execution
|
boolean |
isRecvThrough() |
boolean |
isRequestOnRequested() |
boolean |
isRescheduledTransfer() |
boolean |
isSelfRequest() |
boolean |
isSender() |
boolean |
isSendThrough() |
boolean |
isSessionSender() |
static void |
loadXml(File logsFile)
Method to load several DbTaskRunner from File logs.
|
protected void |
optimizedUpdate()
Update Runner
|
static int |
purgeLogPrepareStatement(DbSession session,
String startid,
String stopid,
Timestamp start,
Timestamp stop,
String rule,
String req,
boolean pending,
boolean transfer,
boolean error,
boolean done,
boolean all) |
static int |
purgeLogPrepareStatement(DbSession session,
Timestamp start,
Timestamp stop)
purge in same interval all runners with globallaststep as ALLDONETASK or
UpdatedInfo as Done
|
boolean |
ready() |
void |
removeFromTransferMap(String key)
Helper to remove a (key, value) from the map Transfer
|
static void |
removeNoDbSpecialId(long specialId)
To allow to remove specifically one SpecialId from MemoryHashmap
|
boolean |
reset()
Reset the runner (ready to be run again)
|
static void |
resetToSubmit(DbSession session)
Change RUNNING, INTERRUPTED to TOSUBMIT TaskRunner from database.
|
boolean |
restart(boolean submit)
Make this Runner ready for restart
|
void |
restartRank()
Decrease if necessary the rank
|
void |
run()
Run all task from current status (globalstep and step)
|
void |
saveStatus()
This method is to be called each time an operation is happening on Runner
|
void |
select()
Select object from table
|
void |
setAllDone()
Set the global step as finished (after post task in success)
|
void |
setBlockCompression(boolean compression) |
void |
setBlocksize(int blocksize) |
void |
setErrorExecutionStatus(ErrorCode code)
Set the ErrorCode for the InfoStatus
|
void |
setErrorTask()
Set the Error Task step
|
void |
setExecutionStatus(ErrorCode status)
Change the status from Task Execution
|
void |
setFileInformation(String newFileInformation)
Set a new File information for this transfer
|
void |
setFileMoved(String newFilename,
boolean isFileMoved) |
void |
setFilename(String filename) |
void |
setFollowId(long followId) |
void |
setFrom(DbTaskRunner runner)
Partial set from another runner (infostatus, rank, status, step, stop,
filename, globallastep, globalstep,
isFileMoved)
|
void |
setFromJson(com.fasterxml.jackson.databind.node.ObjectNode source,
boolean ignorePrimaryKey)
Set the values from the Json node to the current object (no database
access)
|
protected void |
setFromJson(String field,
com.fasterxml.jackson.databind.JsonNode value) |
void |
setInitialTask()
Set the Initial Task step (before Pre task)
|
void |
setLocalChannelReference(LocalChannelReference localChannelReference)
Set a localChannelReference
|
void |
setOriginalFilename(String originalFilename) |
void |
setOriginalSize(long originalSize) |
void |
setPostTask()
Set the Post Task step
|
void |
setPreTask()
Set Pre Task step
|
void |
setRankAtStartup(int rank)
To set the rank at startup of the request if the request specify a
specific
rank
|
void |
setRescheduledTransfer()
Set this DbTaskRunner as rescheduled (valid only while still in memory)
|
void |
setRuleId(String ruleId) |
void |
setSender(boolean sender)
Utility for "self request" mode only
|
void |
setSenderByRequestToValidate(boolean requestToValidate)
Utility for "self request"
|
void |
setStart(Timestamp start) |
void |
setStop(Timestamp stop) |
void |
setTransferInfo(String transferInfo) |
void |
setTransferMap(Map<String,?> map) |
void |
setTransferTask(int rank)
Set Transfer rank
|
boolean |
shallIgnoreSave() |
boolean |
specialSubmit()
Special method used to force insert in case of SelfSubmit
|
boolean |
stopOrCancelRunner(ErrorCode code)
Stop or Cancel a Runner from database point of view
|
String |
toHtml(R66Session session,
String running) |
String |
toLogRunStep() |
String |
toShortNoHtmlString(String newline) |
String |
toShortString() |
String |
toSpecializedHtml(R66Session session,
String body,
String running) |
String |
toString() |
void |
update()
Update object to table
|
static void |
updateLruCacheTimeout(long ttl)
To update the TTL for the cache (to 10xTIMEOUT)
|
void |
updateRank()
Update Rank and Stop only
|
static NbAndSpecialId |
writeXML(DbPreparedStatement preparedStatement,
org.dom4j.io.XMLWriter xmlWriter)
Write the selected TaskRunners from PrepareStatement to a XMLWriter
|
static NbAndSpecialId |
writeXMLWriter(DbPreparedStatement preparedStatement,
String filename)
Write selected TaskRunners to an XML file using an XMLWriter
|
static void |
writeXMLWriter(String filename)
Write all TaskRunners to an XML file using an XMLWriter
|
asJson, getInsertAllValues, getSelectAllFields, getUpdateAllFields, getValues, getWherePrimaryKey, setFromArray, setPrimaryKey, setToArray, toJson, validateLength, validateLength
getAllFields, getTrueValue, setTrueValue, setValues
public static final String JSON_ORIGINALSIZE
public static final String JSON_THROUGHMODE
public static final String JSON_RESCHEDULE
public static final String JSON_COMPRESSION
public static final String AND
public static final String SELECT_COUNT
public static final String TRACE_FOR_ERROR
public static final int[] dbTypes
public static final String table
public static final String fieldseq
public static final String[] indexesNames
public static final DbTaskRunner.Columns[][] indexes
public static final String[] PRIMARY_KEY
public static final String XMLRUNNERS
public static final String XMLRUNNER
public static final String XMLEXTENSION
protected static final String selectAllFields
public DbTaskRunner(Transfer transfer)
public DbTaskRunner(DbRule rule, boolean isSender, RequestPacket requestPacket, String requested, Timestamp startTime) throws WaarpDatabaseException
rule
- isSender
- requestPacket
- requested
- startTime
- WaarpDatabaseException
public DbTaskRunner(R66Session session, DbRule rule, boolean isSender, RequestPacket requestPacket) throws WaarpDatabaseException
session
- rule
- isSender
- requestPacket
- WaarpDatabaseException
public DbTaskRunner(R66Session session, DbRule rule, long id, String requester, String requested) throws WaarpDatabaseException
session
- rule
- id
- requester
- requested
- WaarpDatabaseException
public DbTaskRunner(long id, String requester, String requested) throws WaarpDatabaseException
id
- requester
- requested
- WaarpDatabaseException
public DbTaskRunner(long id, String requester, String requested, String owner) throws WaarpDatabaseException
id
- requester
- requested
- WaarpDatabaseException
public DbTaskRunner(com.fasterxml.jackson.databind.node.ObjectNode source) throws WaarpDatabaseException
source
- WaarpDatabaseException
public DbTaskRunner(long id, String requested) throws WaarpDatabaseException
id
- requested
- WaarpDatabaseException
public static void createLruCache(int limit, long ttl)
limit
- limit of number of entries in the cachettl
- time to leave usedpublic static String hashStatus()
public static int clearCache()
public static void updateLruCacheTimeout(long ttl)
ttl
- protected final void initObject()
AbstractDbData
initObject
in class AbstractDbDataDao<Transfer>
protected final String getTable()
getTable
in class AbstractDbDataDao<Transfer>
protected final AbstractDAO<Transfer> getDao(boolean isCacheable) throws DAOConnectionException
getDao
in class AbstractDbDataDao<Transfer>
DAOConnectionException
protected final String getPrimaryKey()
getPrimaryKey
in class AbstractDbDataDao<Transfer>
protected final String getPrimaryField()
getPrimaryField
in class AbstractDbDataDao<Transfer>
public static String getRequested(R66Session session, RequestPacket requestPacket)
session
- requestPacket
- public static String getRequester(R66Session session, RequestPacket requestPacket)
session
- requestPacket
- public final void checkThroughMode()
public final void setFromJson(com.fasterxml.jackson.databind.node.ObjectNode source, boolean ignorePrimaryKey) throws WaarpDatabaseSqlException
AbstractDbDataDao
setFromJson
in class AbstractDbDataDao<Transfer>
ignorePrimaryKey
- True will ignore primaryKey from JsonWaarpDatabaseSqlException
protected final void checkValues() throws WaarpDatabaseSqlException
checkValues
in class AbstractDbDataDao<Transfer>
WaarpDatabaseSqlException
public static void removeNoDbSpecialId(long specialId)
specialId
- public final boolean exist() throws WaarpDatabaseException
AbstractDbDataDao
exist
in class AbstractDbDataDao<Transfer>
WaarpDatabaseException
public final boolean checkFromDbForSubmit() throws WaarpDatabaseException
WaarpDatabaseException
public final void select() throws WaarpDatabaseException
AbstractDbDataDao
select
in class AbstractDbDataDao<Transfer>
WaarpDatabaseException
public final void insert() throws WaarpDatabaseException
AbstractDbDataDao
insert
in class AbstractDbDataDao<Transfer>
WaarpDatabaseException
public final void updateRank() throws WaarpDatabaseException
WaarpDatabaseException
public final void update() throws WaarpDatabaseException
AbstractDbDataDao
update
in class AbstractDbDataDao<Transfer>
WaarpDatabaseException
protected final void optimizedUpdate() throws WaarpDatabaseException
WaarpDatabaseException
public final void delete() throws WaarpDatabaseException
AbstractDbDataDao
delete
in class AbstractDbDataDao<Transfer>
WaarpDatabaseException
public final void clean()
public final boolean specialSubmit() throws WaarpDatabaseException
WaarpDatabaseException
public final void setFrom(DbTaskRunner runner)
runner
- public final boolean isRecvThrough()
public final boolean isSendThrough()
public final void setLocalChannelReference(LocalChannelReference localChannelReference)
localChannelReference
- public final LocalChannelReference getLocalChannelReference()
public static DbTaskRunner getFromStatement(DbPreparedStatement preparedStatement) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbTaskRunner getFromStatementNoRule(DbPreparedStatement preparedStatement) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
This version tries to load DbRule but will not make any error if not found!
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbTaskRunner getFromStatementNoDbRule(DbPreparedStatement preparedStatement) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getFilterPrepareStatement(DbSession session, int limit, boolean orderBySpecialId, String startid, String stopid, Timestamp start, Timestamp stop, String rule, String req, boolean pending, boolean transfer, boolean error, boolean done, boolean all) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- limit
- orderBySpecialId
- startid
- stopid
- start
- stop
- rule
- req
- pending
- transfer
- error
- done
- all
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getFilterPrepareStatement(DbSession session, int limit, boolean orderBySpecialId, String startid, String stopid, Timestamp start, Timestamp stop, String rule, String req, boolean pending, boolean transfer, boolean error, boolean done, boolean all, String owner) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- limit
- orderBySpecialId
- startid
- stopid
- start
- stop
- rule
- req
- pending
- transfer
- error
- done
- all
- owner
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static Filter getFollowIdFilter(String followId)
followId
- the followId to findpublic static Filter getOwnerFilter()
public static DbTaskRunner[] getSelectSameFollowId(String followId, boolean orderByStart, int limit, boolean allOwner) throws WaarpDatabaseNoConnectionException
followId
- the followId to findorderByStart
- If true, sort on Start ; If false, does not
set the order on startlimit
- the limit of itemsallOwner
- if admin role, can resolve for all OwnersWaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbTaskRunner[] getSelectFromInfoPrepareStatement(AbstractDbData.UpdatedInfo info, boolean orderByStart, int limit) throws WaarpDatabaseNoConnectionException
info
- orderByStart
- If true, sort on Start ; If false, does not
set the limit on startlimit
- 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 getCountStepPrepareStatement(DbSession session, DbTaskRunner.TASKSTEP globalstep) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- globalstep
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getCountStatusPrepareStatement(DbSession session) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static long getResultCountPrepareStatement(DbPreparedStatement pstt, ErrorCode error, long time)
pstt
- error
- time
- public static DbPreparedStatement getCountStatusRunningPrepareStatement(DbSession session, ErrorCode status) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- status
- 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 static long getResultCountPrepareStatement(DbPreparedStatement pstt)
pstt
- public static void finishSelectOrCountPrepareStatement(DbPreparedStatement pstt, long time) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
pstt
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getLogPrepareStatement(DbSession session, Timestamp start, Timestamp stop) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- start
- stop
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static int purgeLogPrepareStatement(DbSession session, Timestamp start, Timestamp stop) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- start
- stop
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static int purgeLogPrepareStatement(DbSession session, String startid, String stopid, Timestamp start, Timestamp stop, String rule, String req, boolean pending, boolean transfer, boolean error, boolean done, boolean all) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- startid
- stopid
- start
- stop
- rule
- req
- pending
- transfer
- error
- done
- all
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static void resetToSubmit(DbSession session) throws WaarpDatabaseNoConnectionException
session
- WaarpDatabaseNoConnectionException
public static void changeFinishedToDone() throws WaarpDatabaseNoConnectionException
public final boolean reset()
public final void restartRank()
public final boolean restart(boolean submit)
submit
- True to resubmit this task, else False to keep it
as
running (only reset)public final boolean stopOrCancelRunner(ErrorCode code)
code
- public final void changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
AbstractDbDataDao
changeUpdatedInfo
in class AbstractDbDataDao<Transfer>
public final void setErrorExecutionStatus(ErrorCode code)
code
- public final AbstractDbData.UpdatedInfo getUpdatedInfo()
public final ErrorCode getErrorInfo()
public final int getStep()
public final boolean isRescheduledTransfer()
public final void setRescheduledTransfer()
public final void setRankAtStartup(int rank)
rank
- the rank to setpublic final void setBlocksize(int blocksize)
blocksize
- the block size to setpublic final void setFilename(String filename)
filename
- the filename to setpublic final void setFileMoved(String newFilename, boolean isFileMoved)
newFilename
- the new Filename to setisFileMoved
- the isFileMoved to setpublic final void setOriginalFilename(String originalFilename)
originalFilename
- the originalFilename to setpublic final int getRank()
public final void setExecutionStatus(ErrorCode status)
status
- public final ErrorCode getStatus()
public final boolean isSender()
public final boolean isSessionSender()
public final boolean isFileMoved()
public final int getBlocksize()
public final String getFilename()
public final String getOriginalFilename()
public static Map<String,Object> getMapFromString(String smap)
smap
- the source of the mappublic static String getOutOfMapFromString(String smap)
smap
- the source of the mappublic final Map<String,Object> getTransferMap()
public final void setTransferMap(Map<String,?> map)
map
- the Map to add as Json string to transferInformationpublic final void setTransferInfo(String transferInfo)
transferInfo
- the transfer Information to setpublic final void addToTransferMap(String key, Object value)
key
- value
- public final void removeFromTransferMap(String key)
key
- public final Object getFromTransferMap(String key)
key
- public final String getFollowId()
public final void setFollowId(long followId)
followId
- the followId to setpublic final boolean isBlockCompression()
public final void setBlockCompression(boolean compression)
compression
- True if the Bock Compression is activepublic final String getTransferInfo()
public final String getFileInformation()
public final void setFileInformation(String newFileInformation)
newFileInformation
- public final long getSpecialId()
public final DbRule getRule()
public final String getRuleId()
public final void setRuleId(String ruleId) throws WaarpDatabaseException
ruleId
- the RuleId to setWaarpDatabaseException
- if the RuleId is wrongpublic final int getMode()
public final DbTaskRunner.TASKSTEP getGlobalStep()
public final DbTaskRunner.TASKSTEP getLastGlobalStep()
public final int getGloballaststep()
public final boolean ready()
public final boolean isInTransfer()
public final boolean isFinished()
public final boolean isInError()
public final boolean isAllDone()
public final boolean isPreTaskStarting()
public final void setInitialTask()
public final void setPreTask()
public final void setTransferTask(int rank)
rank
- public final void setPostTask()
public final void setErrorTask()
public final void setAllDone()
public final int finishTransferTask(ErrorCode code)
code
- TransferOk if successpublic final boolean continueTransfer()
public final AbstractTask getTask(String[] task, R66Session tempSession) throws OpenR66RunnerErrorException
task
- tempSession
- OpenR66RunnerErrorException
public final void run() throws OpenR66RunnerErrorException
OpenR66RunnerErrorException
public final void finalizeTransfer(LocalChannelReference localChannelReference, R66File file, R66Result finalValue, boolean status) throws OpenR66RunnerErrorException, OpenR66ProtocolSystemException
localChannelReference
- file
- finalValue
- status
- OpenR66RunnerErrorException
OpenR66ProtocolSystemException
public final void incrementRank()
public final void saveStatus() throws OpenR66RunnerErrorException
OpenR66RunnerErrorException
public final boolean forceSaveStatus()
OpenR66RunnerErrorException
public final void clear()
public final void deleteTempFile()
public final String toLogRunStep()
public final String toShortString()
public static String headerHtml()
public final long freespaceMB(R66Session session)
session
- public final long freespace(R66Session session, boolean isWorkingPath)
session
- isWorkingPath
- public final String toHtml(R66Session session, String running)
session
- running
- special infopublic final String toSpecializedHtml(R66Session session, String body, String running)
session
- body
- running
- special infopublic final boolean isRequestOnRequested()
public final boolean shallIgnoreSave()
public final boolean isSelfRequest()
public final String getRequested()
public final String getRequester()
public final Timestamp getStart()
public final void setStart(Timestamp start)
start
- new Start time to apply when reschedulepublic final Timestamp getStop()
public final void setStop(Timestamp stop)
public final RequestPacket getRequest()
public final String getKey()
public static NbAndSpecialId writeXML(DbPreparedStatement preparedStatement, org.dom4j.io.XMLWriter xmlWriter) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException, OpenR66ProtocolBusinessException
preparedStatement
- ready to be executedxmlWriter
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
OpenR66ProtocolBusinessException
public static String getJson(DbPreparedStatement preparedStatement, int limit) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static NbAndSpecialId writeXMLWriter(DbPreparedStatement preparedStatement, String filename) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException, OpenR66ProtocolBusinessException
preparedStatement
- filename
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
OpenR66ProtocolBusinessException
public static void writeXMLWriter(String filename) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException, OpenR66ProtocolBusinessException
filename
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
OpenR66ProtocolBusinessException
public final String backendXmlFilename()
public final String asXML()
public final com.fasterxml.jackson.databind.node.ObjectNode getJson()
AbstractDbDataDao
getJson
in class AbstractDbDataDao<Transfer>
protected final void setFromJson(String field, com.fasterxml.jackson.databind.JsonNode value)
setFromJson
in class AbstractDbDataDao<Transfer>
public final String getJsonAsString()
public static DbTaskRunner fromStringXml(String xml, boolean reverse) throws OpenR66ProtocolBusinessException
xml
- reverse
- OpenR66ProtocolBusinessException
public static void loadXml(File logsFile) throws OpenR66ProtocolBusinessException
logsFile
- File containing logs from export functionOpenR66ProtocolBusinessException
public final void setSender(boolean sender)
sender
- public static boolean getSenderByRequestPacket(RequestPacket request)
request
- public final void setSenderByRequestToValidate(boolean requestToValidate)
requestToValidate
- public final long getOriginalSize()
public final void setOriginalSize(long originalSize)
originalSize
- the originalSize to setpublic final String getFullFilePath() throws CommandAbstractException
CommandAbstractException
Copyright © 2009–2022 Waarp. All rights reserved.