openr66.client
Class RecvThroughClient

java.lang.Object
  extended by openr66.client.AbstractTransfer
      extended by openr66.client.RecvThroughClient
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
TestRecvThroughClient

public class RecvThroughClient
extends AbstractTransfer

Class for Recv Through client 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();


Author:
Frederic Bregier
See Also:
{@link TestRecvThroughClient} Class as example of usage

Field Summary
protected  RecvThroughHandler handler
           
protected  LocalChannelReference localChannelReference
           
protected  NetworkTransaction networkTransaction
           
 
Fields inherited from class openr66.client.AbstractTransfer
block, blocksize, dateFormat, fileinfo, fileInfo, filename, future, id, idt, ismd5, isMD5, localFilename, logger, nolog, remoteHost, rhost, rule, rulename, startTime, ttimestart
 
Constructor Summary
RecvThroughClient(R66Future future, RecvThroughHandler handler, String remoteHost, String filename, String rulename, String fileinfo, boolean isMD5, int blocksize, long id, NetworkTransaction networkTransaction)
           
 
Method Summary
 void run()
          Prior to call this method, the pipeline and NetworkTransaction must have been initialized.
 
Methods inherited from class openr66.client.AbstractTransfer
getParams, initRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

networkTransaction

protected final NetworkTransaction networkTransaction

localChannelReference

protected LocalChannelReference localChannelReference

handler

protected final RecvThroughHandler handler
Constructor Detail

RecvThroughClient

public RecvThroughClient(R66Future future,
                         RecvThroughHandler handler,
                         String remoteHost,
                         String filename,
                         String rulename,
                         String fileinfo,
                         boolean isMD5,
                         int blocksize,
                         long id,
                         NetworkTransaction networkTransaction)
Parameters:
future -
remoteHost -
filename -
rulename -
fileinfo -
isMD5 -
blocksize -
id -
networkTransaction -
Method Detail

run

public void run()
Prior to call this method, the pipeline and NetworkTransaction must have been initialized. It is the responsibility of the caller to finish all network resources.



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