public class RescheduleTransferTask extends AbstractTask
Result of arguments will be as following options (the two first are
mandatory):
"-delay ms" where ms is the added number of ms on current time before retry
on schedule
"-case errorCode,errorCode,..." where errorCode is one of the following error
of the current transfer
(either literal or code in 1 character:
ConnectionImpossible(C), ServerOverloaded(l), BadAuthent(A), ExternalOp(E),
TransferError(T), MD5Error(M),
Disconnection(D), RemoteShutdown(r), FinalOp(F), Unimplemented(U),
Shutdown(S), RemoteError(R),
Internal(I), StoppedTransfer(H), CanceledTransfer(K), Warning(W), Unknown(-),
QueryAlreadyFinished(Q),
QueryStillRunning(s), NotKnownHost(N), QueryRemotelyUnknown(u),
FileNotFound(f), CommandNotFound(c),
PassThroughMode(p)
"-between start;end" and/or "-notbetween start;end" (multiple times are
allowed, start or end can be not
set) and where start and stop are in the following format:
Yn:Mn:Dn:Hn:mn:Sn where n is a number for each time specification, each
specification is optional, as
Y=Year, M=Month, D=Day, H=Hour, m=minute, s=second.
Format can be X+n, X-n, X=n or Xn where X+-n means adding/subtracting n to
current date value, while X=n or
Xn means setting exact value
If one time specification is not set, it is based on the current date.
"-count limit" will be the limit of retry. The current value limit is taken
from the "transferInfo"
internal code (not any more the "information of transfer")and not from the
rule as "{"CPTLIMIT": limit}" as
JSON code. Each time this function is called, the limit value will be
replaced as newlimit = limit - 1 in
the "transferInfo" as "{"CPTLIMIT": limit}" as JSON code.
To ensure correctness, the value must be in the "transferInfo" internal code
since this value will be
changed statically in the "transferInfo". If taken from the rule, it will be
wrong since the value will
never decrease. However, a value must be setup in the rule in order to reset
the value when the count reach
0.
So in the rule, "-count resetlimit" must be present, where resetlimit will be
the new value set when the
limit reach 0, and in the "transferInfo" internal code, "{"CPTLIMIT": limit}"
as JSON code must be present.
If one is missing, the condition is not applied.
If "-notbetween" is specified, the planned date must not be in the area.
If "-between" is specified, the planned date must be found in any such
specified areas (could be in any of
the occurrence). If not specified, it only depends on "-notbetween".
If none is specified, the planned date is always valid.
Note that if a previous called to a reschedule was done for this attempt and
was successful, the following
calls will be ignored.
Important note: any subsequent task will be ignored and not executed once
the reschedule is
accepted.
In case start > end, end will be +1 day
In case start and end < current planned date, both will have +1 day.
Example: -delay 3600000 -case ConnectionImpossible,ServerOverloaded,Shutdown
-notbetween H7:m0:S0;H19:m0:S0
-notbetween H1:m0:S0;H=3:m0:S0
means retry in case of error during initialization of connection in 1 hour if
not between 7AM to 7PM and
not between 1AM to 3AM.
Modifier and Type | Field and Description |
---|---|
protected boolean |
countUsed |
static String |
CPTLIMIT
Delimiter for -count option in Reschedule to be placed in the transfer
info
of transfer as {"CPTLIMIT":
limit} where limit is an integer.
|
static String |
CPTTOTAL |
protected int |
limitCount |
protected long |
newdate |
protected Calendar |
newDate |
protected int |
resetCount |
protected DbTaskRunner |
runner |
protected int |
totalCount |
ARCHPATH, BLANK, BLOCKSIZE, DATE, ERRORCODE, ERRORMSG, ERRORSTRCODE, FILESIZE, FULLTRANSFERID, HOMEPATH, HOUR, INPATH, LOCALEXEC, LOCALHOST, LOCALHOSTADDR, NOWAIT, ORIGINALFILENAME, ORIGINALFULLPATH, OUTPATH, RANKTRANSFER, REMOTEHOST, REMOTEHOSTADDR, REQUESTEDHOST, REQUESTERHOST, RULE, TRANSFERID, TRUEFILENAME, TRUEFULLPATH, WORKPATH
Constructor and Description |
---|
RescheduleTransferTask(String argRule,
int delay,
String argTransfer,
R66Session session) |
Modifier and Type | Method and Description |
---|---|
protected void |
resetInformation(int value) |
void |
run()
This is the only interface to execute an operator.
|
protected boolean |
validateArgs(String[] args) |
getFutureCompletion, getReplacedValue, getType, isSuccess
public static final String CPTLIMIT
public static final String CPTTOTAL
protected long newdate
protected Calendar newDate
protected boolean countUsed
protected int limitCount
protected int totalCount
protected int resetCount
protected DbTaskRunner runner
public RescheduleTransferTask(String argRule, int delay, String argTransfer, R66Session session)
argRule
- delay
- argTransfer
- session
- public void run()
AbstractTask
run
in interface Runnable
run
in class AbstractTask
protected void resetInformation(int value)
protected boolean validateArgs(String[] args)
Copyright © 2009–2020 Waarp. All rights reserved.