wt.folder
Class MigratePersonalCabinetData

java.lang.Object
  extended bywt.folder.MigratePersonalCabinetData
All Implemented Interfaces:
JavaMigrator

public class MigratePersonalCabinetData
extends Object
implements JavaMigrator

This migrator assigns container references to personal data. The steps this migrator takes are:

  1. Assigns working copies with null container references to the container of their corresponding checked out copy. Note that this has no dependency on folders.
  2. Assigns any remaining objects in personal cabinets with null container references to the exchange container.


Field Summary
private  DirectiveServices ds
           
private  ObjectIdentifier exchangeOid
           
private  ClassInfo[] folderedContainedInfos
           
private  ClassInfo[] iteratedContainedInfos
           
private static int PAGE_SIZE
           
 
Constructor Summary
MigratePersonalCabinetData()
           
 
Method Summary
private  void initExchangeOid()
          Finds the exchange container
private  void initInfos()
          Initializes the class info arrays
private  void migrateFolderedContained()
          Assign personal cabinet objects with null container references to the exchange container.
private  void migrateIteratedContained()
          Assign all working copies with null container references to the container of their corresponding checked out copy.
 boolean runMigration(DirectiveServices directive_services)
          Implemented from JavaMigrator
private  void safeClose(ResultSet rs)
          If the Statement is not null, try to close it, catching and smothering any SQLException that results.
private  void safeClose(Statement stmt)
          If the Statement is not null, try to close it, catching and smothering any SQLException that results.
private  void updateWorkingCopy(long working_copy_id, String table_name, long container_id, String container_class)
          Assigns the working copy with the given oid to the given container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAGE_SIZE

private static final int PAGE_SIZE
See Also:
Constant Field Values

ds

private DirectiveServices ds

exchangeOid

private ObjectIdentifier exchangeOid

folderedContainedInfos

private ClassInfo[] folderedContainedInfos

iteratedContainedInfos

private ClassInfo[] iteratedContainedInfos
Constructor Detail

MigratePersonalCabinetData

public MigratePersonalCabinetData()
Method Detail

runMigration

public boolean runMigration(DirectiveServices directive_services)
                     throws Exception
Implemented from JavaMigrator

Specified by:
runMigration in interface JavaMigrator
Parameters:
directive_services - Contains migration resources
Returns:
true
Throws:
WTException - If the system cabinet can't be found
Exception

migrateIteratedContained

private void migrateIteratedContained()
                               throws Exception
Assign all working copies with null container references to the container of their corresponding checked out copy.

Throws:
Exception

migrateFolderedContained

private void migrateFolderedContained()
                               throws Exception
Assign personal cabinet objects with null container references to the exchange container.

Throws:
Exception

updateWorkingCopy

private void updateWorkingCopy(long working_copy_id,
                               String table_name,
                               long container_id,
                               String container_class)
                        throws Exception
Assigns the working copy with the given oid to the given container

Parameters:
working_copy_id - The oid of the working copy
table_name - The name of the table the working copy is in
container_id - The oid of the container
container_class - The class name of the container
Throws:
Exception

initInfos

private void initInfos()
                throws Exception
Initializes the class info arrays

Throws:
Exception

initExchangeOid

private void initExchangeOid()
                      throws Exception
Finds the exchange container

Throws:
Exception

safeClose

private void safeClose(Statement stmt)
If the Statement is not null, try to close it, catching and smothering any SQLException that results.

Parameters:
stmt - The Statement to close

safeClose

private void safeClose(ResultSet rs)
If the Statement is not null, try to close it, catching and smothering any SQLException that results.

Parameters:
rs - The ResultSet to close