|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.admin.MigrateDomainAccess
This migrator moves users into organization-specific domains, and updates their personal cabinets if necessary.
Nested Class Summary | |
(package private) class |
MigrateDomainAccess.OrgInfo
Utility class that collectiosn information about an organization |
Field Summary | |
private static String |
CLASSNAME
|
private static String |
CONTAINER_RESOURCE
|
private int |
domainNameUpperLimit
Maximum size of AdministrativeDomain names
Assigned in initProperties() |
private DirectiveServices |
ds
Assigned in runMigration() |
private ObjectIdentifier |
exchange
Oid of the exchange container Assigned in initContainers() |
private String[] |
folderedTables
The table names for all concrete foldered objects. |
private String |
hostName
Used for auto generation of inet domain names Assigned in initProperties() |
private int |
maxDomainCreationAttempts
Number of times to try and find a unique org domain name Assigned in initProperties() |
private int |
maxInetDomainCreationAttempts
Number of times to try and find a unique internet domain name Assigned in initProperties() |
private static String |
ORG_RESOURCE
|
private int |
orgContainerNameUpperLimit
Maximum size of OrgContainer names
Assigned in initProperties() |
private Map |
orgInfos
Mapping of organization names (in upper case) to OrgInfo s. |
private static int |
PAGE_SIZE
Number of users per page. |
private ObjectIdentifier |
rootDomain
Oids of the special domains Assigned in initDomains() |
private Map |
servicesByName
Mapping of service names to Repository oids
Assigned in initServices() |
private Map |
servicesByOid
Mapping of Repository oids to service names
Assigned in initServices() |
private ObjectIdentifier |
systemDomain
Oids of the special domains Assigned in initDomains() |
private ObjectIdentifier |
unaffiliatedDomain
Oids of the special domains Assigned in initDomains() |
private ObjectIdentifier |
userDomain
Oids of the special domains Assigned in initDomains() |
private static boolean |
VERBOSE
|
Constructor Summary | |
MigrateDomainAccess()
|
Method Summary | |
private ObjectIdentifier |
createDomain(String name,
String description,
ObjectIdentifier parent_domain,
ObjectIdentifier parent_container)
Creates an AdministrativeDomain named name
with description description that is in domain
parent_id and container container_id . |
private String |
generateInternetDomainName(String org_name)
Generates a unique internet domain for the given organization name. |
private String |
getByInternetDomain(String internet_domain)
Finds the dn of the organization with the givne internet domain |
private String[] |
getDNForOrganization(String org_name)
Get the distinguished name of the organization |
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 |
getOrgContainer(String name)
Get the oid of the org container with the given name. |
private MigrateDomainAccess.OrgInfo |
getOrgInfo(String org_name)
Finds an org info for the given organization name. |
private ObjectIdentifier |
getRootDomain()
Finds the oid of the root domain |
private String |
getUnusedDomainName(String name,
long parent_id,
long container_id)
Generates a unique version of the given domain name within the parent domain parent_id and container container_id . |
private void |
initContainers()
Finds the exchange container |
private void |
initDomains()
Finds the special domains. |
private void |
initProperties()
Initializes Windchill and I*E properties |
private void |
initServices()
Builds a mapping of repository oids to service names |
static void |
main(String[] args)
|
private ObjectIdentifier |
migrateOrganization(String org_name)
Ensures an organization and domain exist for the given organization name. |
private void |
migrateOrgDomains()
Pages through the user table, assigning users to org domains as necessary. |
private boolean |
migratePersonalCabinet(long user_id,
long domain_id)
Updates the domain of the users's personal cabinet and of the cabinet's contents, if the personal cabinet is currently stored in the global user domain. |
private long |
migrateUser(long user_id,
String dn,
String service)
Updates the domain of the user represented by the parameters. |
private void |
migrateWTOrganization(String org_name,
long org_domain)
Ensures that a WTOrganization with the given name exists
in both LDAP and Oracle, and assigns this organization to the
AdministrativeDomain with the given oid. |
private ObjectIdentifier |
persistWTOrganization(String org_name,
String dn,
long org_domain,
String service)
Persist an organization with the given name in the given domain. |
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 |
private static final String CLASSNAME
private static final String ORG_RESOURCE
private static final String CONTAINER_RESOURCE
private static final boolean VERBOSE
private static final int PAGE_SIZE
private DirectiveServices ds
private int domainNameUpperLimit
AdministrativeDomain
names
Assigned in initProperties()
private int orgContainerNameUpperLimit
OrgContainer
names
Assigned in initProperties()
private int maxDomainCreationAttempts
private int maxInetDomainCreationAttempts
private String hostName
private String[] folderedTables
private ObjectIdentifier exchange
private ObjectIdentifier userDomain
private ObjectIdentifier systemDomain
private ObjectIdentifier unaffiliatedDomain
private ObjectIdentifier rootDomain
private Map servicesByOid
Repository
oids to service names
Assigned in initServices()
private Map servicesByName
Repository
oids
Assigned in initServices()
private Map orgInfos
OrgInfo
s.
Constructor Detail |
public MigrateDomainAccess()
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 migrateOrgDomains() throws Exception
Exception
private long migrateUser(long user_id, String dn, String service) throws Exception
user_id
- The oid of the userdn
- The DN of the userservice
- The service for the user's DN
WTException
- If the user can't be found in LDAP
Exception
private boolean migratePersonalCabinet(long user_id, long domain_id) throws Exception
user_id
- The oid of the user whose personal cabinet
should be updateddomain_id
- The oid of the domain to assign the cabinet and
the cabinet's contents to.
true
if the user's personal cabinet and its contents
where udpated.
Exception
private MigrateDomainAccess.OrgInfo getOrgInfo(String org_name) throws Exception
org_name
- The name of the org to find an
info for
Exception
private ObjectIdentifier migrateOrganization(String org_name) throws Exception
org_name
- The name of the organization to find or create
a domain for.
Exception
private void migrateWTOrganization(String org_name, long org_domain) throws Exception
WTOrganization
with the given name exists
in both LDAP and Oracle, and assigns this organization to the
AdministrativeDomain
with the given oid.
org_domain
- The oid of the domain to assign the organization to
Exception
private String[] getDNForOrganization(String org_name) throws Exception
org_name
- The name of the org to look for
null
if there is no org with the given name.
Exception
private String generateInternetDomainName(String org_name) throws Exception
org_name
- The name of the organization
Exception
private String getByInternetDomain(String internet_domain) throws Exception
internet_domain
- The internet domain to search for
null
Exception
private ObjectIdentifier persistWTOrganization(String org_name, String dn, long org_domain, String service) throws Exception
org_name
- The name of the organizationdn
- The distinguished name of the organizationorg_domain
- The oid of the domain to persist the org inservice
- The directory service the organization is in
WTException
- If the service can't be found
Exception
private void initProperties() throws Exception
Exception
private void initContainers() throws Exception
Exception
private void initDomains() throws Exception
Exception
private ObjectIdentifier getRootDomain() throws Exception
ObjectIdentifier
of the root domain
WTException
- If the root domain can't be found
Exception
private ObjectIdentifier getOrgContainer(String name) throws Exception
name
- The name of the container, in upper case
ObjectIdentifier
of the org container,
or null
if it wasn't found.
WTException
- If more than one org container is found with the
given name
Exception
private ObjectIdentifier getDomain(String name, long parent_id, long container_id) throws Exception
AdministrativeDomain
named name
that is in domain parent_id
and container
container_id
. The search is case-insensitive
name
- The name of the domainparent_id
- The oid of the domain's parent domaincontainer_id
- The oid of the domain's container
ObjectIdentifier
of the domain, or
null
if it wasn't found
WTException
- If more than one domain is found
Exception
private String getUnusedDomainName(String name, long parent_id, long container_id) throws Exception
parent_id
and container container_id
. This is adapted
from getUnusedDomainName
.
name
- The name upon which the domain name should be basedparent_id
- The oid of the parent domaincontainer_id
- The oid of the container
WTException
- If no unique domain can be found after
WTContainerServerHelper.MAX_DOMAIN_CREATION_ATTEMPTS
Exception
private ObjectIdentifier createDomain(String name, String description, ObjectIdentifier parent_domain, ObjectIdentifier parent_container) throws Exception
AdministrativeDomain
named name
with description description
that is in domain
parent_id
and container container_id
.
name
- The name of the domaindescription
- The description of the domainparent_domain
- The oid of the domain's parent domainparent_container
- The oid of the domain's container
ObjectIdentifier
of the new domain
Exception
private void initServices() throws Exception
Exception
private void safeClose(Statement stmt)
stmt
- The Statement
to closeprivate static void safeClose(ResultSet rs)
rs
- The ResultSet
to closepublic static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |