org.globus.cog.abstraction.impl.fileTransfer
Class DelegatedFileTransferHandler

java.lang.Object
  extended byorg.globus.cog.abstraction.impl.fileTransfer.DelegatedFileTransferHandler
All Implemented Interfaces:
DelegatedTaskHandler, Runnable, UrlCopyListener
Direct Known Subclasses:
CachingDelegatedFileTransferHandler

public class DelegatedFileTransferHandler
extends Object
implements DelegatedTaskHandler, Runnable, UrlCopyListener


Constructor Summary
DelegatedFileTransferHandler()
           
 
Method Summary
 void cancel()
           
protected  FileResource getDestinationResource()
           
protected  FileResource getSourceResource()
           
 void resume()
           
 void run()
           
protected  void setDestinationResource(FileResource destinationResource)
           
protected  void setSourceResource(FileResource sourceResource)
           
protected  FileResource startResource(Service service)
           
protected  void stopResources()
           
 void submit(Task task)
          This method is responsible for submitting the given Task to the remote Service in compliance with the appropriate provider.
 void suspend()
           
 void transfer(long current, long total)
           
 void transferCompleted()
           
 void transferError(Exception error)
           
protected  void transferUsingFileResources(Service sourceService, Service destinationService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatedFileTransferHandler

public DelegatedFileTransferHandler()
Method Detail

submit

public void submit(Task task)
            throws IllegalSpecException,
                   InvalidSecurityContextException,
                   InvalidServiceContactException,
                   TaskSubmissionException
Description copied from interface: DelegatedTaskHandler
This method is responsible for submitting the given Task to the remote Service in compliance with the appropriate provider. It executes in a seperate thread of execution so that it doesnt block the submission of other tasks.

Specified by:
submit in interface DelegatedTaskHandler
Parameters:
task - the task to be executed
Throws:
IllegalSpecException - when the specification does not confirm to the type of the task and the given provider.
TaskSubmissionException - when a generic exception occurs prohibiting the submission of the task.
InvalidServiceContactException - when the service contact of the remote service in invalid.
InvalidSecurityContextException - when the security context associated with the task in invalid.

suspend

public void suspend()
             throws InvalidSecurityContextException,
                    TaskSubmissionException
Specified by:
suspend in interface DelegatedTaskHandler
Throws:
InvalidSecurityContextException
TaskSubmissionException

resume

public void resume()
            throws InvalidSecurityContextException,
                   TaskSubmissionException
Specified by:
resume in interface DelegatedTaskHandler
Throws:
InvalidSecurityContextException
TaskSubmissionException

cancel

public void cancel()
            throws InvalidSecurityContextException,
                   TaskSubmissionException
Specified by:
cancel in interface DelegatedTaskHandler
Throws:
InvalidSecurityContextException
TaskSubmissionException

transferUsingFileResources

protected void transferUsingFileResources(Service sourceService,
                                          Service destinationService)
                                   throws InvalidServiceContactException,
                                          TaskSubmissionException,
                                          IllegalSpecException
Throws:
InvalidServiceContactException
TaskSubmissionException
IllegalSpecException

startResource

protected FileResource startResource(Service service)
                              throws InvalidProviderException,
                                     ProviderMethodException,
                                     IllegalHostException,
                                     InvalidSecurityContextException,
                                     GeneralException
Throws:
InvalidProviderException
ProviderMethodException
IllegalHostException
InvalidSecurityContextException
GeneralException

run

public void run()
Specified by:
run in interface Runnable

stopResources

protected void stopResources()

setDestinationResource

protected void setDestinationResource(FileResource destinationResource)

setSourceResource

protected void setSourceResource(FileResource sourceResource)

getDestinationResource

protected FileResource getDestinationResource()

getSourceResource

protected FileResource getSourceResource()

transfer

public void transfer(long current,
                     long total)
Specified by:
transfer in interface UrlCopyListener

transferError

public void transferError(Exception error)
Specified by:
transferError in interface UrlCopyListener

transferCompleted

public void transferCompleted()
Specified by:
transferCompleted in interface UrlCopyListener