|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bibalex.daf.handlers.ldaphandler.LDAPHandler
public class LDAPHandler
LDAPHandler is a class manipulates Directory access-related processes like: -Define the domain controller -Authenticate user through LDAP -List all valid users
Field Summary | |
---|---|
private java.lang.String |
adminName
authenticated user who can explore the system users |
private java.lang.String |
adminPassword
tha admin user password |
private java.lang.String |
bindBase
simply it's string that defines the domain controller |
private javax.naming.directory.DirContext |
ctx
|
private java.lang.String |
domainIP
domin IP |
private java.lang.String |
domainName
define the domain name, necessary with active directories |
private java.lang.String |
INITIAL_CONTEXT_FACTORY
JNDI Factory |
private boolean |
isActiveDirectory
boolean to distinguish between Active Directory AD and Linux LDAP |
private java.lang.String |
LDAPort
the connection port, default value = 389 |
private java.lang.String |
LDAPUrl
|
private java.lang.String |
searchBase
defines the way to search |
private java.lang.String |
searchFilter
defines the filter to search |
Constructor Summary | |
---|---|
LDAPHandler()
Constructor |
Method Summary | |
---|---|
boolean |
closeConnection()
close the connection |
boolean |
connectLDAP()
the connection steps |
void |
FilterByFirstName(java.lang.String FilterValue)
Filter by FirstName, get all FirstName which starts with FilterValue |
void |
FilterByLastName(java.lang.String FilterValue)
Filter by LastName, get all LastName which starts with FilterValue |
void |
FilterByMail(java.lang.String FilterValue)
Filter by mail, get all mail which starts with FilterValue |
javax.naming.NamingEnumeration |
getUsers()
return list of users according to the search filter |
private void |
prepareUser(java.lang.String userName,
java.lang.String userPassword)
prepare user form to connect well |
void |
setAdminName(java.lang.String AdminNameValue)
set userName |
void |
setAdminPassword(java.lang.String AdminPasswordValue)
set userPassword |
void |
setBindBase(java.lang.String BindBaseValue)
define Bind base, your domain controller hierarchy. |
void |
setDomainIP(java.lang.String domainIPValue)
define domain IP |
void |
setDomainName(java.lang.String domainNameValue)
define domain name |
void |
setIsActiveDirectory(boolean IsActiveDirectoryValue)
if the system uses ActiveDirectory then the argument will be true, else it will be false |
void |
setLDAPort(java.lang.String LDAPortValue)
define LDAP prot |
private void |
setLDAPUrl()
concatenate values to form the url |
void |
setSearchBase(java.lang.String SearchBaseValue)
define search base, ex.(dc=local,dc=bibalex,dc=dom) |
boolean |
validateUser(java.lang.String userName,
java.lang.String userPassword)
if the user is valid the function will return true, else return false |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String domainName
private java.lang.String domainIP
private java.lang.String LDAPort
private java.lang.String bindBase
private java.lang.String searchBase
private java.lang.String searchFilter
private java.lang.String adminName
private java.lang.String adminPassword
private boolean isActiveDirectory
private java.lang.String INITIAL_CONTEXT_FACTORY
private java.lang.String LDAPUrl
private javax.naming.directory.DirContext ctx
Constructor Detail |
---|
public LDAPHandler()
Method Detail |
---|
public void setDomainName(java.lang.String domainNameValue)
public void setDomainIP(java.lang.String domainIPValue)
public void setLDAPort(java.lang.String LDAPortValue)
public void setBindBase(java.lang.String BindBaseValue)
public void setSearchBase(java.lang.String SearchBaseValue)
public void FilterByMail(java.lang.String FilterValue)
public void FilterByFirstName(java.lang.String FilterValue)
public void FilterByLastName(java.lang.String FilterValue)
public void setAdminName(java.lang.String AdminNameValue)
public void setAdminPassword(java.lang.String AdminPasswordValue)
public void setIsActiveDirectory(boolean IsActiveDirectoryValue)
private void setLDAPUrl()
private void prepareUser(java.lang.String userName, java.lang.String userPassword)
public boolean validateUser(java.lang.String userName, java.lang.String userPassword)
public boolean connectLDAP()
public boolean closeConnection()
public javax.naming.NamingEnumeration getUsers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |