|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.upgrade.ius.UpgradeContext
Nested Class Summary | |
private class |
UpgradeContext.SystemPropertyCop
This thread will very frequently monitor the Properties object being used for System properties. |
private class |
UpgradeContext.SystemPropertyMonitor
This class will monitory System.getProperties() for property adds, changes, and removes. |
Constructor Summary | |
private |
UpgradeContext(String[] args)
Initializes a UpgradeContext object. |
Method Summary | |
UpgradeStep |
advanceStep()
Determines the next step, after the initial step is determined by currentStep(). |
private String |
convertToValueOfEnumeratedTypeTrimmed(String instance)
Converts the getDisplay() value with spaces to one without spaces this is needed for the folders that store the migrators and the reports. |
private void |
copyMissingToSystemProperties(Properties orig)
|
private void |
copyWtToSystemProperties()
|
static void |
createInstance(String[] args)
Create the context instance. |
private ReleaseId[] |
determineSourceVersions()
The Source ReleaseId data is read from the database and may be multiple sorted entries. |
private void |
ensureCompletedInstallationExistsForSourceVersions(ReleaseId[] source_versions)
Records the specified source version as complete in the install and upgrade history. |
String |
fileDateTS(Date generated_file_date)
Date and Time Stamp format is chosen for adding to the report name |
String |
formattedHostPortSid()
Obtain the database host:port:sid from db.properties. |
Connection |
getConnection()
Created a connection to the database |
String |
getCurrentPhase()
|
UpgradeStep |
getCurrentStep()
upgradeStep_ is set to a value as soon as the UpgradeManager is started. |
String |
getDbServiceName()
|
String |
getDbUser()
|
InstallAndUpgradeHistory |
getInstallAndUpgradeHistory()
|
static UpgradeContext |
getInstance()
Loads the instance_ |
boolean |
getIsFirstUpgrade()
|
private ReleaseId[] |
getLikelySourceVersions()
Look up the most recent version step's version from the update history. |
private MethodContext |
getMethodContext()
|
File |
getPhaseAddConstraintsPath()
|
File |
getPhaseCompareSchemaPath()
|
File |
getPhasePath()
|
File |
getPhaseReportPath()
Return a File for the directory WT_HOME/UpgradeReports/appropriate_step |
String |
getPhaseTrimmedString()
|
File |
getPhaseUpgradeSchemaPath()
|
String |
getPhaseValue(UpgradePhaseType verify_phase)
|
PersistentObjectManager |
getPom()
|
File |
getReportAddConstraintsPath()
|
File |
getReportCompareSchemaPath()
|
String |
getReportFolderTrimmed()
Folder of the report for each step matches the new names of the step |
String |
getReportIndexDateTS()
|
File |
getReportJarFile()
|
File |
getReportPath()
|
File |
getReportUpgradeSchemaPath()
|
ReleaseId[] |
getSourceVersions()
May return a null array. |
ArrayList |
getStepList()
|
ReleaseId[] |
getTargetVersions()
Retrieves the Windchill Version the user is upgrading to. |
private boolean |
getUpdateDirectivesInstalled()
|
UpdateStore |
getUpdateStore()
Retrieves the UpdateStore that was set in setUpgradeStore |
File |
getUpgradePath()
|
File |
getUpgradePhasePath()
phasePath_ is the path to folders of the UpgradePhases and the directories with migrators are located. |
UpgradePhaseType |
getUpgradePhaseType()
A getter method |
Object[] |
getUpgradeStores()
Called by the class ListIncrementalUpdates, to retrieve all the different directories used by the UpgradeManager. |
private WTProperties |
getWtProperties()
returns wtProperties_ WTProperties |
void |
initializeInstallAndUpgradeHistory()
Connects to the resource providing the install and upgrade history creating an initial version if necessary. |
void |
initializePhaseStores()
Loads ALL the UpdateStores and places values in the variables: upgradePhaseValues_, upgradePhaseValuesTrimmed_, upgradePhaseStores_, upgradePhaseTypeHashMap_ |
void |
initializeVersions()
Initializes source and target versions. |
void |
installUpdateDirectives()
The directive(s) for the upgradePhaseType_ is being loaded as needed. |
boolean |
isStepInProgress()
Used by PhaseTitleSideBanner to determine if a step should be marked in progress or not |
boolean |
isStepSuccessful()
Used by PhaseTitleSideBanner to determine if a step should be marked successful or not If false is returned the step will be marked as failed, if true is returned the step will be marked as successful. |
private void |
markPrecedingUpgradePhasesIncomplete()
A failure occurred at step UpgradeStep.UPGRADE_SCHEMA or UpgradeStep.ADD_CONSTRAINTS, all the preceding steps that have phases associated with it should be marked incomplete. |
void |
markStepFailed()
Notifies the UpgradeContextListener to mark the current step with the appropriate icon Failed. |
void |
markStepInProgress()
Notifies the UpgradeContextListener to mark the current step with the appropriate icon InProgress. |
void |
markStepSuccessful()
The step that was just completed was successful and is marked accordingly in the database and in the left-hand menu with the appropriate icon. |
void |
reset()
This method is executed every time an User clicks the 'Restart' button. |
void |
resetServerVariables()
Loads wtproperties, overrides a few property values, copies all properties to System properties, calls service method to init InfoEngine, then remerges any System properties back into system properties in case the InfoEngine code removed them with System.setProperties(). |
void |
setDateFormatForReportIndex(Date start)
sets the date that will be used in the Index.xsl file to format the index.html file |
void |
setStepList(ArrayList upg_steps)
Steps to be listed on the left-hand side of the UpgradeManager. |
void |
settingValueOfIsFirstUpgrade()
|
void |
setUpdateDirectivesInstalled(boolean installed)
When a phase has been marked as completed, the directives needed have to be reset. |
void |
setUpgradeContextListener(UpgradeContextListener upg_listener)
Sets an instance of UpgradeContextListener |
(package private) void |
setUpgradePhaseType(UpgradePhaseType phase_type)
|
void |
setUpgradePhaseTypeByUpdateStore(UpdateStore current_store)
upgradePhaseType_ needs to have a value other than null when using the UpgradeManager -listius option to determine the correct dtd file for the UpdateStore being loaded. |
void |
setUpgradeStore(UpgradePhaseType phase)
Once the UpgradePhaseType has been determined the appropriate folder is loaded and the appropriate step is marked as in progress. |
private boolean |
sourceVersionsConsistentWithTargetVersions(ReleaseId[] source_versions)
Checks that user is upgrading ProjectLink to ProjectLink or Windchill to a new Windchill release. |
void |
stepStatusNotifyChange(UpgradeStep step)
This method is used by the PhaseTitleSideBanner class to reflect the steps status with the appropriate icon. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String COMPARE_SCHEMA_DIR
private static final String UPGRADE_SCHEMA_DIR
private static final String ADD_CONSTRAINTS_DIR
private static final String JAR_FILE_NAME
private static final String ACCESS_CONTROL_PROPERTY_NAME
private static UpgradeContext instance__
private ArrayList steps_
private boolean currentStepInProgress
private boolean currentStepSuccessful
private boolean updateDirectivesInstalled_
private boolean firstUpgrade_
private File upgradeDir_
private File upgradePhasesDir_
private File upgradeReportsDir_
private File phasePath_
private File tempJarFile_
private HashMap upgradePhaseStores_
private HashMap upgradePhaseTypeHashMap_
private HashMap upgradePhaseValues_
private HashMap upgradePhaseValuesTrimmed_
private HashMap upgradePhaseValuesTrimmedForReports_
private InstallAndUpgradeHistory installAndUpgradeHistory_
private UpdateStore updateStore_
private UpgradeStep upgradeStep_
private UpgradeContextListener listener_
private UpgradePhaseType upgradePhaseType_
private String currentPhase_
private String indexDate_
private int num_of_phases_executed
private ReleaseId[] targetVersions_
private ReleaseId[] sourceVersions_
private WTProperties wtProperties_
Constructor Detail |
private UpgradeContext(String[] args) throws UpgradeContextException
args
- String[] Command line arguments when the UpgradeManager is started.Method Detail |
public void setUpgradeContextListener(UpgradeContextListener upg_listener)
upg_listener
- UpgradeContextListenerpublic void resetServerVariables() throws UpgradeContextException
UpgradeContextException
- It is thrown when having problems loading the wt.propertiesprivate void copyWtToSystemProperties()
private void copyMissingToSystemProperties(Properties orig)
public void setStepList(ArrayList upg_steps)
public ArrayList getStepList()
public UpgradeStep getCurrentStep() throws IUHException
IUHException
public static void createInstance(String[] args) throws UpgradeContextException
UpgradeContextException
- if the context cannot be initialized for some reasoninitializeInstallAndUpgradeHistory()
,
initializeVersions()
public static UpgradeContext getInstance()
IllegalStateException
- when an instance of UpgradeContext has not been created before
UpgradeContext.getInstance() is called.public void initializeVersions() throws UpgradeContextException
UpgradeContextException
public void initializeInstallAndUpgradeHistory() throws UpgradeContextException
UpgradeContextException
public void initializePhaseStores()
private String convertToValueOfEnumeratedTypeTrimmed(String instance)
public void installUpdateDirectives() throws UpgradeContextException
UpgradeContextException
public final void setUpgradeStore(UpgradePhaseType phase) throws IUHException
phase
- UpgradePhaseType
IUHException
- An error has been encountered when loading the UpdateStorefinal void setUpgradePhaseType(UpgradePhaseType phase_type)
public UpgradePhaseType getUpgradePhaseType()
public final File getUpgradePhasePath()
public Object[] getUpgradeStores()
public final UpdateStore getUpdateStore()
public final InstallAndUpgradeHistory getInstallAndUpgradeHistory()
public final ReleaseId[] getSourceVersions()
public final ReleaseId[] getTargetVersions()
private MethodContext getMethodContext() throws UnsupportedPDSException, UnknownHostException
UnsupportedPDSException
UnknownHostException
public final Connection getConnection() throws Exception
getConnection
in interface ConnectionProvider
Exception
public final PersistentObjectManager getPom() throws Exception
Exception
private ReleaseId[] getLikelySourceVersions() throws UpgradeContextException
UpgradeContextException
public String getDbServiceName()
public String getDbUser()
public void reset() throws IUHException
IUHException
public UpgradeStep advanceStep() throws IUHException
IUHException
- If a problem is encountered when retrieving the InstallAndUpgradeHistoryprivate void markPrecedingUpgradePhasesIncomplete() throws IUHException
IUHException
- If a problem is encountered when retrieving the InstallAndUpgradeHistorypublic void markStepSuccessful() throws IUHException
IUHException
- If a problem is encountered when retrieving the InstallAndUpgradeHistorypublic void markStepFailed() throws IUHException
IUHException
- If a problem is encountered when retrieving the InstallAndUpgradeHistorypublic void markStepInProgress() throws IUHException
IUHException
- If a problem is encountered when retrieving the InstallAndUpgradeHistorypublic String fileDateTS(Date generated_file_date)
generated_file_date
- Current date and time
public String formattedHostPortSid()
public void setDateFormatForReportIndex(Date start)
public String getReportIndexDateTS()
public String getCurrentPhase()
public void setUpgradePhaseTypeByUpdateStore(UpdateStore current_store)
current_store
- UpdateStorepublic String getPhaseValue(UpgradePhaseType verify_phase)
public File getReportJarFile()
private void ensureCompletedInstallationExistsForSourceVersions(ReleaseId[] source_versions)
WTRuntimeException
- if an error occurs recording the version in the historypublic boolean isStepInProgress()
public boolean isStepSuccessful()
private ReleaseId[] determineSourceVersions() throws UpgradeContextException
UpgradeContextException
private boolean sourceVersionsConsistentWithTargetVersions(ReleaseId[] source_versions)
public void stepStatusNotifyChange(UpgradeStep step)
private WTProperties getWtProperties()
public void setUpdateDirectivesInstalled(boolean installed)
installed
- booleanprivate boolean getUpdateDirectivesInstalled()
public File getUpgradePath()
public File getPhasePath()
public File getReportPath()
public File getPhaseCompareSchemaPath()
public File getPhaseUpgradeSchemaPath()
public File getPhaseAddConstraintsPath()
public File getReportCompareSchemaPath()
public File getReportUpgradeSchemaPath()
public File getReportAddConstraintsPath()
public String getPhaseTrimmedString()
public String getReportFolderTrimmed()
public File getPhaseReportPath()
public void settingValueOfIsFirstUpgrade() throws IUHException
IUHException
public boolean getIsFirstUpgrade()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |