Remote Systems
v6.4.1

com.ibm.etools.systems.universal.util
Class StatusChangeListener

java.lang.Object
  extended bycom.ibm.etools.systems.universal.util.StatusChangeListener
All Implemented Interfaces:
ICommunicationsListener, IDomainListener
Direct Known Subclasses:
FileTransferStatusListener

public class StatusChangeListener
extends Object
implements IDomainListener, ICommunicationsListener


Nested Class Summary
protected  class StatusChangeListener.FindShell
           
 
Field Summary
protected  boolean _networkDown
           
protected  boolean cancelled
           
static String copyright
           
protected  boolean done
           
protected  Vector historyOfTargets
           
protected  IProgressMonitor monitor
           
protected  Shell shell
           
protected  ISystem system
           
protected  DataElement target
           
 
Fields inherited from interface com.ibm.etools.systems.dstore.extra.internal.extra.IDomainListener
Copyright
 
Constructor Summary
StatusChangeListener(ISystem system)
           
StatusChangeListener(Shell shell, IProgressMonitor monitor, ISystem system)
           
StatusChangeListener(Shell shell, IProgressMonitor monitor, ISystem system, DataElement target)
          Construct a StatusChangeListener
 
Method Summary
 void communicationsStateChange(CommunicationsEvent e)
          This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes.
protected  boolean determineStatusDone()
          Determines whether the status is done.
 void domainChanged(DomainEvent event)
           
 Shell getShell()
           
 DataElement getStatus()
           
 boolean isNetworkDown()
          Test if the StatusChangeListener returned because the network connection to the remote system was broken.
 boolean isPassiveCommunicationsListener()
          This method determines if the communications listener is a passive or active listener.
 boolean listeningTo(DomainEvent event)
           
 void setDone(boolean done)
          setDone(boolean)
 void setStatus(DataElement p_target)
           
 DataElement waitForUpdate()
          Wait for the the status DataElement to be refreshed
 DataElement waitForUpdate(ICommunicationsDiagnosticFactory factory)
           
 DataElement waitForUpdate(ICommunicationsDiagnosticFactory factory, int wait)
           
 boolean wasCancelled()
           
 ICommunicationsDiagnostic whatIsGoingOn(ICommunicationsDiagnosticFactory factory, boolean quiet)
          Start diagnostic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

target

protected DataElement target

shell

protected Shell shell

monitor

protected IProgressMonitor monitor

system

protected ISystem system

_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,
                            ISystem system,
                            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,
                            ISystem system)

StatusChangeListener

public StatusChangeListener(ISystem system)
Method Detail

setStatus

public void setStatus(DataElement p_target)

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)


getShell

public Shell getShell()
Specified by:
getShell in interface IDomainListener
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)

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(ICommunicationsDiagnosticFactory factory)
                          throws InterruptedException
Throws:
InterruptedException

waitForUpdate

public DataElement waitForUpdate(ICommunicationsDiagnosticFactory factory,
                                 int wait)
                          throws InterruptedException
Throws:
InterruptedException

determineStatusDone

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

Returns:
true if status done, false otherwise.

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

whatIsGoingOn

public ICommunicationsDiagnostic whatIsGoingOn(ICommunicationsDiagnosticFactory factory,
                                               boolean quiet)
                                        throws InterruptedException
Start diagnostic

Returns:
ICommunciationsDiagnostic class instance
Throws:
InterruptedException

isNetworkDown

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


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.