wt.inf.container
Class OrganizationSync

java.lang.Object
  extended bywt.inf.container.OrganizationSync
All Implemented Interfaces:
RemoteAccess

public final class OrganizationSync
extends Object
implements RemoteAccess

Ensures that organization-related properties of a user or set of users are in sync with their current organization. This enables administrators to safely update a user's organization.

For each user, OrganizationSync does the following:

  1. Assigns a set of user-related business objects to the AdministrativeDomain of the user's current WTOrganization. If the user does not have an organization, then these objects are assigned to the AdministrativeDomainHelper.UNAFFILIATED_DOMAIN. The objects whose domains are reassigned are:
  2. Removes the user from the administrators and creators groups of their old organization container, if necessary. The program determines what the old container was by getting the container of the user's previous AdministrativeDomain.
  3. Updates the "org" groups in any Container Teams the user is a member of to reflect the user's current organizational membership.

Notes:

Usage: java wt.inf.container.OrganizationSync selection-options selection-options: [--users user-list] | [--domains domain-list] | [--domain-hierarchies domain-list] | [--organizations organization-list] user-list: A space-separated list of user names domain-list: A space-separated list of domain paths organization-list: A space-separated list of organization names

When domain-list or organization-list are specified, then all the users in each domain or organization are synchronized. When domain-hierarchies is specified, then all the users in each domain and in each domain's descendent domains are synchronized.

Examples: //Update the foo and bar users java wt.inf.container.OrganizationSync --users foo bar // Update all users in the site-level unaffiliated domain // and the "PTC Inc" domain in the "PTC Inc" org container java wt.inf.container.OrganizationSync --domains [/]/User/Unaffiliated "[/wt.inf.container.OrgContainer=PTC Inc]/PTC Inc" // Update all users in the site-level user domain, and in // all of its child domains java wt.inf.container.OrgainzationSync --domain-hierarchies [/]/User // Update all members of the "Acme Inc." and // "Widget Intl." organizations java wt.inf.container.OrganizationSync --organizations "Acme Inc." "Widget Intl."

Supported API: false

Extendable: false


Nested Class Summary
private static class OrganizationSync.UnaffiliatedDomain
           
 
Field Summary
private static String CLASSNAME
           
private static boolean DEBUG
           
private static String DOMAIN_ID
           
private static DebugWriter LOG
           
private static String SEPARATOR
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
OrganizationSync()
           
 
Method Summary
private static void checkAccess()
           
static void main(String[] args)
          Command-line interface for synchronizing org information.
private static void printUsage()
           
private static boolean removeMember(WTUser user, WTPrincipalReference group_ref)
           
private static void resetPrincipalCache()
           
private static void sendFeedback(String message)
           
private static void sync(WTUser user)
           
static void syncDomain(String domain_path, boolean include_descendents)
          Synchronizes the organization information for the users in domain domain_path.
static void syncOrganization(String org_name)
          Synchronizes the organization information for the users in organization org_name.
static void syncUser(String user_name)
          Synchronizes the organization information for the user named user_name
private static Boolean valueOf(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

private static final String CLASSNAME

DEBUG

private static final boolean DEBUG

LOG

private static final DebugWriter LOG

DOMAIN_ID

private static final String DOMAIN_ID
See Also:
Constant Field Values

SEPARATOR

private static final String SEPARATOR
See Also:
Constant Field Values
Constructor Detail

OrganizationSync

public OrganizationSync()
Method Detail

main

public static void main(String[] args)
Command-line interface for synchronizing org information.

Parameters:
args - A list of users, domain paths, or organizations to synchronize

printUsage

private static void printUsage()

syncUser

public static void syncUser(String user_name)
                     throws Exception
Synchronizes the organization information for the user named user_name

Parameters:
user_name - The name of the user to synchronize
Throws:
WTException - If the user can't be found
Exception

syncDomain

public static void syncDomain(String domain_path,
                              boolean include_descendents)
                       throws Exception
Synchronizes the organization information for the users in domain domain_path.

Parameters:
domain_path - The path of the domain to look for users in
include_descendents - If true, then users in descendent domains are also synchronized
Throws:
WTException - If the domain can't be found
Exception
See Also:
AdministrativeDomainManager.getDomain(String)

syncOrganization

public static void syncOrganization(String org_name)
                             throws Exception
Synchronizes the organization information for the users in organization org_name.

Parameters:
org_name - The name of the organization to look for users in
Throws:
WTException - If the organization can't be found
Exception

sync

private static void sync(WTUser user)
                  throws Exception
Throws:
Exception

checkAccess

private static void checkAccess()
                         throws Exception
Throws:
Exception

sendFeedback

private static void sendFeedback(String message)
                          throws Exception
Throws:
Exception

removeMember

private static boolean removeMember(WTUser user,
                                    WTPrincipalReference group_ref)
                             throws WTException
Throws:
WTException

resetPrincipalCache

private static final void resetPrincipalCache()
                                       throws WTException
Throws:
WTException

valueOf

private static Boolean valueOf(boolean b)