net.refractions.udig.catalog.ui.workflow
Class DataSourceSelectionState

java.lang.Object
  extended by net.refractions.udig.catalog.ui.workflow.Workflow.State
      extended by net.refractions.udig.catalog.ui.workflow.DataSourceSelectionState

public class DataSourceSelectionState
extends Workflow.State

First state in the data import worklow. This state chooses a data source based on the context of the workflow.

Author:
Justin Deoliveira,Refractions Research Inc.,jdeolive@refractions.net

Constructor Summary
DataSourceSelectionState(boolean validateServices)
          Create new Instance
 
Method Summary
 UDIGConnectionFactoryDescriptor getDescriptor()
           
 java.lang.String getName()
           
 boolean hasNext()
          Determines if the state can dynamically create a new state to be the next active state of the workflow.
 void init(IProgressMonitor monitor)
          Initialize the state.
 Workflow.State next()
          The final method in the lifecycle of the state.
 boolean run(IProgressMonitor monitor)
          Performs any "hard" work.
 void setDescriptor(UDIGConnectionFactoryDescriptor descriptor)
           
 
Methods inherited from class net.refractions.udig.catalog.ui.workflow.Workflow.State
getPreviousState, getWorkflow, setPrevious, setWorkflow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceSelectionState

public DataSourceSelectionState(boolean validateServices)
Create new Instance

Parameters:
validateServices - indicates whether the service should be probed for its members and metadata.
Method Detail

init

public void init(IProgressMonitor monitor)
          throws java.io.IOException
Description copied from class: Workflow.State
Initialize the state. This is the second method in the lifecycle of the state. It is called after #setPrevious(). If the state needs to "seed" itself with any context, that should occur here.

Overrides:
init in class Workflow.State
Throws:
java.io.IOException

run

public boolean run(IProgressMonitor monitor)
            throws java.io.IOException
Description copied from class: Workflow.State
Performs any "hard" work. This method is provided is provided for states which have to block to get work done. For instance, making a connection to a remote service. This method returns a boolean which signals wether the state was able to get the work done.

Overrides:
run in class Workflow.State
Parameters:
monitor - A progress monitor.
Returns:
True if the state was able to complete its job, otherwise false.
Throws:
java.io.IOException

hasNext

public boolean hasNext()
Description copied from class: Workflow.State
Determines if the state can dynamically create a new state to be the next active state of the workflow. Note, in most cases this is equivalent to next() != null. However some implemtnations require that next() be called only once, as it is a lifecycle event.

Overrides:
hasNext in class Workflow.State
Returns:
true if the state can create a new state, otherwise false.

next

public Workflow.State next()
Description copied from class: Workflow.State
The final method in the lifecycle of the state. This method is used for states to dynamically link to each other. This method returns null to indicate no state.

Overrides:
next in class Workflow.State
Returns:
A new state which is to become the next active state, otherwise null.

getDescriptor

public UDIGConnectionFactoryDescriptor getDescriptor()

setDescriptor

public void setDescriptor(UDIGConnectionFactoryDescriptor descriptor)

getName

public java.lang.String getName()
Specified by:
getName in class Workflow.State