|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.org.OrganizationServicesMigrationHelper
Provides utility methods for working with principals that do not require the method server to be running
Field Summary | |
static String |
ADMIN_GROUP
|
static String |
ADMIN_GROUP_SERVICE
|
static String[] |
ADMIN_NAMES
|
static String |
DEFAULT_DIRECTORY_USER
|
private static String |
RESOURCE
|
Constructor Summary | |
OrganizationServicesMigrationHelper()
|
Method Summary | |
static String |
createPrincipal(String name,
String service,
Class principal_class,
Map attributes)
Creates a principal with the given name in the given service |
static String |
escapeRemoteObjectID(String dn)
This method is copied directly from StandardOrganizationServicesManager._normalize() . |
static String |
getByInternetDomain(String internet_domain,
String service)
Get the dn of the organization with the given internet domain |
static String |
getDNForPrincipal(String name,
String service,
Class principal_class)
Searches for a principal with the given name in the given service |
static String |
getInternetDomain(String org_dn,
String service)
Get the internet domain of an organization |
private static String |
getObjectClass(Class principal_class,
String service)
Gets the object class for the principal subclass in the given service |
static String |
getOrganizationName(String user_dn,
String service)
Queries ldap to determine what the organization name attribute is for the user with the given dn |
static Map |
getServices(DirectiveServices ds)
Creates a mapping of service names by querying the repository table for lastknowndomain and ida2a2. |
private static String |
getUniqueIDAttribute(Class principal_class,
String service)
Gets the unique id attribute for the principal subclass in the given service |
private static void |
safeClose(ResultSet rs)
If the Statement is not null, try to close it, catching and smothering any SQLException that results. |
private static void |
safeClose(Statement stmt)
If the Statement is not null, try to close it, catching and smothering any SQLException that results. |
static void |
setInternetDomain(String dn,
String service,
String internet_domain)
Assigns the organization with the given dn a new internet domain |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
public static final String DEFAULT_DIRECTORY_USER
public static final String[] ADMIN_NAMES
public static final String ADMIN_GROUP
public static final String ADMIN_GROUP_SERVICE
Constructor Detail |
public OrganizationServicesMigrationHelper()
Method Detail |
public static String createPrincipal(String name, String service, Class principal_class, Map attributes) throws Exception
name
- The name of the principal to createservice
- The name of the service to create the principal inprincipal_class
- The class of princpal to search forattributes
- An optional map of attributes to add to the principal.
The attribute names should already be translated using
DirContext.getMapping(String,String)
WTException
- If principal_class
isn't user, group, or
organization.
Exception
public static String getInternetDomain(String org_dn, String service) throws Exception
org_dn
- The dn of the organization to search forservice
- The organization's service
null
if it
doesn't have one.
WTException
- If no organization can be found with the given dn
Exception
public static String getByInternetDomain(String internet_domain, String service) throws Exception
internet_domain
- The dn of the organization to search forservice
- The service to look in
null
if there is no
matching organization.
Exception
public static void setInternetDomain(String dn, String service, String internet_domain) throws Exception
dn
- The dn of the organization to modifyservice
- The organization's serviceinternet_domain
- The new internet domain for the organization
A value of null
deletes the attribute
Exception
public static String getDNForPrincipal(String name, String service, Class principal_class) throws Exception
name
- The name of the principal to search forservice
- The name of the service to look inprincipal_class
- The class of princpal to search for
null
if it
wasn't found.
WTException
- If principal_class
isn't user, group, or
organization.
Exception
public static String getOrganizationName(String user_dn, String service) throws Exception
user_dn
- The dn of the user to find an organization
attribute forservice
- The name of the service to look in
null
if they don't have one.
WTException
- If the user can't be found
Exception
public static String escapeRemoteObjectID(String dn)
StandardOrganizationServicesManager._normalize()
.
It is used to create a normalized form of a dn, for use in the RemoteObjectInfo
table.
dn
- The dn to normalize
private static final String getObjectClass(Class principal_class, String service) throws Exception
principal_class
- A class that is assignable from WTPrincipal
service
- The name of the service
objectClass
attribute for the class
WTException
- If the principal class isn't user, group, or organization
Exception
private static final String getUniqueIDAttribute(Class principal_class, String service) throws Exception
principal_class
- A class that is assignable from WTPrincipal
service
- The name of the service
uniqueIdAttribute
attribute for the class
WTException
- If the principal class isn't user, group, or organization
Exception
public static final Map getServices(DirectiveServices ds) throws Exception
Long
versions of repository oids
Exception
private static 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 |