|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ametys.plugins.datainclusion.data.AbstractQuery
org.ametys.plugins.datainclusion.data.ldap.LdapQuery
public class LdapQuery
A LDAP query.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.ametys.plugins.datainclusion.data.Query |
|---|
Query.ResultType |
| Field Summary | |
|---|---|
protected Map<String,String> |
_attributeMap
The decoded attributes. |
protected String |
_attributes
The LDAP attributes to return. |
protected String |
_constraint
The LDAP constraint, optionally contains parameters. |
protected LdapDataSource |
_dataSource
The LDAP data source. |
static Pattern |
ATTRIBUTE_MATCHER
Attribute matcher. |
static String |
ATTRIBUTE_PATTERN
Attribute pattern (matches attributeName[attributeLabel]). |
| Fields inherited from class org.ametys.plugins.datainclusion.data.AbstractQuery |
|---|
_description, _id, _name, _parameters, _resultType |
| Fields inherited from interface org.ametys.plugins.datainclusion.data.Query |
|---|
PARAMETER_MATCHER, PARAMETER_PATTERN |
| Constructor Summary | |
|---|---|
LdapQuery()
|
|
| Method Summary | |
|---|---|
protected Map<String,String> |
_buildAttributesMap(String query)
Extract attributes from a query string in the form "attr1[label1], attr2[label2], attr3". |
protected void |
_cleanup(Context context,
NamingEnumeration<SearchResult> result)
Cleans a connection to a LDAP server. |
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. |
QueryResult |
execute(Map parameterValues)
Execute the query with the specified parameter values. |
Map<String,String> |
getAdditionalConfiguration()
Get the additional query configuration information. |
String |
getAttributes()
Get the LDAP attributes to return. |
Map<String,String> |
getAttributesAsMap()
Get attributes as Map. |
String |
getConstraint()
Get the LDAP constraint. |
LdapDataSource |
getDataSource()
Get the datasource on which depends this query. |
List<String> |
getParameterNames()
Get the query parameter names. |
String |
getType()
Get the query type. |
void |
setAttributes(String attributes)
Set the LDAP attributes to return. |
void |
setConstraint(String constraint)
Set the LDAP constraint. |
void |
setDataSource(LdapDataSource dataSource)
Set this query data source. |
| Methods inherited from class org.ametys.plugins.datainclusion.data.AbstractQuery |
|---|
_buildParameters, getDescription, getId, getName, getResultType, setDescription, setId, setName, setResultType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ATTRIBUTE_PATTERN
public static final Pattern ATTRIBUTE_MATCHER
protected String _attributes
protected String _constraint
protected Map<String,String> _attributeMap
protected LdapDataSource _dataSource
| Constructor Detail |
|---|
public LdapQuery()
| Method Detail |
|---|
public String getType()
Query
public String getAttributes()
public void setAttributes(String attributes)
attributes - LDAP attributes to return.public String getConstraint()
public void setConstraint(String constraint)
constraint - the LDAP constraint to set.public List<String> getParameterNames()
Query
public LdapDataSource getDataSource()
Query
public void setDataSource(LdapDataSource dataSource)
dataSource - public Map<String,String> getAdditionalConfiguration()
Query
public Map<String,String> getAttributesAsMap()
protected Map<String,String> _buildAttributesMap(String query)
query - the query containing parameters.
public QueryResult execute(Map parameterValues)
throws DataInclusionException
Query
parameterValues - the parameter values as a Map (name -> value).
DataInclusionException
protected SearchControls _getSearchControls(Collection<String> attributes,
String scopeStr)
attributes - the attributes to return.scopeStr - the scope as a String.
protected int _getScope(String scopeStr)
scopeStr - the scope string.
protected void _cleanup(Context context,
NamingEnumeration<SearchResult> result)
context - The connection to the database to close.result - The result to close.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||