com.ptc.windchill.upgrade.tool
Class ProgressViewState

java.lang.Object
  extended bycom.ptc.windchill.upgrade.util.fsm.State
      extended bycom.ptc.windchill.upgrade.tool.AbstractState
          extended bycom.ptc.windchill.upgrade.tool.AbstractStateWithThreadedWork
              extended bycom.ptc.windchill.upgrade.tool.ProgressViewState

public class ProgressViewState
extends AbstractStateWithThreadedWork


Nested Class Summary
static class ProgressViewState.UpdateRunnerReportExists
          If a user cancels out of a step that uses this state before a migrator has been executed, an UpdateRunnerReport has not been created, that when it goes to the PhaseCompleted state, an unexpected error occurs.
 
Nested classes inherited from class com.ptc.windchill.upgrade.tool.AbstractStateWithThreadedWork
AbstractState.NonExpressPhaseDone, AbstractStateWithThreadedWork.Cancel, AbstractStateWithThreadedWork.IsStateWithThreadedWorkDone, AbstractStateWithThreadedWork.IsThreadedWorkRunningAndNotCanceled, AbstractStateWithThreadedWork.Outcome, AbstractStateWithThreadedWork.WasThreadedWorkOutcomeSuccessful
 
Field Summary
private  ApplicabilitySnapshotModel applicabilityModel_
           
private  UpgradeContext context_
           
private  DisplayProgressList displayList_
           
private static String EXECUTE_QUEUES_PROP
           
private  IndividualMigrators individualMigrator_
           
private static String LINE_SEPARATOR
           
private  String METHOD_SERVER_UP
           
private  boolean pageUp_
           
private  String phase_
           
private  JProgressBar progressBar_
           
private  String SERVLET_ENGINE_UP
           
private  int size_
           
private  UpdateRunnerReport updateRunnerReport_
           
private  String user_
           
private  JComponent viewComponent_
           
 
Fields inherited from class com.ptc.windchill.upgrade.tool.AbstractStateWithThreadedWork
 
Fields inherited from class com.ptc.windchill.upgrade.util.fsm.State
 
Constructor Summary
ProgressViewState(StateMachine sm, StateDefinition def)
          Create a new instance.
 
Method Summary
private  ApplicabilitySnapshotModel applicabilityModel()
           
private  void attemptToStartMethodServerIfNeeded(UpgradePhaseType current_phase)
          The last few steps after 'Add Constraints' require the use of the MethodServer to be successfully execited.
private  void attemptToStopMethodServerIfNeeded(UpgradePhaseType current_phase)
           
private  void checkForCancellation()
           
private  void deletePolicyACLs()
           
(package private) static void disableQueueProcessing()
           
private  void executeUpdateRunner()
          Executes the migrators that are applicable for the upgrade.
private  UpgradeToolStateMachine getUpgradeToolStateMachine()
           
 JComponent getViewComponent()
          Creates the GUI look for the steps that are excuting Incremental Updates.
private  Properties obtainServerStatus()
           
(package private) static void resetQueueProcessingEnabled()
           
private  int retrieveNumberOfFailedUpdates()
           
private  int retrieveNumberOfSkippedUpdates()
           
private  int retrieveNumberOfSuccessfulUpdates()
           
private  int retrieveNumberOfUpdatesExecuted()
           
protected  AbstractStateWithThreadedWork.Outcome runThreadedWork()
          Determines if the step requires the MethodServer or not, if not it executesUpdateRunner() method.
protected  boolean shouldBeEnclosed()
          Overrides the super classes value.
private  UpdateRunnerReport updateRunnerReport()
           
 
Methods inherited from class com.ptc.windchill.upgrade.tool.AbstractStateWithThreadedWork
activate, clearStatus, deactivate, getApplication, getCancellationMonitor, getCancelPromptMessage, getCancelPromptTitle, getTitle, onCancelRequested, setApplication, setStatus, toString
 
Methods inherited from class com.ptc.windchill.upgrade.util.fsm.State
getStateMachine, getStateMachine, isStartState, isStopState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

applicabilityModel_

private ApplicabilitySnapshotModel applicabilityModel_

size_

private int size_

viewComponent_

private JComponent viewComponent_

progressBar_

private JProgressBar progressBar_

individualMigrator_

private IndividualMigrators individualMigrator_

displayList_

