public abstract class LdapDataProvider extends Object
UserDAO
. RoleDAO
,
PermDAO
, ....
These are low-level data utilities, very little if any data validations are performed here.
This class is thread safe.
Constructor and Description |
---|
LdapDataProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
add(org.apache.directory.ldap.client.api.LdapConnection connection,
org.apache.directory.api.ldap.model.entry.Entry entry)
Add a new ldap entry to the directory.
|
protected void |
add(org.apache.directory.ldap.client.api.LdapConnection connection,
org.apache.directory.api.ldap.model.entry.Entry entry,
FortEntity entity)
Add a new ldap entry to the directory.
|
protected org.apache.directory.api.ldap.model.message.BindResponse |
bind(org.apache.directory.ldap.client.api.LdapConnection connection,
String szUserDn,
char[] password)
Calls the PoolMgr to perform an LDAP bind for a user/password combination.
|
void |
closeAdminConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the Admin LDAP connection.
|
static void |
closeAllConnectionPools()
Closes all the ldap connection pools.
|
protected void |
closeLogConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the Log LDAP connection.
|
protected void |
closeUserConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the User LDAP connection.
|
protected boolean |
compareNode(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn,
String userDn,
org.apache.directory.api.ldap.model.entry.Attribute attribute)
This method uses the compare ldap func to assert audit record into the directory server's configured audit
logger.
|
protected org.apache.directory.api.ldap.model.entry.Attribute |
createAttributes(String name,
String[] values)
Create multi-occurring ldap attribute given array of strings and attribute name.
|
protected void |
delete(org.apache.directory.ldap.client.api.LdapConnection connection,
org.apache.directory.api.ldap.model.name.Dn dn,
FortEntity entity)
Delete exiting ldap entry from the directory.
|
protected void |
delete(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn)
Delete exiting ldap entry from the directory.
|
protected void |
delete(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn,
FortEntity entity)
Delete exiting ldap entry from the directory.
|
protected void |
deleteRecursive(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn)
Delete exiting ldap entry and all descendants from the directory.
|
protected void |
deleteRecursive(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn,
FortEntity entity)
Delete exiting ldap entry and all descendants from the directory.
|
protected String |
encodeSafeText(String value,
int validLen)
Encode some text so that it can be used in a LDAP filter.
|
protected String |
escapeLDAPSearchFilter(String filter)
Perform encoding on supplied input string for certain unsafe ascii characters.
|
org.apache.directory.ldap.client.api.LdapConnection |
getAdminConnection()
Calls the PoolMgr to get an Admin connection to the LDAP server.
|
protected String |
getAttribute(org.apache.directory.api.ldap.model.entry.Entry entry,
String attributeName)
Method wraps ldap client to return attribute value by name within a given entry and returns as a string.
|
protected List<String> |
getAttributes(org.apache.directory.api.ldap.model.entry.Entry entry,
String attributeName)
Method wraps ldap client to return multi-occurring attribute values by name within a given entry and returns
as a list of strings.
|
protected Set<String> |
getAttributeSet(org.apache.directory.api.ldap.model.entry.Entry entry,
String attributeName)
Method wraps ldap client to return multi-occurring attribute values by name within a given entry and returns
as a set of strings.
|
static LdapCounters |
getLdapCounters()
Return to call reference to dao counter object with running totals for ldap operations add, mod, delete, search, etc.
|
protected org.apache.directory.ldap.client.api.LdapConnection |
getLogConnection()
Calls the PoolMgr to get an Log connection to the LDAP server.
|
protected byte[] |
getPhoto(org.apache.directory.api.ldap.model.entry.Entry entry,
String attributeName)
Return the image stored on the entry.
|
protected org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy |
getPwdRespCtrl(org.apache.directory.api.ldap.model.message.Response resp)
Get Password Policy Response Control from LDAP client.
|
protected String |
getRdn(String dn)
Method will retrieve the relative distinguished name from a distinguished name variable.
|
protected String |
getRootDn(String contextId)
Given a contextId return the LDAP dn that includes the suffix.
|
protected String |
getRootDn(String contextId,
String root)
Given a contextId and a fortress param name return the LDAP dn.
|
protected org.apache.directory.ldap.client.api.LdapConnection |
getUserConnection()
Calls the PoolMgr to get an User connection to the LDAP server.
|
protected void |
loadAttrs(List<String> list,
org.apache.directory.api.ldap.model.entry.Entry entry,
String attrName)
Given an ldap attribute name and a list of attribute values, construct an ldap attribute set to be added to directory.
|
protected void |
loadAttrs(List<String> list,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
String attrName)
Given an ldap attribute name and a list of attribute values, construct an ldap modification set to be updated
in directory.
|
protected void |
loadAttrs(Set<String> values,
org.apache.directory.api.ldap.model.entry.Entry entry,
String attrName)
Given an ldap attribute name and a set of attribute values, construct an ldap attribute set to be added to
directory.
|
protected void |
loadAttrs(Set<String> values,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
String attrName)
Given an ldap attribute name and a set of attribute values, construct an ldap modification set to be updated
in directory.
|
protected void |
loadProperties(Properties props,
org.apache.directory.api.ldap.model.entry.Entry entry,
String attrName)
Given a collection of
Properties , convert to raw data name-value format and load into ldap
modification set in preparation for ldap add. |
protected void |
loadProperties(Properties props,
org.apache.directory.api.ldap.model.entry.Entry entry,
String attrName,
char separator)
Given a collection of
Properties , convert to raw data name-value format and load into ldap modification set in preparation for ldap add. |
protected void |
loadProperties(Properties props,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
String attrName,
boolean replace)
Given a collection of
Properties , convert to raw data name-value format and load into ldap
modification set in preparation for ldap modify. |
protected void |
loadProperties(Properties props,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
String attrName,
boolean replace,
char separator)
Given a collection of
Properties , convert to raw data name-value format and load into ldap
modification set in preparation for ldap modify. |
protected void |
loadRelationshipAttrs(List<Relationship> list,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
String attrName,
Hier.Op op)
Given a collection of
Relationship s, convert to raw data name-value format and
load into ldap modification set in preparation for ldap modify. |
protected void |
modify(org.apache.directory.ldap.client.api.LdapConnection connection,
org.apache.directory.api.ldap.model.name.Dn dn,
List<org.apache.directory.api.ldap.model.entry.Modification> mods)
Update exiting ldap entry to the directory.
|
protected void |
modify(org.apache.directory.ldap.client.api.LdapConnection connection,
org.apache.directory.api.ldap.model.name.Dn dn,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
FortEntity entity)
Update exiting ldap entry to the directory.
|
protected void |
modify(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn,
List<org.apache.directory.api.ldap.model.entry.Modification> mods)
Update exiting ldap entry to the directory.
|
protected void |
modify(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
FortEntity entity)
Update exiting ldap entry to the directory.
|
protected org.apache.directory.api.ldap.model.entry.Entry |
read(org.apache.directory.ldap.client.api.LdapConnection connection,
org.apache.directory.api.ldap.model.name.Dn dn,
String[] attrs)
Read the ldap record from specified location.
|
protected org.apache.directory.api.ldap.model.entry.Entry |
read(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn,
String[] attrs)
Read the ldap record from specified location.
|
protected org.apache.directory.api.ldap.model.entry.Entry |
read(org.apache.directory.ldap.client.api.LdapConnection connection,
String dn,
String[] attrs,
String userDn)
Read the ldap record from specified location with user assertion.
|
protected void |
removeProperties(Properties props,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
String attrName)
Given a collection of
Properties , convert to raw data name-value format and load into ldap
modification set in preparation for ldap modify. |
protected org.apache.directory.api.ldap.model.cursor.SearchCursor |
search(org.apache.directory.ldap.client.api.LdapConnection connection,
String baseDn,
org.apache.directory.api.ldap.model.message.SearchScope scope,
String filter,
String[] attrs,
boolean attrsOnly)
Perform normal ldap search accepting default batch size.
|
protected org.apache.directory.api.ldap.model.cursor.SearchCursor |
search(org.apache.directory.ldap.client.api.LdapConnection connection,
String baseDn,
org.apache.directory.api.ldap.model.message.SearchScope scope,
String filter,
String[] attrs,
boolean attrsOnly,
int maxEntries)
Perform normal ldap search specifying default batch size and max entries to return.
|
protected org.apache.directory.api.ldap.model.entry.Entry |
searchNode(org.apache.directory.ldap.client.api.LdapConnection connection,
String baseDn,
org.apache.directory.api.ldap.model.message.SearchScope scope,
String filter,
String[] attrs,
boolean attrsOnly)
This method will search the directory and return at most one record.
|
protected org.apache.directory.api.ldap.model.entry.Entry |
searchNode(org.apache.directory.ldap.client.api.LdapConnection connection,
String baseDn,
org.apache.directory.api.ldap.model.message.SearchScope scope,
String filter,
String[] attrs,
boolean attrsOnly,
String userDn)
This search method uses OpenLDAP Proxy Authorization Control to assert arbitrary user identity onto connection.
|
protected void |
unloadTemporal(org.apache.directory.api.ldap.model.entry.Entry le,
Constraint ftDateTime)
Convert constraint from raw ldap format to application entity.
|
protected String getRootDn(String contextId, String root)
contextId
- is to determine what sub-tree to use.root
- contains the fortress parameter name that corresponds with a particular LDAP container.protected String getRootDn(String contextId)
contextId
- is to determine what sub-tree to use.protected org.apache.directory.api.ldap.model.entry.Entry read(org.apache.directory.ldap.client.api.LdapConnection connection, String dn, String[] attrs) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains ldap distinguished name.attrs
- array contains array names to pull back.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected org.apache.directory.api.ldap.model.entry.Entry read(org.apache.directory.ldap.client.api.LdapConnection connection, org.apache.directory.api.ldap.model.name.Dn dn, String[] attrs) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains ldap distinguished name.attrs
- array contains array names to pull back.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected org.apache.directory.api.ldap.model.entry.Entry read(org.apache.directory.ldap.client.api.LdapConnection connection, String dn, String[] attrs, String userDn) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains ldap distinguished name.attrs
- array contains array names to pull back. ,
PoolMgr.ConnType.USERuserDn
- string value represents the identity of user on who's behalf the request was initiated. The
value will be stored in openldap auditsearch record AuthZID's attribute.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.UnsupportedEncodingException
- for search control errors.protected void add(org.apache.directory.ldap.client.api.LdapConnection connection, org.apache.directory.api.ldap.model.entry.Entry entry) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.entry
- contains data to add..org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void add(org.apache.directory.ldap.client.api.LdapConnection connection, org.apache.directory.api.ldap.model.entry.Entry entry, FortEntity entity) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.entry
- contains data to add..entity
- contains audit context.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void modify(org.apache.directory.ldap.client.api.LdapConnection connection, String dn, List<org.apache.directory.api.ldap.model.entry.Modification> mods) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains distinguished node of entry.mods
- contains data to modify.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void modify(org.apache.directory.ldap.client.api.LdapConnection connection, org.apache.directory.api.ldap.model.name.Dn dn, List<org.apache.directory.api.ldap.model.entry.Modification> mods) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains distinguished node of entry.mods
- contains data to modify.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void modify(org.apache.directory.ldap.client.api.LdapConnection connection, String dn, List<org.apache.directory.api.ldap.model.entry.Modification> mods, FortEntity entity) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains distinguished node of entry.mods
- contains data to modify.entity
- contains audit context.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void modify(org.apache.directory.ldap.client.api.LdapConnection connection, org.apache.directory.api.ldap.model.name.Dn dn, List<org.apache.directory.api.ldap.model.entry.Modification> mods, FortEntity entity) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains distinguished node of entry.mods
- contains data to modify.entity
- contains audit context.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void delete(org.apache.directory.ldap.client.api.LdapConnection connection, String dn) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains distinguished node of entry targeted for removal..org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void delete(org.apache.directory.ldap.client.api.LdapConnection connection, String dn, FortEntity entity) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains distinguished node of entry targeted for removal..entity
- contains audit context.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void delete(org.apache.directory.ldap.client.api.LdapConnection connection, org.apache.directory.api.ldap.model.name.Dn dn, FortEntity entity) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- handle to ldap connection.dn
- contains distinguished node of entry targeted for removal..entity
- contains audit context.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.protected void deleteRecursive(org.apache.directory.ldap.client.api.LdapConnection connection, String dn) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
connection
- handle to ldap connection.dn
- contains distinguished node of entry targeted for removal..org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.IOException
org.apache.directory.api.ldap.model.cursor.CursorException
protected void deleteRecursive(org.apache.directory.ldap.client.api.LdapConnection connection, String dn, FortEntity entity) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
connection
- handle to ldap connection.dn
- contains distinguished node of entry targeted for removal..entity
- contains audit context.org.apache.directory.api.ldap.model.exception.LdapException
- in the event system error occurs.org.apache.directory.api.ldap.model.cursor.CursorException
protected org.apache.directory.api.ldap.model.cursor.SearchCursor search(org.apache.directory.ldap.client.api.LdapConnection connection, String baseDn, org.apache.directory.api.ldap.model.message.SearchScope scope, String filter, String[] attrs, boolean attrsOnly) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- is LdapConnection object used for all communication with host.baseDn
- contains address of distinguished name to begin ldap searchscope
- indicates depth of search starting at basedn. 0 (base dn),
1 (one level down) or 2 (infinite) are valid values.filter
- contains the search criteriaattrs
- is the requested list of attritubutes to return from directory search.attrsOnly
- if true pull back attribute names only.org.apache.directory.api.ldap.model.exception.LdapException
- thrown in the event of error in ldap client or server code.protected org.apache.directory.api.ldap.model.cursor.SearchCursor search(org.apache.directory.ldap.client.api.LdapConnection connection, String baseDn, org.apache.directory.api.ldap.model.message.SearchScope scope, String filter, String[] attrs, boolean attrsOnly, int maxEntries) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- is LdapConnection object used for all communication with host.baseDn
- contains address of distinguished name to begin ldap searchscope
- indicates depth of search starting at basedn. 0 (base dn),
1 (one level down) or 2 (infinite) are valid values.filter
- contains the search criteriaattrs
- is the requested list of attritubutes to return from directory search.attrsOnly
- if true pull back attribute names only.maxEntries
- specifies the maximum number of entries to return in this search query.org.apache.directory.api.ldap.model.exception.LdapException
- thrown in the event of error in ldap client or server code.protected org.apache.directory.api.ldap.model.entry.Entry searchNode(org.apache.directory.ldap.client.api.LdapConnection connection, String baseDn, org.apache.directory.api.ldap.model.message.SearchScope scope, String filter, String[] attrs, boolean attrsOnly) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
connection
- is LdapConnection object used for all communication with host.baseDn
- contains address of distinguished name to begin ldap searchscope
- indicates depth of search starting at basedn. 0 (base dn),
1 (one level down) or 2 (infinite) are valid values.filter
- contains the search criteriaattrs
- is the requested list of attritubutes to return from directory search.attrsOnly
- if true pull back attribute names only.org.apache.directory.api.ldap.model.exception.LdapException
- thrown in the event of error in ldap client or server code.org.apache.directory.api.ldap.model.cursor.CursorException
- If we weren't able to fetch an element from the search resultprotected org.apache.directory.api.ldap.model.entry.Entry searchNode(org.apache.directory.ldap.client.api.LdapConnection connection, String baseDn, org.apache.directory.api.ldap.model.message.SearchScope scope, String filter, String[] attrs, boolean attrsOnly, String userDn) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
connection
- is LdapConnection object used for all communication with host.baseDn
- contains address of distinguished name to begin ldap searchscope
- indicates depth of search starting at basedn. 0 (base dn),
1 (one level down) or 2 (infinite) are valid values.filter
- contains the search criteriaattrs
- is the requested list of attritubutes to return from directory search.attrsOnly
- if true pull back attribute names only.userDn
- string value represents the identity of user on who's behalf the request was initiated. The
value will be stored in openldap auditsearch record AuthZID's attribute.org.apache.directory.api.ldap.model.exception.LdapException
- thrown in the event of error in ldap client or server code.org.apache.directory.api.ldap.model.cursor.CursorException
- If we weren't able to fetch an element from the search resultprotected boolean compareNode(org.apache.directory.ldap.client.api.LdapConnection connection, String dn, String userDn, org.apache.directory.api.ldap.model.entry.Attribute attribute) throws org.apache.directory.api.ldap.model.exception.LdapException, UnsupportedEncodingException
connection
- is LdapConnection object used for all communication with host.dn
- contains address of distinguished name to begin ldap searchuserDn
- dn for user nodeattribute
- attribute used for compareorg.apache.directory.api.ldap.model.exception.LdapException
- thrown in the event of error in ldap client or server code.UnsupportedEncodingException
- in the event the server cannot perform the operation.protected List<String> getAttributes(org.apache.directory.api.ldap.model.entry.Entry entry, String attributeName)
entry
- contains the target ldap entry.attributeName
- name of ldap attribute to retrieve.protected byte[] getPhoto(org.apache.directory.api.ldap.model.entry.Entry entry, String attributeName) throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
entry
- contains the image target.attributeName
- to be retrieved.org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
- contains the system error.protected Set<String> getAttributeSet(org.apache.directory.api.ldap.model.entry.Entry entry, String attributeName)
entry
- contains the target ldap entry.attributeName
- name of ldap attribute to retrieve.protected String getAttribute(org.apache.directory.api.ldap.model.entry.Entry entry, String attributeName) throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
entry
- contains the target ldap entry.attributeName
- name of ldap attribute to retrieve.org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
- When we weren't able to get the attribute from the entryprotected String getRdn(String dn)
dn
- contains ldap distinguished name.protected org.apache.directory.api.ldap.model.entry.Attribute createAttributes(String name, String[] values) throws org.apache.directory.api.ldap.model.exception.LdapException
name
- contains attribute name to create.values
- array of string that contains attribute values.org.apache.directory.api.ldap.model.exception.LdapException
- in the event of ldap client error.protected void unloadTemporal(org.apache.directory.api.ldap.model.entry.Entry le, Constraint ftDateTime) throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
le
- ldap entry containing constraint.ftDateTime
- reference to Constraint
containing formatted data.org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
- when we weren't able to retrieve the attribute from the entryprotected void loadAttrs(List<String> list, org.apache.directory.api.ldap.model.entry.Entry entry, String attrName) throws org.apache.directory.api.ldap.model.exception.LdapException
list
- list of type string containing attribute values to load into attribute set.entry
- contains ldap attribute set targeted for adding.attrName
- name of ldap attribute being added.org.apache.directory.api.ldap.model.exception.LdapException
- If we weren't able to add the attributes into the entryprotected void loadAttrs(List<String> list, List<org.apache.directory.api.ldap.model.entry.Modification> mods, String attrName)
list
- list of type string containing attribute values to load into modification set.mods
- contains ldap modification set targeted for updating.attrName
- name of ldap attribute being modified.protected void loadRelationshipAttrs(List<Relationship> list, List<org.apache.directory.api.ldap.model.entry.Modification> mods, String attrName, Hier.Op op)
Relationship
s, convert to raw data name-value format and
load into ldap modification set in preparation for ldap modify.list
- contains List of type Relationship
targeted for updating in ldap.mods
- ldap modification set containing parent-child relationships in raw ldap format.attrName
- contains the name of the ldap attribute to be updated.op
- specifies type of mod: Hier.Op.ADD
,
Hier.Op.MOD
, Hier.Op.REM
.protected void loadAttrs(Set<String> values, List<org.apache.directory.api.ldap.model.entry.Modification> mods, String attrName)
values
- set of type string containing attribute values to load into modification set.mods
- contains ldap modification set targeted for updating.attrName
- name of ldap attribute being updated.protected void loadAttrs(Set<String> values, org.apache.directory.api.ldap.model.entry.Entry entry, String attrName) throws org.apache.directory.api.ldap.model.exception.LdapException
values
- set of type string containing attribute values to load into attribute set.entry
- contains ldap entry to pull attrs from.attrName
- name of ldap attribute being added.org.apache.directory.api.ldap.model.exception.LdapException
- If we weren't able to add the values into the entryprotected void loadProperties(Properties props, List<org.apache.directory.api.ldap.model.entry.Modification> mods, String attrName, boolean replace)
Properties
, convert to raw data name-value format and load into ldap
modification set in preparation for ldap modify.props
- contains Properties
targeted for updating in ldap.mods
- ldap modification set containing name-value pairs in raw ldap format.attrName
- contains the name of the ldap attribute to be updated.replace
- boolean variable, if set to true use ModificationOperation.REPLACE_ATTRIBUTE
else ModificationOperation.ADD_ATTRIBUTE
.protected void loadProperties(Properties props, List<org.apache.directory.api.ldap.model.entry.Modification> mods, String attrName, boolean replace, char separator)
Properties
, convert to raw data name-value format and load into ldap
modification set in preparation for ldap modify.props
- contains Properties
targeted for updating in ldap.mods
- ldap modification set containing name-value pairs in raw ldap format.attrName
- contains the name of the ldap attribute to be updated.replace
- boolean variable, if set to true use ModificationOperation.REPLACE_ATTRIBUTE
else ModificationOperation.ADD_ATTRIBUTE
.separator
- contains the char value used to separate name and value in ldap raw format.protected void removeProperties(Properties props, List<org.apache.directory.api.ldap.model.entry.Modification> mods, String attrName)
Properties
, convert to raw data name-value format and load into ldap
modification set in preparation for ldap modify.props
- contains Properties
targeted for removal from ldap.mods
- ldap modification set containing name-value pairs in raw ldap format to be removed.attrName
- contains the name of the ldap attribute to be removed.protected void loadProperties(Properties props, org.apache.directory.api.ldap.model.entry.Entry entry, String attrName) throws org.apache.directory.api.ldap.model.exception.LdapException
Properties
, convert to raw data name-value format and load into ldap
modification set in preparation for ldap add.props
- contains Properties
targeted for adding to ldap.entry
- contains ldap entry to pull attrs from.attrName
- contains the name of the ldap attribute to be added.org.apache.directory.api.ldap.model.exception.LdapException
- If we weren't able to add the properies into the entryprotected void loadProperties(Properties props, org.apache.directory.api.ldap.model.entry.Entry entry, String attrName, char separator) throws org.apache.directory.api.ldap.model.exception.LdapException
Properties
, convert to raw data name-value format and load into ldap modification set in preparation for ldap add.props
- contains Properties
targeted for adding to ldap.entry
- contains ldap entry to push attrs into.attrName
- contains the name of the ldap attribute to be added.separator
- contains the char value used to separate name and value in ldap raw format.org.apache.directory.api.ldap.model.exception.LdapException
- If we weren't able to add the properies into the entryprotected String encodeSafeText(String value, int validLen) throws org.apache.directory.api.ldap.model.exception.LdapException
value
- The value to encodevalidLen
- The maximum accepted length of the value.org.apache.directory.api.ldap.model.exception.LdapException
- If the value is longer than the maximum valueprotected org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy getPwdRespCtrl(org.apache.directory.api.ldap.model.message.Response resp)
resp
- contains reference to LDAP pw policy response.protected org.apache.directory.api.ldap.model.message.BindResponse bind(org.apache.directory.ldap.client.api.LdapConnection connection, String szUserDn, char[] password) throws org.apache.directory.api.ldap.model.exception.LdapException
connection
- connection to ldap server.szUserDn
- contains the LDAP dn to the user entry in String format.password
- contains the password in clear text.org.apache.directory.api.ldap.model.exception.LdapException
- in the event of LDAP error.public void closeAdminConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
connection
- handle to ldap connection object.protected void closeLogConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
connection
- handle to ldap connection object.protected void closeUserConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
connection
- handle to ldap connection object.public org.apache.directory.ldap.client.api.LdapConnection getAdminConnection() throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue getting an LDAP connectionprotected org.apache.directory.ldap.client.api.LdapConnection getLogConnection() throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue getting an LDAP connectionprotected org.apache.directory.ldap.client.api.LdapConnection getUserConnection() throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue getting an LDAP connectionpublic static LdapCounters getLdapCounters()
LdapCounters
contains long values of atomic ldap operations for current running process.protected String escapeLDAPSearchFilter(String filter)
filter
- contains the data to filter.public static void closeAllConnectionPools()
Copyright © 2003-2016, The Apache Software Foundation. All Rights Reserved. Generated 20160718-1621