RSE
Release 2.0

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

java.lang.Object
  extended by org.eclipse.rse.services.dstore.util.StatusChangeListener
All Implemented Interfaces:
org.eclipse.dstore.extra.IDomainListener
Direct Known Subclasses:
DStoreFileTransferStatusListener

public class StatusChangeListener
extends Object
implements org.eclipse.dstore.extra.IDomainListener


Nested Class Summary
protected static class StatusChangeListener.FindShell
           
 
Field Summary
protected  boolean _networkDown
           
protected  boolean cancelled
           
protected  boolean done
           
protected  Vector historyOfTargets
           
protected  IProgressMonitor monitor
           
protected  Shell shell
           
protected  org.eclipse.dstore.core.model.DataElement target
           
 
Constructor Summary
StatusChangeListener(Shell shell, IProgressMonitor monitor)
           
StatusChangeListener(Shell shell, IProgressMonitor monitor, org.eclipse.dstore.core.model.DataElement target)
          Construct a StatusChangeListener
 
Method Summary
protected  boolean determineStatusDone()
          Determines whether the status is done.
 void domainChanged(org.eclipse.dstore.extra.DomainEvent event)
           
 Shell getShell()
           
 org.eclipse.dstore.core.model.DataElement getStatus()
           
 boolean isNetworkDown()
          Test if the StatusChangeListener returned because the network connection to the remote system was broken.
 boolean isPassiveCommunicationsListener()
           
 boolean listeningTo(org.eclipse.dstore.extra.DomainEvent event)
           
 void setDone(boolean done)
          setDone(boolean)
 void setStatus(org.eclipse.dstore.core.model.DataElement p_target)
           
 org.eclipse.dstore.core.model.DataElement waitForUpdate()
          Wait for the the status DataElement to be refreshed.
 org.eclipse.dstore.core.model.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
 

Field Detail

target

protected org.eclipse.dstore.core.model.DataElement target

shell

protected Shell shell

monitor

protected IProgressMonitor monitor

_networkDown

protected boolean _networkDown

done

protected boolean done

cancelled

protected boolean cancelled

historyOfTargets

protected Vector historyOfTargets
Constructor Detail

StatusChangeListener

public StatusChangeListener(Shell shell,
                            IProgressMonitor monitor,
                            org.eclipse.dstore.core.model.DataElement target)
Construct a StatusChangeListener

Parameters:
shell - A valid Shell object
monitor - A progress monitor if you want this object to check if the user presses cancel while waiting for the status object to be updated
target - The status DataElement for which you wish to wait for an update

StatusChangeListener

public StatusChangeListener(Shell shell,
                            IProgressMonitor monitor)
Method Detail

setStatus

public void setStatus(org.eclipse.dstore.core.model.DataElement p_target)

getStatus

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

listeningTo

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

domainChanged

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

setDone

public void setDone(boolean done)
setDone(boolean)


getShell

public Shell getShell()

wasCancelled

public boolean wasCancelled()

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(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.

determineStatusDone

protected boolean determineStatusDone()
Determines whether the status is done.

Returns:
true if status done, false otherwise.

isPassiveCommunicationsListener

public boolean isPassiveCommunicationsListener()

isNetworkDown

public boolean isNetworkDown()
Test if the StatusChangeListener returned because the network connection to the remote system was broken.


RSE
Release 2.0

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