wt.inf.container
Class DirectoryHelperSvr

java.lang.Object
  extended bywt.inf.container.DirectoryHelperSvr

public final class DirectoryHelperSvr
extends Object

A server-side utility that encapsulates the handling of directory operations for the wt/inf packages.

Supported API: false

Extendable: false

See Also:
OrganizationServicesManager

Nested Class Summary
private static class DirectoryHelperSvr.ExchangeCreationBase
           
private static class DirectoryHelperSvr.PrincipalRollbackListener
           
private static class DirectoryHelperSvr.UnaffiliatedDomain
           
private static class DirectoryHelperSvr.UserDomain
           
 
Field Summary
private static String CLASSNAME
           
private static boolean DEBUG
           
private static String HOSTNAME
           
private static DebugWriter LOG
           
private static int MAX_INET_DOMAIN_GENERATION_ATTEMPTS
           
private static String NOT_INSTANCEOF
           
private static Object PRINCIPAL_ROLLBACK_LISTENER_KEY
           
private static String RESOURCE
           
private static WTUser USER
           
 
Constructor Summary
DirectoryHelperSvr()
           
 
Method Summary
static boolean addMember(WTGroup group, WTPrincipal principal)
          

Supported API: false
private static void appendInternetDomainComponent(String name, StringBuffer sb)
           
static WTGroup create(WTGroup group, WTContainer container)
          

Supported API: false
static void delete(DirectoryInfrastructureNode node, WTContainer container)
          

Supported API: false
static void delete(DirectorySubtree subtree, WTContainer container)
          

Supported API: false
static WTGroup delete(WTGroup group)
          

Supported API: false
static void filterByOrganization(WTOrganization org, DirectoryContextProvider context)
          

Supported API: false
static void filterOut(Class principal_class, DirectoryContextProvider context)
          

Supported API: false
private static Iterator findPrincipalsByUFID(String dn)
           
static String generateInternetDomainName(WTOrganization org)
          Creates a unique internet domain name for the given WTOrganization.
protected static String getContainerPath(WTPrincipal principal)
          Tries to derive a container path from a distinguished name
static AdminDomainRef getDomainForPrincipal(WTPrincipal principal)
          Get the appropriate container-based domain for the principal.
private static String getParentDn(String dn)
           
static AdminDomainRef getPrincipalDomainRef(WTContainer container)
           
private static AdminDomainRef getPrincipalDomainRef(WTContainerRef container_ref)
           
static WTGroup getUnrestrictedOrganizationsGroup()
           
protected static boolean isDefaultDomainRef(AdminDomainRef ref)
           
static DirectoryInfrastructureNode move(DirectoryInfrastructureNode node, DirectoryContextProvider new_context, WTContainer container)
          

Supported API: false
static WTPrincipal move(WTPrincipal principal, DirectoryContextProvider new_context)
          

Supported API: false
private static void push(TransactionListener listener)
           
static PrincipalQueryResult queryPrincipals(Class principal_class, String criteria, int size_limit, DirectoryContextProvider[] contexts)
          

Supported API: false
static boolean removeMember(WTGroup group, WTPrincipal principal)
          

Supported API: false
static WTPrincipal rename(WTPrincipal principal, String new_name)
          

Supported API: false
static void save(DirectoryInfrastructureNode node, WTContainer container)
          

Supported API: false
static void save(DirectorySubtree subtree, WTContainer container)
          

Supported API: false
static WTGroup save(WTGroup group, WTContainer container)
          

Supported API: false
static WTGroup save(WTGroup group, WTContainer container, boolean internal)
          Deprecated.  
static WTPrincipal update(WTPrincipal principal)
          

Supported API: false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEBUG

private static final boolean DEBUG

LOG

private static final DebugWriter LOG

NOT_INSTANCEOF

private static final String NOT_INSTANCEOF
See Also:
Constant Field Values

PRINCIPAL_ROLLBACK_LISTENER_KEY

private static final Object PRINCIPAL_ROLLBACK_LISTENER_KEY

USER

private static final WTUser USER

HOSTNAME

private static final String HOSTNAME

MAX_INET_DOMAIN_GENERATION_ATTEMPTS

private static final int MAX_INET_DOMAIN_GENERATION_ATTEMPTS
Constructor Detail

DirectoryHelperSvr

public DirectoryHelperSvr()
Method Detail

addMember

public static boolean addMember(WTGroup group,
                                WTPrincipal principal)
                         throws WTException


Supported API: false

Parameters:
group -
principal -
Returns:
boolean
Throws:
WTException

create

public static WTGroup create(WTGroup group,
                             WTContainer container)
                      throws WTException


Supported API: false

Parameters:
group -
container -
Returns:
WTGroup
Throws:
WTException

delete

public static WTGroup delete(WTGroup group)
                      throws WTException


Supported API: false

Parameters:
group -
Returns:
WTGroup
Throws:
WTException

delete

public static void delete(DirectoryInfrastructureNode node,
                          WTContainer container)
                   throws WTException


Supported API: false

Parameters:
node -
container -
Throws:
WTException

