RSE
Release 1.0

org.eclipse.rse.subsystems.files.dstore.old
Class DownloadListener

java.lang.Object
  extended byorg.eclipse.rse.subsystems.files.dstore.old.DownloadListener
All Implemented Interfaces:
ICommunicationsListener, org.eclipse.dstore.extra.internal.extra.IDomainListener, IServiceConstants, IUniversalDataStoreConstants

public class DownloadListener
extends Object
implements org.eclipse.dstore.extra.internal.extra.IDomainListener, ICommunicationsListener, IUniversalDataStoreConstants


Field Summary
 
Fields inherited from interface org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants
BINARY_MODE, BUFFER_SIZE, C_COPY, C_COPY_BATCH, C_CREATE_FILE, C_CREATE_FOLDER, C_DELETE, C_DELETE_BATCH, C_DOWNLOAD_FILE, C_QUERY_GET_REMOTE_OBJECT, C_QUERY_QUALIFIED_CLASSNAME, C_QUERY_ROOTS, C_QUERY_UNUSED_PORT, C_QUERY_VIEW_ALL, C_QUERY_VIEW_FILES, C_QUERY_VIEW_FOLDERS, C_RENAME, C_SYSTEM_ENCODING, DOWNLOAD_RESULT_EXCEPTION, DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION, DOWNLOAD_RESULT_IO_EXCEPTION, DOWNLOAD_RESULT_SUCCESS_MESSAGE, DOWNLOAD_RESULT_SUCCESS_TYPE, DOWNLOAD_RESULT_UNEXPECTED_ERROR, DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION, KB_IN_BYTES, MESSAGE_DESCRIPTOR, NUM_OF_KB, TEXT_MODE, TYPE_QUALIFIED_CLASSNAME, UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR, UNIVERSAL_FILE_DESCRIPTOR, UNIVERSAL_FILESYSTEM_MINER, UNIVERSAL_FILTER_DESCRIPTOR, UNIVERSAL_FOLDER_DESCRIPTOR, UNIVERSAL_NODE_DESCRIPTOR, UNIVERSAL_TEMP_DESCRIPTOR, UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR, UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR
 
Fields inherited from interface org.eclipse.rse.services.clientserver.IServiceConstants
FAILED, FAILED_TO_DELETE_DIR, FAILED_WITH_DOES_NOT_EXIST, FAILED_WITH_EXCEPTION, FAILED_WITH_EXIST, FAILED_WITH_SECURITY, SUCCESS, TOKEN_SEPARATOR, UNEXPECTED_ERROR, VERSION_1
 
Constructor Summary
DownloadListener(Shell shell, IProgressMonitor monitor, IConnectorService system, org.eclipse.dstore.core.model.DataElement status, File localFile, String remotePath, long totalLength)
           
 
Method Summary
 void cancelDownload()
           
 void communicationsStateChange(CommunicationsEvent e)
          This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes.
 void domainChanged(org.eclipse.dstore.extra.internal.extra.DomainEvent event)
           
 Shell getShell()
           
 org.eclipse.dstore.core.model.DataElement getStatus()
           
 boolean isCancelled()
           
 boolean isPassiveCommunicationsListener()
          This method determines if the communications listener is a passive or active listener.
 boolean listeningTo(org.eclipse.dstore.extra.internal.extra.DomainEvent event)
           
 void setDone(boolean done)
          setDone(boolean)
 org.eclipse.dstore.core.model.DataElement waitForUpdate()
          Wait for the the status DataElement to be refreshed
 org.eclipse.dstore.core.model.DataElement waitForUpdate(ICommunicationsDiagnosticFactory factory)
           
 org.eclipse.dstore.core.model.DataElement waitForUpdate(ICommunicationsDiagnosticFactory factory, int wait)
           
 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(Shell shell,
                        IProgressMonitor monitor,
                        IConnectorService system,
                        org.eclipse.dstore.core.model.DataElement status,
                        File localFile,
                        String remotePath,
                        long totalLength)
Method Detail

isCancelled

public boolean isCancelled()

getStatus

public org.eclipse.dstore.core.model.DataElement getStatus()

listeningTo

public boolean listeningTo(org.eclipse.dstore.extra.internal.extra.DomainEvent event)
Specified by:
listeningTo in interface org.eclipse.dstore.extra.internal.extra.IDomainListener
See Also:
IDomainListener.listeningTo(DomainEvent)

domainChanged

public void domainChanged(org.eclipse.dstore.extra.internal.extra.DomainEvent event)
Specified by:
domainChanged in interface org.eclipse.dstore.extra.internal.extra.IDomainListener
See Also:
IDomainListener.domainChanged(DomainEvent)

setDone

public void setDone(boolean done)
setDone(boolean)


getShell

public Shell getShell()
See Also:
IDomainListener#getShell()

wasCancelled

public boolean wasCancelled()

communicationsStateChange

public void communicationsStateChange(CommunicationsEvent e)
Description copied from interface: ICommunicationsListener
This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes. The state field in CommunicationsEvent determines which state change is about to or has occured.

Specified by:
communicationsStateChange in interface ICommunicationsListener
See Also:
ICommunicationsListener.communicationsStateChange(CommunicationsEvent)

isPassiveCommunicationsListener

public boolean isPassiveCommunicationsListener()
Description copied from interface: ICommunicationsListener
This method determines if the communications listener is a passive or active listener. Typically a passive listener registers with the communications system and responds to events as they occur. An active listener typically registeres with the communications system only for the duration of the task (i.e. user editing a file, or outstanding communications request.) The user will be prompted on a disconnect if there are any active communication listeners registered.

Specified by:
isPassiveCommunicationsListener in interface ICommunicationsListener
Returns:
false if the communications listener is an active listener, true if the communications listener is a passive listener.
See Also:
ICommunicationsListener.isPassiveCommunicationsListener()

waitForUpdate

public org.eclipse.dstore.core.model.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 org.eclipse.dstore.core.model.DataElement waitForUpdate(ICommunicationsDiagnosticFactory factory)
                                                        throws InterruptedException
Throws:
InterruptedException

waitForUpdate

public org.eclipse.dstore.core.model.DataElement waitForUpdate(ICommunicationsDiagnosticFactory factory,
                                                               int wait)
                                                        throws InterruptedException
Throws:
InterruptedException

cancelDownload

public void cancelDownload()

RSE
Release 1.0

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