Class FCClientWorker<T extends FileTransferMechanism>
- java.lang.Object
-
- unlimited.fc.client.api.multiclient.FCClientWorker<T>
-
- Type Parameters:
T- the generic type
- All Implemented Interfaces:
java.lang.Runnable,TransferRunner
public class FCClientWorker<T extends FileTransferMechanism> extends java.lang.Object implements TransferRunner
The Class FCClientWorker.
-
-
Field Summary
Fields Modifier and Type Field Description protected Tclientprotected MultiClientManagerparentprotected booleanresetThread
-
Constructor Summary
Constructors Modifier Constructor Description protectedFCClientWorker(MultiClientManager parent, T client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcleanup()Cleans up the current job if is definedprotected voiddisconnectClient()Disconnects the client from the server that is connected toprotected voidexecuteRun()java.util.concurrent.locks.LockgetCleanupFutureLock()FileTransferMechanismgetClient()Returns the current FileTransferMechanism that this runner uses to transfer filesTransferJobgetJob()Returns the current TransferJob that this runner is usingprotected java.lang.StringinitRun()booleanisRunning()Returns whether or not the runner is currently executingvoidrun()protected voidrunJob()Runs the job that is currently assigned to this FCClientWorker instancevoidsetCleanupFuture(java.util.concurrent.Future<?> someFuture)voidsetPool(FCClientWorkerPool fcClientWorkerPool)voidshutDown()Shut down.protected booleansynchWithMaster()Syncs this client with the master parent client object
-
-
-
Field Detail
-
parent
protected MultiClientManager parent
-
client
protected T extends FileTransferMechanism client
-
resetThread
protected boolean resetThread
-
-
Constructor Detail
-
FCClientWorker
protected FCClientWorker(MultiClientManager parent, T client)
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
executeRun
protected void executeRun() throws unlimited.core.util.common.exception.FCException.Retriable- Throws:
unlimited.core.util.common.exception.FCException.Retriable
-
initRun
protected java.lang.String initRun()
-
disconnectClient
protected void disconnectClient()
Disconnects the client from the server that is connected to
-
runJob
protected void runJob() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionRuns the job that is currently assigned to this FCClientWorker instance- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
synchWithMaster
protected boolean synchWithMaster()
Syncs this client with the master parent client object- Returns:
- Whether or not the sync was successful
-
cleanup
protected void cleanup()
Cleans up the current job if is defined
-
shutDown
public void shutDown()
Shut down.
-
setPool
public void setPool(FCClientWorkerPool fcClientWorkerPool)
-
isRunning
public boolean isRunning()
Description copied from interface:TransferRunnerReturns whether or not the runner is currently executing- Specified by:
isRunningin interfaceTransferRunner- Returns:
- True if running, false if not
-
getJob
public TransferJob getJob()
Description copied from interface:TransferRunnerReturns the current TransferJob that this runner is using- Specified by:
getJobin interfaceTransferRunner- Returns:
- TransferJob containing the work to be executed
-
getClient
public FileTransferMechanism getClient()
Description copied from interface:TransferRunnerReturns the current FileTransferMechanism that this runner uses to transfer files- Specified by:
getClientin interfaceTransferRunner- Returns:
- Client to be used when executing the job
-
setCleanupFuture
public void setCleanupFuture(java.util.concurrent.Future<?> someFuture)
-
getCleanupFutureLock
public java.util.concurrent.locks.Lock getCleanupFutureLock()
-
-