Class LdapQuery
- java.lang.Object
-
- org.ametys.plugins.externaldata.data.AbstractQuery
-
- org.ametys.plugins.externaldata.data.ldap.LdapQuery
-
- All Implemented Interfaces:
Query
public class LdapQuery extends AbstractQuery
A LDAP query.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.plugins.externaldata.data.Query
Query.ResultType
-
-
Field Summary
Fields Modifier and Type Field Description 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 String
_relativeDN
Relative DN for users.protected String
_scope
The LDAP constraint, optionally contains parameters.static Pattern
ATTRIBUTE_MATCHER
Attribute matcher.static String
ATTRIBUTE_PATTERN
Attribute pattern (matches attributeName[attributeLabel]).-
Fields inherited from class org.ametys.plugins.externaldata.data.AbstractQuery
_dataSourceId, _description, _factoryId, _id, _name, _parameters, _resultType
-
Fields inherited from interface org.ametys.plugins.externaldata.data.Query
PARAMETER_MATCHER, PARAMETER_PATTERN
-
-
Constructor Summary
Constructors Constructor Description LdapQuery()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,String>
_buildAttributesMap(String query)
Extract attributes from a query string in the form "attr1[label1], attr2[label2], attr3".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.Map<String,String>
getParameters()
Get the query parameter names.String
getRelativeDN()
Get the relative DN for usersString
getScope()
Get the LDAP scope.DataSourceClientInteraction.DataSourceType
getType()
Get the query type.void
setAttributes(String attributes)
Set the LDAP attributes to return.void
setConstraint(String constraint)
Set the LDAP constraint.void
setRelativeDN(String relativeDN)
Set relative DN for usersvoid
setScope(String scope)
Set the LDAP scope.-
Methods inherited from class org.ametys.plugins.externaldata.data.AbstractQuery
_buildParameters, getDataSourceId, getDescription, getFactory, getId, getName, getResultType, setDataSourceId, setDescription, setFactory, setId, setName, setResultType
-
-
-
-
Field Detail
-
ATTRIBUTE_PATTERN
public static final String ATTRIBUTE_PATTERN
Attribute pattern (matches attributeName[attributeLabel]).- See Also:
- Constant Field Values
-
ATTRIBUTE_MATCHER
public static final Pattern ATTRIBUTE_MATCHER
Attribute matcher.
-
_attributes
protected String _attributes
The LDAP attributes to return.
-
_constraint
protected String _constraint
The LDAP constraint, optionally contains parameters.
-
_relativeDN
protected String _relativeDN
Relative DN for users.
-
_attributeMap
protected Map<String,String> _attributeMap
The decoded attributes.
-
-
Constructor Detail
-
LdapQuery
public LdapQuery()
-
-
Method Detail
-
getType
public DataSourceClientInteraction.DataSourceType getType()
Description copied from interface:Query
Get the query type.- Returns:
- the query type.
-
getAttributes
public String getAttributes()
Get the LDAP attributes to return.- Returns:
- the LDAP attributes.
-
setAttributes
public void setAttributes(String attributes)
Set the LDAP attributes to return.- Parameters:
attributes
- LDAP attributes to return.
-
getConstraint
public String getConstraint()
Get the LDAP constraint.- Returns:
- the LDAP constraint.
-
setConstraint
public void setConstraint(String constraint)
Set the LDAP constraint.- Parameters:
constraint
- the LDAP constraint to set.
-
setRelativeDN
public void setRelativeDN(String relativeDN)
Set relative DN for users- Parameters:
relativeDN
- the LDAP relative DN for users
-
getRelativeDN
public String getRelativeDN()
Get the relative DN for users- Returns:
- the relative DN for users
-
setScope
public void setScope(String scope)
Set the LDAP scope.- Parameters:
scope
- the LDAP scope to set
-
getParameters
public Map<String,String> getParameters()
Description copied from interface:Query
Get the query parameter names.- Returns:
- the query parameter names as a Collection.
-
getAdditionalConfiguration
public Map<String,String> getAdditionalConfiguration()
Description copied from interface:Query
Get the additional query configuration information.- Returns:
- the additional query configuration information as a Map of String -> String.
-
getAttributesAsMap
public Map<String,String> getAttributesAsMap()
Get attributes as Map.- Returns:
- the attributes as a Map of attributeName -> label.
-
_buildAttributesMap
protected Map<String,String> _buildAttributesMap(String query)
Extract attributes from a query string in the form "attr1[label1], attr2[label2], attr3".- Parameters:
query
- the query containing parameters.- Returns:
- the attributes as a Map of label -> attributeName. If no label was provided between brackets, the name is used.
-
-