private DisplayProgressList displayList_

phase_

private String phase_

user_

private String user_

context_

private UpgradeContext context_

updateRunnerReport_

private UpdateRunnerReport updateRunnerReport_

SERVLET_ENGINE_UP

private String SERVLET_ENGINE_UP

METHOD_SERVER_UP

private String METHOD_SERVER_UP

pageUp_

private boolean pageUp_

LINE_SEPARATOR

private static String LINE_SEPARATOR

EXECUTE_QUEUES_PROP

private static final String EXECUTE_QUEUES_PROP
See Also:
Constant Field Values
Constructor Detail

ProgressViewState

public ProgressViewState(StateMachine sm,
                         StateDefinition def)
Create a new instance.

Method Detail

shouldBeEnclosed

protected boolean shouldBeEnclosed()
Overrides the super classes value. The screens that display the migrators in a list are already in a scrollpane and it is not desired to have a scrollpane within a scrollpane.

Overrides:
shouldBeEnclosed in class AbstractState

getViewComponent

public JComponent getViewComponent()
Creates the GUI look for the steps that are excuting Incremental Updates. This method is required because it extends AbstractStateWithThreadedWork all classes that extend that class are required use this method.

Specified by:
getViewComponent in class AbstractState

checkForCancellation

private void checkForCancellation()
                           throws CanceledException
Throws:
CanceledException

runThreadedWork

protected AbstractStateWithThreadedWork.Outcome runThreadedWork()
                                                         throws Throwable
Determines if the step requires the MethodServer or not, if not it executesUpdateRunner() method. Once, it has completed its execution, it creates an instance of UpdateRunnerResults with all the necessary information that is needed to create the next state and the report.

Specified by:
runThreadedWork in class AbstractStateWithThreadedWork
Returns:
Outcome the state was successful in everything it needed to do and includes an instance of UpdateRunnerResults
Throws:
Throwable

executeUpdateRunner

private void executeUpdateRunner()
                          throws CanceledException,
                                 Exception
Executes the migrators that are applicable for the upgrade.

Throws:
Throwable - encounters an unexpected error
CanceledException
Exception

attemptToStartMethodServerIfNeeded

private void attemptToStartMethodServerIfNeeded(UpgradePhaseType current_phase)
                                         throws CanceledException,
                                                Throwable
The last few steps after 'Add Constraints' require the use of the MethodServer to be successfully execited. For these steps the web server/servlet engine, method server, and administrators user name and password are required. This method makes sure that all of these are up and running and then execute the applicable migrators.

Throws:
CanceledException
Throwable

obtainServerStatus

private Properties obtainServerStatus()
                               throws WTException,
                                      CanceledException
Throws:
WTException
CanceledException

attemptToStopMethodServerIfNeeded

private void attemptToStopMethodServerIfNeeded(UpgradePhaseType current_phase)
                                        throws IOException,
                                               StructConfManagerException
Throws:
IOException
StructConfManagerException

retrieveNumberOfSkippedUpdates

private int retrieveNumberOfSkippedUpdates()
Returns:
the number of migrators that were skipped can 0 or greater

retrieveNumberOfFailedUpdates

private int retrieveNumberOfFailedUpdates()
Returns:
the number of migrators that failed can 0 or greater

retrieveNumberOfSuccessfulUpdates

private int retrieveNumberOfSuccessfulUpdates()
Returns:
the number of migrators that failed can 0 or greater

retrieveNumberOfUpdatesExecuted

private int retrieveNumberOfUpdatesExecuted()

applicabilityModel

private ApplicabilitySnapshotModel applicabilityModel()
Returns:
ApplicabilitySnapshotModel

updateRunnerReport

private UpdateRunnerReport updateRunnerReport()
Returns:
UpdateRunnerReport

getUpgradeToolStateMachine

private UpgradeToolStateMachine getUpgradeToolStateMachine()
Returns:
UpgradeToolStateMachine

deletePolicyACLs

private void deletePolicyACLs()
                       throws Exception
Throws:
Exception

disableQueueProcessing

static void disableQueueProcessing()
                            throws IOException,
                                   StructConfManagerException
Throws:
IOException
StructConfManagerException

resetQueueProcessingEnabled

static void resetQueueProcessingEnabled()
                                 throws IOException,
                                        StructConfManagerException
Throws:
IOException
StructConfManagerException