|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.upgrade.history.IUHPersistenceDelegate
com.ptc.windchill.upgrade.history.JdbcIUHPersistenceDelegate
Fields inherited from class com.ptc.windchill.upgrade.history.IUHPersistenceDelegate |
|
Constructor Summary | |
JdbcIUHPersistenceDelegate(ConnectionProvider connection_provider)
Creates a new JdbcIUHPersistenceDelegate object. |
Method Summary | |
protected boolean |
areAssembliesDirty(Installation installation)
|
protected boolean |
areInstallationsDirty()
|
protected boolean |
areIUApplicationsDirty(UpgradePhase upgrade_phase)
|
protected boolean |
areUpgradePhasesDirty(Installation installation)
|
protected void |
clear()
Removes all contents from the history. |
protected void |
clearNewHistoryTables(Connection connection)
Removes all contents from the history. |
private Transaction |
commitTransaction(Transaction transaction)
|
protected Assembly |
createAssembly(Installation installation,
ReleaseId release_identifier)
Adding a new entry to the WTUPGINST_VERSIONEDASSEMBLY table |
protected Installation |
createInstallation(Date timestamp)
Adding an installation to the WTUPGINST_INSTALLATION table. |
protected IUApplication |
createIUApplication(UpgradePhase upgrade_phase,
UUID uuid,
String name)
Adding an entry to the table WTUPGINST_INCREMENTALUPDATE after a migrator was successfully completed. |
private String |
createTableFor(String table_name)
|
private void |
createTableIfNecessary(String table_name)
|
protected UpgradePhase |
createUpgradePhase(Installation installation,
UpgradePhaseType phase_type)
Adding an UpgradePhase to the table WTUPGINST_UPGRADEPHASE corresponding to an installation |
private String |
deleteAllFor(String table_name)
|
private void |
ensureTablesExist()
|
protected void |
flush()
Saves uncommitted work done in the current thread. |
protected ArrayList |
getAssemblies(Installation installation)
|
private Connection |
getConnection()
|
private static String[][] |
getDefFor(String table_name)
|
protected ArrayList |
getInstallations()
Retrieves the installation that are stored in the database. |
protected ArrayList |
getIUApplications(UpgradePhase upgrade_phase)
Retrieves all the IncrementalUpdates that have been executed for a specific UpgradePhase that is in the table. |
protected ArrayList |
getUpgradePhases(Installation installation)
Retrieves all the entries of Installation in the table WTUPGINST_INSTALLATION |
private String |
insertFor(String table_name)
|
protected boolean |
isComplete(Installation installation)
Able to find out if the Installation is complete or not |
protected boolean |
isComplete(UpgradePhase upgrade_phase)
Able to check if an UpgradePhase is complete or not complete. |
private boolean |
isSchema62()
The schema is 6.2 |
private boolean |
isSchema623()
The schema is 6.2.3 |
private boolean |
isSchemaPre62()
The schema is pre-6.2 |
protected void |
markComplete(Installation installation,
boolean complete)
Marks the installation complete |
protected void |
markComplete(UpgradePhase upgrade_phase,
boolean complete)
Marking the Upgrade Phase as complete. |
private void |
migrate623To7()
|
private void |
migrate623WtUpgInstAssemblyTo7(Connection conn)
|
private void |
migrate623WTVersionStepTo7(Connection conn)
|
private void |
migrate62To7()
select versions add assembly id insert into assembly table with new release identifiers drop version column from versionstep |
private void |
migrate62WTVersionStepTo7(Connection conn)
|
private void |
migratePre62To7()
|
private void |
migratePre62WTVersionStepTo7(Connection conn)
|
private void |
migrateWtIncrementalUpdateTo7(Connection conn)
|
private void |
migrationInsertInstallation(int installation_id,
boolean complete,
Date timestamp,
Connection conn)
|
private void |
migrationInsertInstallation(int installation_id,
boolean complete,
Date timestamp,
ReleaseId release_id,
Connection conn)
|
private boolean |
needTable(String table_name)
|
private int |
nextAssemblyId()
Looks up the next sequential installation OID based on the maximum id from the Assembly table. |
private int |
nextId(String col_name,
String table_name,
String type_description)
Looks up the next sequential installation OID based on the maximum id from the specified column on the specified table. |
private int |
nextInstallationId()
Looks up the next sequential installation OID based on the maximum id from the Installation table. |
private int |
nextUpgradePhaseId()
Looks up the next sequential installation OID based on the maximum id from the UpgradePhase table. |
String |
resolveAssemblyIdFor(int major,
int minor,
int service_pack,
int dsu,
int build)
For any version other than 6.1 assume WNC. |
private void |
rollbackTransaction(Transaction trans)
|
private Transaction |
startTransaction()
|
Methods inherited from class com.ptc.windchill.upgrade.history.IUHPersistenceDelegate |
addInvalidateable, invalidate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int FIRST_INSTALLATION
private static final String WNC_ASSEMBLY_ID
private static final String PJL_ASSEMBLY_ID
private static final String DDL_ASSEMBLY_ID
private static final String INSTALLATION_TABLE
private static final String INSTALLATION_ID_COLUMN
private static final String INSTALLATION_COMPLETE_COLUMN
private static final String INSTALLATION_TIMESTAMP_COLUMN
private static final String ASSEMBLY_TABLE
private static final String ASSEMBLY_ID_COLUMN
private static final String ASSEMBLY_RELEASEID_COLUMN
private static final String ASSEMBLY_INSTALLATIONID_COLUMN
private static final String UPGRADE_PHASE_TABLE
private static final String UPGRADE_PHASE_ID_COLUMN
private static final String UPGRADE_PHASE_PHASETYPE_COLUMN
private static final String UPGRADE_PHASE_COMPLETE_COLUMN
private static final String UPGRADE_PHASE_INSTALLATIONID_COLUMN
private static final String IU_TABLE
private static final String IU_UUID_COLUMN
private static final String IU_NAME_COLUMN
private static final String IU_UPGRADEPHASEID_COLUMN
private static HashMap tableToDefMaps__
private static final String SELECT_ALL_FROM_INSTALLATION
private static final String SELECT_INSTALLATION_ASSEMBLIES
private static final String SELECT_INSTALLATION_UPGRADE_PHASES
private static final String SELECT_IU_APPLICATIONS
private static final String SELECT_IS_INSTALLATION_COMPLETE
private static final String SELECT_IS_UPGRADE_PHASE_COMPLETE
private static final String MARK_INSTALLATION_COMPLETE
private static final String MARK_UPGRADE_PHASE_COMPLETE
private ConnectionProvider connectionProvider_
Constructor Detail |
public JdbcIUHPersistenceDelegate(ConnectionProvider connection_provider) throws IUHException
connection_provider
- Connection is needed to the database to make use of this class.
IUHException
Method Detail |
private static String[][] getDefFor(String table_name)
private String createTableFor(String table_name)
private String insertFor(String table_name)
private String deleteAllFor(String table_name)
private Transaction startTransaction() throws IUHException
IUHException
private Transaction commitTransaction(Transaction transaction) throws IUHException
IUHException
private void rollbackTransaction(Transaction trans)
protected boolean areInstallationsDirty()
areInstallationsDirty
in class IUHPersistenceDelegate
protected ArrayList getInstallations() throws IUHException
getInstallations
in class IUHPersistenceDelegate
IUHException
- If an SQLException occursprotected Installation createInstallation(Date timestamp) throws IUHException
createInstallation
in class IUHPersistenceDelegate
timestamp
-
IUHException
- Unable to add an installation to the tableprotected void markComplete(Installation installation, boolean complete) throws IUHException
markComplete
in class IUHPersistenceDelegate
installation
- Installationcomplete
- boolean
IUHException
- If all the phases in the database are not marked completeprotected void markComplete(UpgradePhase upgrade_phase, boolean complete) throws IUHException
markComplete
in class IUHPersistenceDelegate
upgrade_phase
- UpgradePhasecomplete
- boolean
IUHException
protected boolean areAssembliesDirty(Installation installation)
areAssembliesDirty
in class IUHPersistenceDelegate
installation
- Installation
protected ArrayList getAssemblies(Installation installation) throws IUHException
getAssemblies
in class IUHPersistenceDelegate
installation
- Installation
IUHException
protected Assembly createAssembly(Installation installation, ReleaseId release_identifier) throws IUHException
createAssembly
in class IUHPersistenceDelegate
installation
- Installationrelease_identifier
- Version
IUHException
protected boolean isComplete(Installation installation) throws IUHException
isComplete
in class IUHPersistenceDelegate
installation
- Installation
IUHException
protected boolean areUpgradePhasesDirty(Installation installation)
areUpgradePhasesDirty
in class IUHPersistenceDelegate
installation
- Installation
protected ArrayList getUpgradePhases(Installation installation) throws IUHException
getUpgradePhases
in class IUHPersistenceDelegate
installation
- Installation
IUHException
protected UpgradePhase createUpgradePhase(Installation installation, UpgradePhaseType phase_type) throws IUHException
createUpgradePhase
in class IUHPersistenceDelegate
installation
- Installationphase_type
- UpgradePhaseType
IUHException
protected boolean isComplete(UpgradePhase upgrade_phase) throws IUHException
isComplete
in class IUHPersistenceDelegate
upgrade_phase
- UpgradePhase
IUHException
- Thrown if unable to determine what the phase isprotected boolean areIUApplicationsDirty(UpgradePhase upgrade_phase)
areIUApplicationsDirty
in class IUHPersistenceDelegate
upgrade_phase
- UpgradePhase
protected ArrayList getIUApplications(UpgradePhase upgrade_phase) throws IUHException
getIUApplications
in class IUHPersistenceDelegate
upgrade_phase
- UpgradePhase
IUHException
- Problems with the SQL statementprotected IUApplication createIUApplication(UpgradePhase upgrade_phase, UUID uuid, String name) throws IUHException
createIUApplication
in class IUHPersistenceDelegate
upgrade_phase
- UpgradePhaseuuid
- The generated number of the IncrementalUpdate executed successfullyname
- The name of the IncrementalUpdate that was just executed
IUHException
- Thrown when unable to add an entryprotected void clear() throws IUHException
IUHPersistenceDelegate
clear
in class IUHPersistenceDelegate
IUHException
protected void clearNewHistoryTables(Connection connection) throws IUHException
IUHException
protected final void flush() throws IUHException
flush
in class IUHPersistenceDelegate
IUHException
private int nextInstallationId() throws IUHException
IUHException
- wrapping a SQLException if there's a problem performing the query.private int nextAssemblyId() throws IUHException
IUHException
- wrapping a SQLException if there's a problem performing the query.private int nextUpgradePhaseId() throws IUHException
IUHException
- wrapping a SQLException if there's a problem performing the query.private int nextId(String col_name, String table_name, String type_description) throws IUHException
IUHException
- wrapping a SQLException if there's a problem performing the query.private Connection getConnection() throws IUHException
IUHException
private boolean needTable(String table_name) throws SQLException, IUHException
SQLException
IUHException
private void createTableIfNecessary(String table_name) throws SQLException, IUHException
SQLException
IUHException
private void ensureTablesExist() throws IUHException
IUHException
private boolean isSchemaPre62() throws SQLException, IUHException
SQLException
IUHException
private boolean isSchema62() throws SQLException, IUHException
SQLException
IUHException
private boolean isSchema623() throws SQLException, IUHException
SQLException
IUHException
private void migratePre62To7() throws SQLException, IUHException
SQLException
IUHException
private void migrate62To7() throws SQLException, IUHException
SQLException
IUHException
private void migrate623To7() throws SQLException, IUHException
SQLException
IUHException
private void migrationInsertInstallation(int installation_id, boolean complete, Date timestamp, Connection conn) throws SQLException
SQLException
private void migrationInsertInstallation(int installation_id, boolean complete, Date timestamp, ReleaseId release_id, Connection conn) throws SQLException, IUHException
SQLException
IUHException
private void migratePre62WTVersionStepTo7(Connection conn) throws SQLException, IUHException
SQLException
IUHException
private void migrate62WTVersionStepTo7(Connection conn) throws SQLException, IUHException
SQLException
IUHException
private void migrate623WTVersionStepTo7(Connection conn) throws SQLException, IUHException
SQLException
IUHException
private void migrate623WtUpgInstAssemblyTo7(Connection conn) throws SQLException
SQLException
private void migrateWtIncrementalUpdateTo7(Connection conn) throws SQLException
SQLException
public String resolveAssemblyIdFor(int major, int minor, int service_pack, int dsu, int build) throws ReleaseIdException
resolveAssemblyIdFor
in interface ReleaseId.AssemblyIdResolver
ReleaseIdException
- if the assembly id cannot be resolved
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |