|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.inf.container.OrganizationReferenceMigrator
Assigns all concrete OrganizationOwnedImpl
,
WTContained
objects with null
organization ownership to the organization of their parent
container. In addition, sets the organization id to 0 for all
org-owned SemanticKeys that have a null organization id.
This migrator assumes the site organization has already been created
by MigrateDomainAccess
.
Note:
As of the 7.0 release, there are no classes that implement
OrganizationOwnedImpl
that do not also implement
WTContained
, so this class migrates all known
OrganizationOwnedImpl
subclasses.
Field Summary | |
private DirectiveServices |
ds
|
private static int |
PAGE_SIZE
|
private ObjectIdentifier |
siteOrg
|
Constructor Summary | |
OrganizationReferenceMigrator()
|
Method Summary | |
private void |
initSiteOrg()
Finds the site organization. |
private void |
migrateDefaultOrg()
Ensure the default org points to the site organization, if the default org exists. |
private void |
migrateExchange()
Ensure the exchange container points to the site organization |
private void |
migrateOrgOwnership()
Ensures all OrganizationOwnedImpl objects that are also
WTContained have non-null organization references. |
private void |
migrateOrgOwnership(ClassInfo[] container_infos,
ClassInfo[] contained_infos)
Assigns all the contained objects with null organization references
to their parent container's organization, if their parent is in the given list
of container types |
private void |
migrateOrgOwnership(WTContainer container,
ClassInfo[] contained_infos)
Assigns all objects in the given container that have null
organization references to the container's organization. |
private void |
migrateSemanticKeys()
Assigns the organization namespace id to 0 for all semantic keys that have it set to null |
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. |
private void |
validateOrgContainers()
Ensures that all org containers have non-null organization refernces |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int PAGE_SIZE
private DirectiveServices ds
private ObjectIdentifier siteOrg
Constructor Detail |
public OrganizationReferenceMigrator()
Method Detail |
public boolean runMigration(DirectiveServices directive_services) throws Throwable
runMigration
in interface JavaMigrator
directive_services
- Contains migration resources
true
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.private void migrateExchange() throws Exception
Exception
private void migrateDefaultOrg() throws Exception
Exception
private void validateOrgContainers() throws Exception
WTException
- If there is an org container with a null organization reference
Exception
private void migrateOrgOwnership() throws Exception
OrganizationOwnedImpl
objects that are also
WTContained
have non-null
organization references.
If an object has a null
organization reference, it is assigned
to its parent container's organization.
Exception
private void migrateOrgOwnership(ClassInfo[] container_infos, ClassInfo[] contained_infos) throws Exception
null
organization references
to their parent container's organization, if their parent is in the given list
of container types
container_infos
- The types of parent containers to search incontained_infos
- The types of contained children to look for
Exception
private void migrateOrgOwnership(WTContainer container, ClassInfo[] contained_infos) throws Exception
null
organization references to the container's organization.
container
- The container table to look for parents incontained_infos
- The contained tables to look for children in
Exception
private void migrateSemanticKeys() throws Exception
Exception
private void initSiteOrg() throws Exception
WTException
- If the site org can't be found, or if more than one organization
matches the site org name.
Exception
private void safeClose(Statement stmt)
stmt
- The Statement
to closeprivate static void safeClose(ResultSet rs)
rs
- The ResultSet
to close
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |