public class LDAPCollectionHelper extends AbstractLDAPConnector implements Component
SynchronizableContentsCollection
s which need to access a LDAPModifier and Type | Field and Description |
---|---|
private boolean |
_hasGlobalError |
private int |
_nbError |
static String |
ROLE
Avalon Role
|
__DEFAULT_PAGE_SIZE, _ldapAdminPassword, _ldapAdminRelativeDN, _ldapAliasDerefMode, _ldapAuthenticationMethod, _ldapBaseDN, _ldapFollowReferrals, _ldapUrl, _ldapUseSSL, _pagingSupported
Constructor and Description |
---|
LDAPCollectionHelper() |
Modifier and Type | Method and Description |
---|---|
protected void |
_cleanup(Context context,
NamingEnumeration result,
Logger logger)
Clean a connection to a ldap server.
|
void |
_delayedInitialize(String dataSourceId)
Call this method with the datasource id to initialize this component
|
protected Map<String,List<Object>> |
_getAttributes(SearchResult entry,
Map<String,List<String>> mapping)
Gets attributes from a ldap entry.
|
protected Object |
_getIdValue(String idKey,
SearchResult entry,
Logger logger)
Gets id value from a ldap entry
|
protected int |
_getScope(String scopeStr)
Get the scope as an integer (handlable by the SearchControls) from the scope string.
|
protected SearchControls |
_getSearchControls(Map<String,List<String>> mapping,
String searchScope)
Get the LDAP search controls.
|
int |
getNbErrors()
Returns the number of errors which occured
search(String, int, String, String, String, Map, String, Logger) |
boolean |
hasGlobalError()
Returns true if the a global error occured during
search(String, int, String, String, String, Map, String, Logger) |
Map<String,Map<String,List<Object>>> |
search(String collectionId,
int pageSize,
String relativeDN,
String filter,
String searchScope,
Map<String,List<String>> mapping,
String idKey,
Logger logger)
Search over the LDAP the contents to import.
|
_cleanup, _getConfigParameter, _getContextEnv, _getFilter, _getRootContextEnv, _getSearchScope, _search, _search, _setPagingIfSupported, _testPagingSupported, isPagingSupported, service
addObjectInCache, clearCache, dispose, getObjectFromCache, initialize, isCacheEnabled, removeObjectFromCache
getLogger, setLogger
private int _nbError
private boolean _hasGlobalError
public LDAPCollectionHelper()
public void _delayedInitialize(String dataSourceId) throws Exception
AbstractLDAPConnector
_delayedInitialize
in class AbstractLDAPConnector
dataSourceId
- The id of the datasourceException
- If an error occurs.public Map<String,Map<String,List<Object>>> search(String collectionId, int pageSize, String relativeDN, String filter, String searchScope, Map<String,List<String>> mapping, String idKey, Logger logger)
getNbErrors()
and hasGlobalError()
to know about error which occured.collectionId
- The id of the collection being synchronizedpageSize
- The page size for the searchrelativeDN
- the name of the context or object to searchfilter
- the filter expression to use for the searchsearchScope
- The search scopemapping
- The mapping for retrieving the remote values (keys are metadata paths, )idKey
- The key where to search the id value of the contentlogger
- The loggerpublic int getNbErrors()
search(String, int, String, String, String, Map, String, Logger)
search(String, int, String, String, String, Map, String, Logger)
public boolean hasGlobalError()
search(String, int, String, String, String, Map, String, Logger)
search(String, int, String, String, String, Map, String, Logger)
protected SearchControls _getSearchControls(Map<String,List<String>> mapping, String searchScope) throws ProcessingException
mapping
- The mappingsearchScope
- The search scopeProcessingException
- if the scope is not validprotected int _getScope(String scopeStr) throws ProcessingException
scopeStr
- the scope string.ProcessingException
- if the given scope is not validprotected Object _getIdValue(String idKey, SearchResult entry, Logger logger) throws NamingException
idKey
- The key where to search the id valueentry
- The ldap entrylogger
- The loggerNamingException
- if a ldap query error occurredprotected Map<String,List<Object>> _getAttributes(SearchResult entry, Map<String,List<String>> mapping) throws NamingException
entry
- The ldap entrymapping
- The mappingNamingException
- if a ldap query error occuredprotected void _cleanup(Context context, NamingEnumeration result, Logger logger)
context
- The connection to the database to close.result
- The result to close.logger
- The logger