Class LdapQuery
java.lang.Object
org.ametys.plugins.externaldata.data.AbstractQuery
org.ametys.plugins.externaldata.data.ldap.LdapQuery
- All Implemented Interfaces:
Query
A LDAP query.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.plugins.externaldata.data.Query
Query.ResultType
-
Field Summary
Modifier and TypeFieldDescriptionThe decoded attributes.protected String
The LDAP attributes to return.protected String
The LDAP constraint, optionally contains parameters.protected String
Relative DN for users.protected String
The LDAP constraint, optionally contains parameters.static final Pattern
Attribute matcher.static final String
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
-
Method Summary
Modifier and TypeMethodDescription_buildAttributesMap
(String query) Extract attributes from a query string in the form "attr1[label1], attr2[label2], attr3".Get the additional query configuration information.Get the LDAP attributes to return.Get attributes as Map.Get the LDAP constraint.Get the query parameter names.Get the relative DN for usersgetScope()
Get the LDAP scope.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
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 Details
-
ATTRIBUTE_PATTERN
Attribute pattern (matches attributeName[attributeLabel]).- See Also:
-
ATTRIBUTE_MATCHER
Attribute matcher. -
_attributes
The LDAP attributes to return. -
_constraint
The LDAP constraint, optionally contains parameters. -
_relativeDN
Relative DN for users. -
_scope
The LDAP constraint, optionally contains parameters. -
_attributeMap
The decoded attributes.
-
-
Constructor Details
-
LdapQuery
public LdapQuery()
-
-
Method Details
-
getType
Description copied from interface:Query
Get the query type.- Returns:
- the query type.
-
getAttributes
Get the LDAP attributes to return.- Returns:
- the LDAP attributes.
-
setAttributes
Set the LDAP attributes to return.- Parameters:
attributes
- LDAP attributes to return.
-
getConstraint
Get the LDAP constraint.- Returns:
- the LDAP constraint.
-
setConstraint
Set the LDAP constraint.- Parameters:
constraint
- the LDAP constraint to set.
-
setRelativeDN
Set relative DN for users- Parameters:
relativeDN
- the LDAP relative DN for users
-
getRelativeDN
Get the relative DN for users- Returns:
- the relative DN for users
-
getScope
Get the LDAP scope.- Returns:
- the LDAP scope
-
setScope
Set the LDAP scope.- Parameters:
scope
- the LDAP scope to set
-
getParameters
Description copied from interface:Query
Get the query parameter names.- Returns:
- the query parameter names as a Collection.
-
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
Get attributes as Map.- Returns:
- the attributes as a Map of attributeName -> label.
-
_buildAttributesMap
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.
-