delete

public static void delete(DirectorySubtree subtree,
                          WTContainer container)
                   throws WTException


Supported API: false

Parameters:
subtree -
container -
Throws:
WTException

filterByOrganization

public static void filterByOrganization(WTOrganization org,
                                        DirectoryContextProvider context)
                                 throws WTException


Supported API: false

Parameters:
org -
context -
Throws:
WTException

filterOut

public static void filterOut(Class principal_class,
                             DirectoryContextProvider context)
                      throws WTException


Supported API: false

Parameters:
principal_class -
context -
Throws:
WTException

generateInternetDomainName

public static String generateInternetDomainName(WTOrganization org)
                                         throws WTException
Creates a unique internet domain name for the given WTOrganization. The name consists of:
  1. A normalized version of the organization name
  2. The names of the organization's parent organizations, if any
  3. The local host name, as discovered by looking up the java.rmi.server.hostname property from wt.properties
The organization names are normalized by replacing any character that is not a letter or digit with the '-' character.

Supported API: false

Parameters:
org -
Returns:
String
Throws:
WTException

getDomainForPrincipal

public static AdminDomainRef getDomainForPrincipal(WTPrincipal principal)
                                            throws WTException
Get the appropriate container-based domain for the principal. The rules for this are: This API will not create organizations or organization-based domains. This is handled by WTContainerServiceSvr.getOrganization(Object).

Supported API: false

Parameters:
principal -
Returns:
AdminDomainRef
Throws:
WTException

move

public static WTPrincipal move(WTPrincipal principal,
                               DirectoryContextProvider new_context)
                        throws WTException


Supported API: false

Parameters:
principal -
new_context -
Returns:
WTPrincipal
Throws:
WTException

move

public static DirectoryInfrastructureNode move(DirectoryInfrastructureNode node,
                                               DirectoryContextProvider new_context,
                                               WTContainer container)
                                        throws WTException


Supported API: false

Parameters:
node -
new_context -
container -
Returns:
DirectoryInfrastructureNode
Throws:
WTException

queryPrincipals

public static PrincipalQueryResult queryPrincipals(Class principal_class,
                                                   String criteria,
                                                   int size_limit,
                                                   DirectoryContextProvider[] contexts)
                                            throws WTException


Supported API: false

Parameters:
principal_class -
criteria -
size_limit -
contexts -
Returns:
PrincipalQueryResult
Throws:
WTException

removeMember

public static boolean removeMember(WTGroup group,
                                   WTPrincipal principal)
                            throws WTException


Supported API: false

Parameters:
group -
principal -
Returns:
boolean
Throws:
WTException

rename

public static WTPrincipal rename(WTPrincipal principal,
                                 String new_name)
                          throws WTException


Supported API: false

Parameters:
principal -
new_name -
Returns:
WTPrincipal
Throws:
WTException

save

public static WTGroup save(WTGroup group,
                           WTContainer container,
                           boolean internal)
                    throws WTException
Deprecated.  



Supported API: false

Parameters:
group -
container -
internal -
Returns:
WTGroup
Throws:
WTException

save

public static WTGroup save(WTGroup group,
                           WTContainer container)
                    throws WTException


Supported API: false

Parameters:
group -
container -
Returns:
WTGroup
Throws:
WTException

save

public static void save(DirectoryInfrastructureNode node,
                        WTContainer container)
                 throws WTException


Supported API: false

Parameters:
node -
container -
Throws:
WTException

save

public static void save(DirectorySubtree subtree,
                        WTContainer container)
                 throws WTException


Supported API: false

Parameters:
subtree -
container -
Throws:
WTException

update

public static WTPrincipal update(WTPrincipal principal)
                          throws WTException


Supported API: false

Parameters:
principal -
Returns:
WTPrincipal
Throws:
WTException

getContainerPath

protected static String getContainerPath(WTPrincipal principal)
                                  throws WTException
Tries to derive a container path from a distinguished name

Parameters:
principal -
Returns:
The container path.
Throws:
WTException

getPrincipalDomainRef

private static final AdminDomainRef getPrincipalDomainRef(WTContainerRef container_ref)
                                                   throws WTException
Throws:
WTException

getPrincipalDomainRef

public static final AdminDomainRef getPrincipalDomainRef(WTContainer container)
                                                  throws WTException
Throws:
WTException

isDefaultDomainRef

protected static boolean isDefaultDomainRef(AdminDomainRef ref)
                                     throws WTException
Throws:
WTException

findPrincipalsByUFID

private static Iterator findPrincipalsByUFID(String dn)
                                      throws WTException
Throws:
WTException

getUnrestrictedOrganizationsGroup

public static WTGroup getUnrestrictedOrganizationsGroup()
                                                 throws WTException
Throws:
WTException

appendInternetDomainComponent

private static void appendInternetDomainComponent(String name,
                                                  StringBuffer sb)
                                           throws WTException
Throws:
WTException

push

private static void push(TransactionListener listener)
                  throws WTException
Throws:
WTException

getParentDn

private static String getParentDn(String dn)