wt.iba.definition.upgrade
Class MigrateHierarchyDisplayName

java.lang.Object
  extended bywt.iba.definition.upgrade.MigrateHierarchyDisplayName
All Implemented Interfaces:
Migrator

public class MigrateHierarchyDisplayName
extends Object
implements Migrator


Field Summary
private  AccessController accessController
           
private  Connection connection
           
private static CRC32 crc
           
private  HashMap customNameMap
           
private  PrintWriter logWriter
           
private  PersistentObjectManager pom
           
 
Constructor Summary
MigrateHierarchyDisplayName()
           
 
Method Summary
private  String calculateNewHierarchyID(String parentHierarchyID, String name)
           
private  AbstractAttributeDefinition[] getChildren(long parentId)
           
private  HashMap getCustomNameMap()
           
private  AbstractAttributeDefinition[] getRootAttributeDefinitions()
           
private  void migrateAttributeDefinition(AbstractAttributeDefinition node, boolean parentHasChanged, String parentHierarchyID)
           
 boolean runMigration(Connection windchill_database_connection, PersistentObjectManager pom, PrintWriter log_writer)
          Run the migration.
private  String toNumericID(String name)
           
private  void updateCSMSingleDefConstraint(AbstractAttributeDefinition definition)
           
private  void updateForeignKeys(String valueClassname, String oldHierarchyID, String newHierarchyID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

private Connection connection

pom

private PersistentObjectManager pom

logWriter

private PrintWriter logWriter

accessController

private AccessController accessController

crc

private static CRC32 crc

customNameMap

private HashMap customNameMap
Constructor Detail

MigrateHierarchyDisplayName

public MigrateHierarchyDisplayName()
Method Detail

runMigration

public boolean runMigration(Connection windchill_database_connection,
                            PersistentObjectManager pom,
                            PrintWriter log_writer)
                     throws Throwable
Description copied from interface: Migrator
Run the migration.

Migrators should log all output to the given PrintWriter. This is the log that is created by RunMigrators. It is an autoflush writer.

Migrators should return true if they successfully completed migration and false otherwise. It is the migrator's responsibility to log failure reasons to the log.

Migrators should not concern themselves with committing the work on the connection. The MigratorRunner will commit the connection work after running each Migrator.

Specified by:
runMigration in interface Migrator
Parameters:
windchill_database_connection - an open connection to the Windchill database
pom - a persistent object manager against the Windchill database
log_writer - an autoflush printwriter for logging any and all output
Throws:
Throwable - declared so that migrators can let exceptions contibuting to failure pass out of the method. The migrator runner will handle these by logging them.

getRootAttributeDefinitions

private AbstractAttributeDefinition[] getRootAttributeDefinitions()
                                                           throws Exception
Throws:
Exception

getChildren

private AbstractAttributeDefinition[] getChildren(long parentId)
                                           throws Exception
Throws:
Exception

migrateAttributeDefinition

private void migrateAttributeDefinition(AbstractAttributeDefinition node,
                                        boolean parentHasChanged,
                                        String parentHierarchyID)
                                 throws Exception
Throws:
Exception

calculateNewHierarchyID

private String calculateNewHierarchyID(String parentHierarchyID,
                                       String name)

updateForeignKeys

private void updateForeignKeys(String valueClassname,
                               String oldHierarchyID,
                               String newHierarchyID)
                        throws Exception
Throws:
Exception

toNumericID

private String toNumericID(String name)

getCustomNameMap

private HashMap getCustomNameMap()

updateCSMSingleDefConstraint

private void updateCSMSingleDefConstraint(AbstractAttributeDefinition definition)
                                   throws Exception
Throws:
Exception