us.openinternet.luge.dao
Class LdapDAO
java.lang.Object
|
+--us.openinternet.luge.dao.LdapDAO
- public class LdapDAO
- extends java.lang.Object
This class should not be directly instantiated. It is used by the Transformers.
This class first extracts bootstrap information from the luge.properties file (it needs to
know where the bootstrap server is located). Then it connects to the bootstrap server and
retrieves application specific information stored in an entry under ou=applications.
(For example what is the peoplebase for this application, what is the maximum number of allowed
connections, etc). If the primary bootstrap server is unavailable, it tries to connect to the secondary
bootstrap server specified in the properties file. After retreiving the app entry from ou=applications,
a connection pool is created using the app's credentials. If you are monitoring the ldap logs, you will
see an initial connection by cn=bootstrap to retrieve the app's credentials. Then cn=bootstrap disconnects,
and future connections created by the pool will be cn=app_env where app is the appname and env
is the environment, for example dev or prod.
All connection related functionality is handled in this class. The results of the searches, adds, deletes and
modifications are handled in the Transformers. The purpose of this module is to encapsultate the connection
code.
Constructor Summary |
LdapDAO(java.lang.String appname,
java.lang.String key)
|
Method Summary |
void |
add(netscape.ldap.LDAPEntry entry)
|
void |
addAttribute(java.lang.String dn,
netscape.ldap.LDAPAttribute attr)
|
void |
delete(java.lang.String dn)
|
void |
deleteAttribute(java.lang.String dn,
netscape.ldap.LDAPAttribute attr)
|
void |
deleteWithChildren(java.lang.String dn)
|
void |
destroy()
|
void |
finalize()
|
java.lang.String |
getApplicationBase()
|
java.lang.String |
getBase()
|
java.lang.String |
getDefaultMember()
|
java.lang.String |
getGroupBase()
|
java.lang.String |
getGroupType()
|
java.lang.String |
getPeopleBase()
|
java.lang.String |
getPersonLeafID()
|
java.lang.String |
getPersonType()
|
boolean |
isValidDN(java.lang.String dn)
|
netscape.ldap.LDAPEntry |
lookup(java.lang.String dn)
|
netscape.ldap.LDAPEntry |
lookup(java.lang.String dn,
java.lang.String[] attrs)
|
void |
modify(java.lang.String dn,
netscape.ldap.LDAPModification mod)
|
void |
modify(java.lang.String dn,
netscape.ldap.LDAPModificationSet mods)
|
boolean |
rename(java.lang.String dn,
java.lang.String newRDN)
|
netscape.ldap.LDAPSearchResults |
search(java.lang.String base,
java.lang.String scope,
java.lang.String filter,
java.lang.String[] attrs,
boolean attrsOnly)
|
netscape.ldap.LDAPSearchResults |
search(java.lang.String base,
java.lang.String scope,
java.lang.String filter,
java.lang.String[] attrs,
boolean attrsOnly,
int timeLimit)
|
void |
updateAttribute(java.lang.String dn,
netscape.ldap.LDAPAttribute attr)
|
boolean |
validateUserPassword(java.lang.String dn,
java.lang.String password)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LdapDAO
public LdapDAO(java.lang.String appname,
java.lang.String key)
throws LugeException
search
public netscape.ldap.LDAPSearchResults search(java.lang.String base,
java.lang.String scope,
java.lang.String filter,
java.lang.String[] attrs,
boolean attrsOnly)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
search
public netscape.ldap.LDAPSearchResults search(java.lang.String base,
java.lang.String scope,
java.lang.String filter,
java.lang.String[] attrs,
boolean attrsOnly,
int timeLimit)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
lookup
public netscape.ldap.LDAPEntry lookup(java.lang.String dn)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
lookup
public netscape.ldap.LDAPEntry lookup(java.lang.String dn,
java.lang.String[] attrs)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
updateAttribute
public void updateAttribute(java.lang.String dn,
netscape.ldap.LDAPAttribute attr)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
isValidDN
public boolean isValidDN(java.lang.String dn)
addAttribute
public void addAttribute(java.lang.String dn,
netscape.ldap.LDAPAttribute attr)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
deleteAttribute
public void deleteAttribute(java.lang.String dn,
netscape.ldap.LDAPAttribute attr)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
modify
public void modify(java.lang.String dn,
netscape.ldap.LDAPModification mod)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
modify
public void modify(java.lang.String dn,
netscape.ldap.LDAPModificationSet mods)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
add
public void add(netscape.ldap.LDAPEntry entry)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
delete
public void delete(java.lang.String dn)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
rename
public boolean rename(java.lang.String dn,
java.lang.String newRDN)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
deleteWithChildren
public void deleteWithChildren(java.lang.String dn)
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException
validateUserPassword
public boolean validateUserPassword(java.lang.String dn,
java.lang.String password)
throws LugeException
LugeException
getBase
public java.lang.String getBase()
getApplicationBase
public java.lang.String getApplicationBase()
getPeopleBase
public java.lang.String getPeopleBase()
getGroupBase
public java.lang.String getGroupBase()
getGroupType
public java.lang.String getGroupType()
getPersonType
public java.lang.String getPersonType()
getPersonLeafID
public java.lang.String getPersonLeafID()
getDefaultMember
public java.lang.String getDefaultMember()
destroy
public void destroy()
finalize
public void finalize()
throws java.lang.Throwable
- Overrides:
finalize
in class java.lang.Object
java.lang.Throwable