org.eclipse.ecf.filetransfer.events
Interface IFileTransferConnectStartEvent

All Superinterfaces:
Event, org.eclipse.core.runtime.IAdaptable, IFileTransferEvent

public interface IFileTransferConnectStartEvent
extends org.eclipse.core.runtime.IAdaptable, IFileTransferEvent

Event sent to IFileTransferListener associated with IIncomingFileTransfer or IOutgoingFileTransferEvent or IRemoteFileSystemRequest instances.

The event is send before the first request is send to the server. It allows the caller to get a handle to the transfer so that it can be canceled. A transfer may have to send several requests to one (or more servers) until the retrieved or send data itself is send or received. The entire phase before this is referred here as connect phase.

If connectUsingJob(FileTransferJob) is called then the connect phase is performed in a job. If not the caller may implement their own thread in which it can cancel the request. The expectation is that the cancellation will react with little delay, typically in less than 1 second.

Not all providers support this event.

Since:
3.0

Method Summary
 void cancel()
          Cancel file transfer.
 void connectUsingJob(FileTransferJob connectJob)
          Connect using a job.
 IFileID getFileID()
           
 FileTransferJob prepareConnectJob(FileTransferJob connectJob)
          Prepare custom connect job or get default connect job.
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Method Detail

getFileID

IFileID getFileID()

cancel

void cancel()
Cancel file transfer.


prepareConnectJob

FileTransferJob prepareConnectJob(FileTransferJob connectJob)
Prepare custom connect job or get default connect job.

As a result the connect job will be tied to the transfer. Only if the returned job is passed into connectUsingJob(FileTransferJob) will it actually be scheduled to run.

Parameters:
connectJob - A subclass of FileTransferJob to use to run the connection process. If null, the provider will use create and prepare a default connect job. NOTE: the given job should *not* be scheduled/started prior to being provided as a parameter to this method.
Returns:
passed in job or default connect job if parameter connectJob was null.

connectUsingJob

void connectUsingJob(FileTransferJob connectJob)
Connect using a job.

The passed in connectJob must have been prepared using prepareConnectJob(FileTransferJob). The job may be scheduled after the caller returns from handling of the IFileTransferConnectStartEvent. As this is provider implementation specific it must not relied on.

Parameters:
connectJob - A subclass of FileTransferJob to use to run the connection process. Must not be null. NOTE: the given job should *not* be scheduled/started prior to being provided as a parameter to this method.