edu.internet2.middleware.grouper.app.loader.ldap
Class LoaderLdapElUtils

java.lang.Object
  extended by edu.internet2.middleware.grouper.app.loader.ldap.LoaderLdapElUtils

public class LoaderLdapElUtils
extends Object

loaded in EL context for loader el's


Constructor Summary
LoaderLdapElUtils()
           
 
Method Summary
static String convertAdMemberDnToSpecificValue(String dn, String baseDn, String grouperBaseStem, boolean idOrIdentifier)
          convert a user dn to a user CN, and a group dn to a group ID or Uuid
static String convertDnToGroupName(String dn, String baseDn, String grouperBaseStem)
          convert a DN to a group name
static String convertDnToSpecificValue(String dn)
          convert from uid=someapp,ou=people,dc=myschool,dc=edu to someapp
static String convertDnToSpecificValueOrGroup(String dn, String groupPrefix, String groupSuffix, boolean createGroupIfNotThere, boolean idOrIdentifier)
          convert from uid=someapp,ou=people,dc=myschool,dc=edu to someapp and allow groups
static String convertDnToSpecificValueTest(String dn, String subjectIdToReturnGroup, String groupToCreateReturn)
          test case showing a transformation where if the dn is the subjectIdToReturnGroup then make sure groupToCreateReturn exists and return its ID
static String convertDnToSubPath(String dn, String baseDn, String searchDn)
          convert from uid=someapp,ou=people,dc=myschool,dc=edu baseDn is edu searchDn is myschool to people:someapp
static String convertLDAPMemberDnToSubjectIdOrGroup(String dn, String baseOu, String grouperBaseStem, String serverId, String uniqueAttribute, boolean idOrIdentifier)
          convert a subject dn to a user RDN value, and a group dn to a group ID or Uuid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoaderLdapElUtils

public LoaderLdapElUtils()
Method Detail

convertDnToSpecificValue

public static String convertDnToSpecificValue(String dn)
convert from uid=someapp,ou=people,dc=myschool,dc=edu to someapp

Parameters:
dn -
Returns:
the most specific value

convertDnToSpecificValueOrGroup

public static String convertDnToSpecificValueOrGroup(String dn,
                                                     String groupPrefix,
                                                     String groupSuffix,
                                                     boolean createGroupIfNotThere,
                                                     boolean idOrIdentifier)
convert from uid=someapp,ou=people,dc=myschool,dc=edu to someapp and allow groups

Parameters:
dn - full dn
groupSuffix - group suffix e.g. ,OU=Groups,DC=dev,DC=umontreal,DC=ca
groupPrefix - group prefix e.g. umontreal:adgroups: if null then no prefix
createGroupIfNotThere - if we should see if group exists and if not, create
idOrIdentifier - true for Id (uuid), false for Identifier of group (name)
Returns:
the subjectId or Identifier

convertDnToSubPath

public static String convertDnToSubPath(String dn,
                                        String baseDn,
                                        String searchDn)
convert from uid=someapp,ou=people,dc=myschool,dc=edu baseDn is edu searchDn is myschool to people:someapp

Parameters:
dn -
baseDn - if there is one, take it off
searchDn - if there is one after the baseDn is off, take it off
Returns:
the subpath

convertDnToSpecificValueTest

public static String convertDnToSpecificValueTest(String dn,
                                                  String subjectIdToReturnGroup,
                                                  String groupToCreateReturn)
test case showing a transformation where if the dn is the subjectIdToReturnGroup then make sure groupToCreateReturn exists and return its ID

Parameters:
dn -
subjectIdToReturnGroup -
groupToCreateReturn -
Returns:
the subject id or group id

convertAdMemberDnToSpecificValue

public static String convertAdMemberDnToSpecificValue(String dn,
                                                      String baseDn,
                                                      String grouperBaseStem,
                                                      boolean idOrIdentifier)
convert a user dn to a user CN, and a group dn to a group ID or Uuid

Parameters:
baseDn - e.g. OU=People,DC=devsim,DC=umontreal,DC=ca
dn - of group member
grouperBaseStem - is the base stem where the groups go. e.g. my:groups:
idOrIdentifier - true for id (group id), false for identifier (group name)
Returns:
CN for person, Uuid or Group name for a group

convertDnToGroupName

public static String convertDnToGroupName(String dn,
                                          String baseDn,
                                          String grouperBaseStem)
convert a DN to a group name

Parameters:
dn -
baseDn - e.g. OU=People,DC=devsim,DC=umontreal,DC=ca
grouperBaseStem - is the base stem where the groups go. e.g. my:groups:
Returns:
the subject identifier (group name)

convertLDAPMemberDnToSubjectIdOrGroup

public static String convertLDAPMemberDnToSubjectIdOrGroup(String dn,
                                                           String baseOu,
                                                           String grouperBaseStem,
                                                           String serverId,
                                                           String uniqueAttribute,
                                                           boolean idOrIdentifier)
convert a subject dn to a user RDN value, and a group dn to a group ID or Uuid

Parameters:
dn - of group member . Normally this will be as subjectId
baseOu - This is the full DN of the OU to load from LDAP e.g. OU=Some Example,DC=test,DC=school,DC=edu
grouperBaseStem - is the base stem where the groups are loaded into. e.g. my:groups:Loaded_from_LDAP
serverId - is the connection or server ID specified in grouper-loader.properties file. e.g: personLdap
uniqueAttribute - attribute value to return from LDAP query, preferably the one storing the subjectId
idOrIdentifier - true for id (group id), false for identifier (group name)
Returns:
RDN value for subject (user object), Uuid or Group name for a group