RSE
Release 3.3

org.eclipse.rse.services.dstore.util
Class DownloadListener

java.lang.Object
  extended by org.eclipse.rse.services.dstore.util.DownloadListener
All Implemented Interfaces:
IDomainListener

public class DownloadListener
extends Object
implements IDomainListener


Constructor Summary
DownloadListener(DataElement status, File localFile, String remotePath, long totalLength, IProgressMonitor monitor)
           
 
Method Summary
 void cancelDownload()
           
 void domainChanged(DomainEvent event)
           
 DataElement getStatus()
           
 long getTotalLength()
           
 boolean isCancelled()
           
 boolean isDone()
           
 boolean listeningTo(DomainEvent event)
           
 void setDone(boolean done)
          setDone(boolean)
 DataElement waitForUpdate()
          Wait for the the status DataElement to be refreshed
 DataElement waitForUpdate(int wait)
          Wait for the the status DataElement to be refreshed
 boolean wasCancelled()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadListener

public DownloadListener(DataElement status,
                        File localFile,
                        String remotePath,
                        long totalLength,
                        IProgressMonitor monitor)
Method Detail

getTotalLength

public long getTotalLength()
Since:
3.0

isCancelled

public boolean isCancelled()

isDone

public boolean isDone()
Since:
3.0

getStatus

public DataElement getStatus()

listeningTo

public boolean listeningTo(DomainEvent event)
Specified by:
listeningTo in interface IDomainListener
See Also:
IDomainListener.listeningTo(DomainEvent)

domainChanged

public void domainChanged(DomainEvent event)
Specified by:
domainChanged in interface IDomainListener
See Also:
IDomainListener.domainChanged(DomainEvent)

setDone

public void setDone(boolean done)
setDone(boolean)


wasCancelled

public boolean wasCancelled()

waitForUpdate

public DataElement waitForUpdate()
                          throws InterruptedException
Wait for the the status DataElement to be refreshed

Returns:
The status DataElement after it has been updated, or the user has pressed cancel
Throws:
InterruptedException - if the thread was interrupted.

waitForUpdate

public DataElement waitForUpdate(int wait)
                          throws InterruptedException
Wait for the the status DataElement to be refreshed

Parameters:
wait - threshold for starting diagnostic. Default is 60 seconds; a zero means to use the default. -1 means to force a timeout; mainly for testing purpose.
Returns:
The status DataElement after it has been updated, or the user has pressed cancel
Throws:
InterruptedException - if the thread was interrupted.

cancelDownload

public void cancelDownload()

RSE
Release 3.3

Copyright (c) IBM Corporation and others 2000, 2011. All Rights Reserved.