public class RecvThroughClient extends AbstractTransfer
This class does not included the real file transfer since it is up to the business project to implement how to write new data received from the remote host. If an error occurs, no transfer log is kept.
1) Configuration must have been loaded
2) Pipeline and NetworkTransaction must have been initiated:
Configuration.configuration.pipelineInit();
NetworkTransaction networkTransaction = new
NetworkTransaction();
3) Prepare the request of transfer:
R66Future futureReq = new R66Future(true);
RecvThroughHandler rth = new RecvThroughHandler(...);
RecvThroughClient transaction = new RecvThroughClient(futureReq,
rth, ...);
transaction.run();
4) If everything is in success, wait for the transfer to finish:
futureReq.awaitUninterruptibly();
R66Result result = futureReq.getResult();
5) If there is the need to re-do, just re-execute the steps from 3 to 4.
Don't forget at the very end to finish the global structure (steps 3 to 4 no
more executed):
networkTransaction.closeAll();
Class as example of usage in test part
Modifier and Type | Field and Description |
---|---|
protected RecvThroughHandler |
handler |
protected LocalChannelReference |
localChannelReference |
protected NetworkTransaction |
networkTransaction |
_INFO_ARGS, block, blocksize, fileinfo, fileInfo, filename, future, id, idt, ismd5, isMD5, localFilename, logger, NO_INFO_ARGS, nolog, normalInfoAsWarn, remoteHost, rhost, rule, rulename, snormalInfoAsWarn, startTime, ttimestart
Constructor and Description |
---|
RecvThroughClient(R66Future future,
RecvThroughHandler handler,
String remoteHost,
String filename,
String rulename,
String fileinfo,
boolean isMD5,
int blocksize,
long id,
NetworkTransaction networkTransaction) |
Modifier and Type | Method and Description |
---|---|
void |
run()
Prior to call this method, the pipeline and NetworkTransaction must have
been initialized.
|
clear, finalizeInErrorTransferRequest, getLocalFiles, getParams, getParamsInternal, getRemoteFiles, initRequest, prepareKoOutputFormat, prepareKoOutputFormat, prepareOkOutputFormat, prepareSubmitKoOutputFormat, prepareSubmitOkOutputFormat, sendValidPacket, setNormalInfoAsWarn, tryConnect
protected final NetworkTransaction networkTransaction
protected LocalChannelReference localChannelReference
protected final RecvThroughHandler handler
public RecvThroughClient(R66Future future, RecvThroughHandler handler, String remoteHost, String filename, String rulename, String fileinfo, boolean isMD5, int blocksize, long id, NetworkTransaction networkTransaction)
future
- remoteHost
- filename
- rulename
- fileinfo
- isMD5
- blocksize
- id
- networkTransaction
- Copyright © 2009–2020 Waarp. All rights reserved.