public abstract class AsyncResult
extends java.lang.Object
Constructor and Description |
---|
AsyncResult() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancelTask()
Cancel the asynchronous task that this result is for.
|
boolean |
endAsyncCalled()
Has endAsync() been called?
|
protected void |
endAsyncInternal()
Internal method that returns when the async method is completed.
|
AsyncFileTransferClient |
getClient()
Get a reference to the asynchronous client
|
com.enterprisedt.net.ftp.async.internal.SecureConnectionContext |
getLocalContext()
Get a reference to the local connection context.
|
java.lang.Object |
getTag()
Get the tag object that has been saved in the result
|
com.enterprisedt.net.ftp.async.internal.Task |
getTask() |
java.lang.String |
getTaskDescription()
Get a description of the task this result is for
|
int |
getTaskId()
Get the task id
|
java.lang.Throwable |
getThrowable()
If endAsync() is not called, the thrown exception (if indeed
an exception has been thrown) can be accessed via this method.
|
boolean |
isCompleted()
Has the asynchronous operation completed? This can be used to
poll for completion.
|
boolean |
isSuccessful()
Was the operation successful, i.e.
|
void |
notifyComplete()
Notifies waiting threads that the operation is complete
|
void |
setAsIfCompleted()
Calls everything needed to pretend this is the
result of a task that has completed
|
void |
setClient(AsyncFileTransferClient asyncClient)
Set the async client
|
protected void |
setEndAsyncCalled()
Set the flag indicating if endAsync() has been
called to true.
|
void |
setLocalContext(com.enterprisedt.net.ftp.async.internal.SecureConnectionContext localContext)
Set the local context
|
void |
setSuccessful(boolean success)
Set the flag for success (or failure).
|
void |
setTag(java.lang.Object tag)
Set the tag object
|
void |
setTask(com.enterprisedt.net.ftp.async.internal.Task task)
Set the task associated with this result
|
void |
setThrowable(java.lang.Throwable throwable) |
protected void |
waitTillComplete()
Waits until the async operation is completed.
|
public com.enterprisedt.net.ftp.async.internal.SecureConnectionContext getLocalContext()
public void setLocalContext(com.enterprisedt.net.ftp.async.internal.SecureConnectionContext localContext)
localContext
- local contextpublic AsyncFileTransferClient getClient()
public void setClient(AsyncFileTransferClient asyncClient)
asyncClient
- reference to the clientpublic void setTag(java.lang.Object tag)
tag
- tag to save in resultpublic java.lang.Object getTag()
public java.lang.String getTaskDescription()
public boolean isSuccessful()
public void setSuccessful(boolean success)
success
- true if operation succeeded, false otherwisepublic void setTask(com.enterprisedt.net.ftp.async.internal.Task task)
task
- associated taskpublic com.enterprisedt.net.ftp.async.internal.Task getTask()
public boolean cancelTask() throws FTPException
FTPException
public int getTaskId()
public java.lang.Throwable getThrowable()
public boolean endAsyncCalled()
protected void setEndAsyncCalled()
public boolean isCompleted()
public void setThrowable(java.lang.Throwable throwable)
public void setAsIfCompleted()
protected void waitTillComplete()
protected void endAsyncInternal() throws FTPException, java.io.IOException
FTPException
java.io.IOException
public void notifyComplete()
Copyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.