public class LdapDataSourceFactory extends AbstractLDAPConnector implements DataSourceFactory<LdapQuery,LdapQueryResult>, PluginAware
Modifier and Type | Field and Description |
---|---|
private String |
_id |
static String |
QUERY_CONFIGURATION_ATTRIBUTES
The LDAp attributes to return
|
static String |
QUERY_CONFIGURATION_CONSTRAINT
Constraint query parameter.
|
static List<String> |
QUERY_CONFIGURATION_PARAMETERS
Query configuration parameters.
|
static String |
QUERY_CONFIGURATION_RELATIVE_DN
The relative DN for users
|
static String |
QUERY_CONFIGURATION_SCOPE
The search scope of the query
|
__DEFAULT_PAGE_SIZE, _ldapAdminPassword, _ldapAdminRelativeDN, _ldapAliasDerefMode, _ldapAuthenticationMethod, _ldapBaseDN, _ldapFollowReferrals, _ldapUrl, _ldapUseSSL, _pagingSupported, _serverSideSorting
Constructor and Description |
---|
LdapDataSourceFactory() |
Modifier and Type | Method and Description |
---|---|
protected int |
_getScope(String scopeStr)
Get the scope as an integer (handlable by the SearchControls) from the scope string.
|
protected SearchControls |
_getSearchControls(Collection<String> attributes,
String scopeStr)
Get the LDAP search controls.
|
LdapQuery |
buildQuery(String id,
String type,
String name,
String description,
Query.ResultType resultType,
String dataSourceId,
Map<String,String> additionalConfiguration)
Build a query with the specified information.
|
LdapQueryResult |
execute(LdapQuery query,
Map<String,String> parameterValues)
Execute the query with the specified parameter values.
|
LdapQueryResult |
execute(LdapQuery query,
Map<String,String> parameterValues,
int offset,
int limit)
Execute the query with the specified parameter values.
|
Collection<DataSourceClientInteraction.DataSourceType> |
getHandledTypes()
Get the types that the factory can build.
|
Collection<String> |
getQueryConfigurationParameters(String type)
The configuration parameters needed to build a Query of the specified type.
|
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
_cleanup, _delayedInitialize, _getConfigParameter, _getContextEnv, _getFilter, _getRootContextEnv, _getSearchScope, _hasMoreEntries, _search, _search, _search, _search, _setResultsControls, _testConnectionsPooled, _testPagingSupported, getSortByFields, isPagingSupported, service
addObjectInCache, clearCache, dispose, getObjectFromCache, initialize, isCacheEnabled, removeObjectFromCache
getLogger, setLogger
public static final String QUERY_CONFIGURATION_RELATIVE_DN
public static final String QUERY_CONFIGURATION_SCOPE
public static final String QUERY_CONFIGURATION_ATTRIBUTES
public static final String QUERY_CONFIGURATION_CONSTRAINT
public static final List<String> QUERY_CONFIGURATION_PARAMETERS
public LdapDataSourceFactory()
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic Collection<DataSourceClientInteraction.DataSourceType> getHandledTypes()
DataSourceFactory
getHandledTypes
in interface DataSourceFactory<LdapQuery,LdapQueryResult>
public Collection<String> getQueryConfigurationParameters(String type)
DataSourceFactory
getQueryConfigurationParameters
in interface DataSourceFactory<LdapQuery,LdapQueryResult>
type
- the type of the Query.public LdapQuery buildQuery(String id, String type, String name, String description, Query.ResultType resultType, String dataSourceId, Map<String,String> additionalConfiguration) throws DataInclusionException
DataSourceFactory
buildQuery
in interface DataSourceFactory<LdapQuery,LdapQueryResult>
id
- the Query ID.type
- the Query type.name
- the Query name.description
- the Query description.resultType
- the Query result type (single/multiple).dataSourceId
- the id of data sourceadditionalConfiguration
- additional query configuration parameter values as a Map<parameterName, parameterValue>.DataInclusionException
- if an error occurs trying to create the Query.public LdapQueryResult execute(LdapQuery query, Map<String,String> parameterValues) throws DataInclusionException
DataSourceFactory
execute
in interface DataSourceFactory<LdapQuery,LdapQueryResult>
query
- The queryparameterValues
- the parameter values as a Map (name -> value).DataInclusionException
- if an error occurs while executing the querypublic LdapQueryResult execute(LdapQuery query, Map<String,String> parameterValues, int offset, int limit) throws DataInclusionException
DataSourceFactory
execute
in interface DataSourceFactory<LdapQuery,LdapQueryResult>
query
- The queryparameterValues
- the parameter values as a Map (name -> value).offset
- The start index of searchlimit
- The max number of result to returnDataInclusionException
- if an error occurs while executing the queryprotected SearchControls _getSearchControls(Collection<String> attributes, String scopeStr) throws DataInclusionException
attributes
- the attributes to return.scopeStr
- the scope as a String.DataInclusionException
- If an error occurredprotected int _getScope(String scopeStr) throws DataInclusionException
scopeStr
- the scope string.DataInclusionException
- If an error occurred