|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.bibalex.daf.handlers.filehandler.FTPThread
class FTPThread
This class represents a FTP Thread instance that can be used to get, put or delete a single file.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private boolean |
bAssigned
|
private com.enterprisedt.net.ftp.FTPClient |
ftpClient
|
private java.lang.String |
localFilePath
|
private FileHandlerObservable |
observable
The Observable to use to notify successfull operation. |
private int |
operation
|
private java.lang.String |
remoteFilePath
|
private FTPThreadsPool |
threadsPool
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
FTPThread(com.enterprisedt.net.ftp.FTPClient ftpClient,
FTPThreadsPool threadsPool)
Constructor |
|
FTPThread(com.enterprisedt.net.ftp.FTPClient ftpClient,
FTPThreadsPool threadsPool,
FileHandlerObservable observable)
Constructor |
Method Summary | |
---|---|
void |
AssignDelete(java.lang.String remoteFilePath)
Prepares the thread for executing a delete operation. |
void |
AssignGet(java.lang.String localFilePath,
java.lang.String remoteFilePath)
Prepares the thread for executing a get operation. |
void |
AssignPut(java.lang.String localFilePath,
java.lang.String remoteFilePath)
Prepares the thread for executing a put operation. |
void |
finalize()
Finalizes the FTPThread by quiting the ftp connection. |
protected static void |
notifyObservers(FileHandlerObservable observable,
java.lang.String localFilePath,
java.lang.String remoteFilePath,
FileHandlerObservedObject.FileHandlerOperation operation)
Synchronized method to notify the observers. |
void |
run()
Thread Run Method. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String localFilePath
private java.lang.String remoteFilePath
private com.enterprisedt.net.ftp.FTPClient ftpClient
private FTPThreadsPool threadsPool
private int operation
private boolean bAssigned
private FileHandlerObservable observable
Constructor Detail |
---|
FTPThread(com.enterprisedt.net.ftp.FTPClient ftpClient, FTPThreadsPool threadsPool)
ftpClient
- The client to be used in this thread.threadsPool
- The Threads pool this FTPThread is part of.FTPThread(com.enterprisedt.net.ftp.FTPClient ftpClient, FTPThreadsPool threadsPool, FileHandlerObservable observable)
ftpClient
- The client to be used in this thread.threadsPool
- The Threads pool this FTPThread is part of.observable
- The Observable used to notify operationsMethod Detail |
---|
public void finalize()
FTPThread
by quiting the ftp connection.
finalize
in class java.lang.Object
Object.finalize()
public void AssignGet(java.lang.String localFilePath, java.lang.String remoteFilePath)
localFilePath
- The destination path on the local machine.remoteFilePath
- The source path on the server.public void AssignPut(java.lang.String localFilePath, java.lang.String remoteFilePath)
localFilePath
- The source path on the local machine.remoteFilePath
- The destination path on the server.public void AssignDelete(java.lang.String remoteFilePath)
remoteFilePath
- The path of the file to be deleted on the server.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected static void notifyObservers(FileHandlerObservable observable, java.lang.String localFilePath, java.lang.String remoteFilePath, FileHandlerObservedObject.FileHandlerOperation operation)
observable
- The observable object to use in the notifications.localFilePath
- local file name (null if remote only operation).remoteFilePath
- remote file name (null if local only operation).operation
- the applied operation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |