openr66.context.task
Class RescheduleTransferTask

java.lang.Object
  extended by openr66.context.task.AbstractTask
      extended by openr66.context.task.RescheduleTransferTask
All Implemented Interfaces:
Runnable

public class RescheduleTransferTask
extends AbstractTask

Reschedule Transfer task to a time delayed by the specified number of milliseconds, if the error code is one of the specified codes and the optional intervals of date are compatible with the new time schedule

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.

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.

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.

Author:
Frederic Bregier

Field Summary
protected  long newdate
           
protected  Calendar newDate
           
 
Fields inherited from class openr66.context.task.AbstractTask
ARCHPATH, 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 Summary
RescheduleTransferTask(String argRule, int delay, String argTransfer, R66Session session)
           
 
Method Summary
 void run()
          This is the only interface to execute an operator.
protected  boolean validateArgs(String[] args)
           
 
Methods inherited from class openr66.context.task.AbstractTask
getFutureCompletion, getReplacedValue, isSuccess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newdate

protected long newdate

newDate

protected Calendar newDate
Constructor Detail

RescheduleTransferTask

public RescheduleTransferTask(String argRule,
                              int delay,
                              String argTransfer,
                              R66Session session)
Parameters:
argRule -
delay -
argTransfer -
session -
Method Detail

run

public void run()
Description copied from class: AbstractTask
This is the only interface to execute an operator.

Specified by:
run in interface Runnable
Specified by:
run in class AbstractTask

validateArgs

protected boolean validateArgs(String[] args)


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