public interface LDAPManager extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
add(String sDN,
Map<String,Object> mAttributes)
Add an LDAP entry
|
void |
bind(String sUser,
String sPass)
Synchronously authenticates to the LDAP server using LDAP_V3.
|
void |
close()
Synchronously disconnects from the LDAP server
|
void |
connect(String sConnStr)
Connect to LDAP Service
|
void |
connectAndBind(Map<String,String> oProps)
Connect to LDAP Server using a Properties object
|
void |
delete(String sDN)
Delete an LDAP entry
|
String |
exists(String sSearchString)
Check whether or not an LDAP entry exists
|
String |
getPartitionName() |
void |
modify(String sDN,
Map<String,Object> mAttributes)
Modify an LDAP entry
|
LDAPEntry |
read(String sDN,
String[] aAttrs) |
List<String> |
search(String sSearchString,
int iLimit) |
void |
setPartitionName(String sName) |
void connect(String sConnStr) throws LDAPException
Connect to LDAP Service
At this point, there is no authentication, and any operations are conducted as an anonymous client.sConnStr - ldap://host:port/distinguished_nameLDAPExceptionvoid connectAndBind(Map<String,String> oProps) throws LDAPException
Connect to LDAP Server using a Properties object
oProps - Map<String,String> for connecting to LDAP server.LDAPExceptionvoid bind(String sUser, String sPass) throws LDAPException
Synchronously authenticates to the LDAP server using LDAP_V3.
If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.sUser - If non-null and non-empty, specifies that the connection and all operations through it should be authenticated with dn as the distinguished name.sPass - If non-null and non-empty, specifies that the connection and all operations through it should be authenticated with dn as the distinguished name and passwd as password.LDAPExceptionIllegalStateException - If not connected to LDAPvoid close()
throws LDAPException
Synchronously disconnects from the LDAP server
The disconnect method abandons any outstanding requests, issues an unbind request to the server, and then closes the socket.close in interface AutoCloseableLDAPExceptionvoid add(String sDN, Map<String,Object> mAttributes) throws LDAPException
sDN - StringmAttributes - Map“String,Object”LDAPExceptionvoid modify(String sDN, Map<String,Object> mAttributes) throws LDAPException
sDN - StringmAttributes - Map“String,Object”LDAPExceptionLDAPEntry read(String sDN, String[] aAttrs) throws LDAPException
LDAPExceptionList<String> search(String sSearchString, int iLimit) throws LDAPException
LDAPExceptionString exists(String sSearchString) throws LDAPException
Check whether or not an LDAP entry exists
The directory is searched from the connection string key.sSearchString - String LDAP search string, for example "(&(ou=Users)(cn=johnp))"LDAPExceptionvoid delete(String sDN) throws LDAPException
sDN - StringLDAPExceptionString getPartitionName()
void setPartitionName(String sName)
Copyright © 2001–2019 KnowGate. All rights reserved.