wt.inf.container
Class MigrateGroupDomainsR6ToR7

java.lang.Object
  extended bywt.inf.container.MigrateGroupDomainsR6ToR7
All Implemented Interfaces:
JavaMigrator

public class MigrateGroupDomainsR6ToR7
extends Object
implements JavaMigrator

Assigns all groups in the system domain to the unaffiliated domain, with the exception of the site administrators group

This migrator assumes that container-specific groups are being migrated by some other means.


Field Summary
private  DirectiveServices ds
           
private  ObjectIdentifier exchange
           
private static int PAGE_SIZE
          Number of users per page.
private  ObjectIdentifier siteAdministratorsGroup
           
private  ObjectIdentifier systemDomain
           
private  ObjectIdentifier unaffiliatedDomain
           
private static boolean VERBOSE
           
 
Constructor Summary
MigrateGroupDomainsR6ToR7()
           
 
Method Summary
private  ObjectIdentifier getDomain(String name, long parent_id, long container_id)
          Get the AdministrativeDomain named name that is in domain parent_id and container container_id.
private  ObjectIdentifier getRootDomain()
          Finds the oid of the root domain
private  void initContainers()
          Finds the exchange container
private  void initDomains()
          Finds the special domains.
private  void initSiteAdministratorsGroup()
          Finds the site administrators group
private  void migrateGroupDomains()
          Assigns all groups in the system domain to the unaffiliated domain, with the exception of the site administrators group
 boolean runMigration(DirectiveServices directive_services)
          Implemented from the JavaMigrator interface
private static 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

private static final boolean VERBOSE

PAGE_SIZE

private static final int PAGE_SIZE
Number of users per page. This is also used to define the size of the IN clause in migrateUsers so it shouldn't be increased.

See Also:
Constant Field Values

ds

private DirectiveServices ds

exchange

private ObjectIdentifier exchange

systemDomain

private ObjectIdentifier systemDomain

unaffiliatedDomain

private ObjectIdentifier unaffiliatedDomain

siteAdministratorsGroup

private ObjectIdentifier siteAdministratorsGroup
Constructor Detail

MigrateGroupDomainsR6ToR7

public MigrateGroupDomainsR6ToR7()
Method Detail

runMigration

public boolean runMigration(DirectiveServices directive_services)
                     throws Throwable
Implemented from the JavaMigrator interface

Specified by:
runMigration in interface JavaMigrator
Parameters:
directive_services - Contains migration resources
Returns:
true
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.

migrateGroupDomains

private void migrateGroupDomains()
                          throws Exception
Assigns all groups in the system domain to the unaffiliated domain, with the exception of the site administrators group

Throws:
Exception

initContainers

private void initContainers()
                     throws Exception
Finds the exchange container

Throws:
Exception

initDomains

private void initDomains()
                  throws Exception
Finds the special domains. Creates the unaffiliated domain if it doesn't already exist

Throws:
Exception

initSiteAdministratorsGroup

private void initSiteAdministratorsGroup()
                                  throws Exception
Finds the site administrators group

Throws:
Exception

getRootDomain

private ObjectIdentifier getRootDomain()
                                throws Exception
Finds the oid of the root domain

Returns:
The ObjectIdentifier of the root domain
Throws:
WTException - If the root domain can't be found
Exception

getDomain

private ObjectIdentifier getDomain(String name,
                                   long parent_id,
                                   long container_id)
                            throws Exception
Get the AdministrativeDomain named name that is in domain parent_id and container container_id.

Parameters:
name - The name of the domain
parent_id - The oid of the domain's parent domain
container_id - The oid of the domain's container
Returns:
The ObjectIdentifier of the domain
Throws:
WTException - If domain couldn't be found, or more than one domain was found
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 static 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