public final class LdapSearch extends Object implements DirSearch
| Constructor and Description |
|---|
LdapSearch(HiveConf conf,
DirContext ctx)
Construct an instance of
LdapSearch. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this search object and releases any system resources associated
with it.
|
List<String> |
executeCustomQuery(String query)
Executes an arbitrary query.
|
String |
findGroupDn(String group)
Finds group's distinguished name.
|
List<String> |
findGroupsForUser(String userDn)
Finds groups that contain the specified user.
|
String |
findUserDn(String user)
Finds user's distinguished name.
|
boolean |
isUserMemberOfGroup(String user,
String groupDn)
Verifies that specified user is a member of specified group.
|
public LdapSearch(HiveConf conf, DirContext ctx) throws NamingException
LdapSearch.conf - Hive configurationctx - Directory service that will be used for the queries.NamingExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic String findUserDn(String user) throws NamingException
findUserDn in interface DirSearchuser - usernameNamingExceptionpublic String findGroupDn(String group) throws NamingException
findGroupDn in interface DirSearchgroup - group name or unique identifierNamingExceptionpublic boolean isUserMemberOfGroup(String user, String groupDn) throws NamingException
isUserMemberOfGroup in interface DirSearchuser - user id or distinguished namegroupDn - group's DNtrue if the user is a member of the group, false - otherwise.NamingExceptionpublic List<String> findGroupsForUser(String userDn) throws NamingException
findGroupsForUser in interface DirSearchuserDn - user's distinguished nameNamingExceptionpublic List<String> executeCustomQuery(String query) throws NamingException
executeCustomQuery in interface DirSearchquery - any queryNamingExceptionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.