|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.ldap.LdapServerImpl
public class LdapServerImpl
Default implementation of ILdapServer.
| Field Summary | |
|---|---|
private static java.lang.String |
DEFAULT_CXT_FACTORY
Name of the class that is the default context factory which will be used if not overridden. |
private java.util.Hashtable |
env
Environment, populated at construction. |
private java.lang.String |
ldapBaseDn
|
private java.lang.String |
ldapName
Name of this LDAP server for identification and debugging purposes. |
private java.lang.String |
ldapUidAttribute
The attribute by which we query using uids. |
private org.apache.commons.logging.Log |
log
|
| Constructor Summary | |
|---|---|
LdapServerImpl(java.lang.String name,
java.lang.String url,
java.lang.String baseDn,
java.lang.String uidAttribute,
java.lang.String managerDn,
java.lang.String managerPw,
java.lang.String initialContextFactory)
Instantiate an LdapServerImpl using somewhat abtstracted configuration over that present in the more detailed constructor. |
|
LdapServerImpl(java.lang.String name,
java.lang.String host,
java.lang.String port,
java.lang.String baseDn,
java.lang.String uidAttribute,
java.lang.String managerDn,
java.lang.String managerPw,
boolean useSsl,
java.lang.String initialContextFactory)
Instantiate an LdapServerImpl with the given low-level configuration. |
|
| Method Summary | |
|---|---|
private static java.lang.String |
checkNull(java.lang.String chkStr,
java.lang.String defStr)
Returns the chckStr argument unless the chkStr argument is null, in which case returns the defStr (default) argument. |
private static java.lang.String |
constructLdapUrl(java.lang.String host,
java.lang.String port,
boolean useSsl)
Construct a URL for an LDAP server. |
java.lang.String |
getBaseDN()
Gets the base DN used to search the LDAP directory context. |
javax.naming.directory.DirContext |
getConnection()
Gets an LDAP directory context. |
java.lang.String |
getUidAttribute()
Gets the uid attribute used to search the LDAP directory context. |
void |
releaseConnection(javax.naming.directory.DirContext conn)
Releases an LDAP directory context. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private org.apache.commons.logging.Log log
private static final java.lang.String DEFAULT_CXT_FACTORY
private final java.lang.String ldapName
private final java.lang.String ldapBaseDn
private final java.lang.String ldapUidAttribute
private java.util.Hashtable env
| Constructor Detail |
|---|
public LdapServerImpl(java.lang.String name,
java.lang.String url,
java.lang.String baseDn,
java.lang.String uidAttribute,
java.lang.String managerDn,
java.lang.String managerPw,
java.lang.String initialContextFactory)
name - mnemonic name for this Ldap server instanceurl - URL of LDAP serverbaseDn - uidAttribute - attribute against which to match for uid queriesmanagerDn - principal for LDAP authentication, null implies no
authenticationmanagerPw - password for LDAP authentication, null implies no
authenticationinitialContextFactory - the name of the class to use to instantiate
the context.
public LdapServerImpl(java.lang.String name,
java.lang.String host,
java.lang.String port,
java.lang.String baseDn,
java.lang.String uidAttribute,
java.lang.String managerDn,
java.lang.String managerPw,
boolean useSsl,
java.lang.String initialContextFactory)
name - mnemonic name for this Ldap server instancehost - host of the LDAP serverport - port number. null implies default of 389baseDn - uidAttribute - attribute against which to match for uid queriesmanagerDn - principal for LDAP authentication, null implies no
authenticationmanagerPw - password for LDAP authenticationuseSsl - true if we should use SSL, false otherwise.initialContextFactory - name of the class to use for building init context,
null defaults to com.sun.jndi.ldap.LdapCtxFactory
java.lang.IllegalArgumentException - when arguments do not specify valid server| Method Detail |
|---|
private static java.lang.String constructLdapUrl(java.lang.String host,
java.lang.String port,
boolean useSsl)
host - port - useSsl -
private static java.lang.String checkNull(java.lang.String chkStr,
java.lang.String defStr)
chkStr - - String to checkdefStr - - fallback default for when the string to check was null
public javax.naming.directory.DirContext getConnection()
throws javax.naming.NamingException
ILdapServer
getConnection in interface ILdapServerjavax.naming.NamingException - If there is a problem connecting to the ldap server.public java.lang.String getBaseDN()
ILdapServer
getBaseDN in interface ILdapServerpublic java.lang.String getUidAttribute()
ILdapServer
getUidAttribute in interface ILdapServerpublic void releaseConnection(javax.naming.directory.DirContext conn)
ILdapServer
releaseConnection in interface ILdapServerconn - an LDAP directory context objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||