Class LdapQueryResult
java.lang.Object
org.ametys.plugins.externaldata.data.ldap.LdapQueryResult
- All Implemented Interfaces:
Iterable<QueryResultRow>
,QueryResult
LDAP query result.
-
Field Summary
Modifier and TypeFieldDescriptionThe attribute labels.The column names (ordered)protected Query.ResultType
The result type.protected List<QueryResultRow>
The result rows. -
Constructor Summary
ConstructorDescriptionLdapQueryResult
(List<SearchResult> results, List<String> columnNames, Map<String, String> attributes) Constructs a query result around a ResultSet. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_extractResults
(List<SearchResult> results, List<String> columnNames, Map<String, String> attributes) Extract the column names and results from a LDAP naming enumeration.void
close()
Close and cleanup the underlying objects and resources (resultset if SQL, LDAP resources...) if needed.Get the column names.int
getSize()
Get sizegetType()
Get the type of the result.iterator()
void
setType
(Query.ResultType resultType) Set the result type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
_resultType
The result type. -
_rows
The result rows. -
_columnNames
The column names (ordered) -
_attributes
The attribute labels.
-
-
Constructor Details
-
LdapQueryResult
public LdapQueryResult(List<SearchResult> results, List<String> columnNames, Map<String, String> attributes) Constructs a query result around a ResultSet.- Parameters:
results
- the list of search resultscolumnNames
- the names of the columnsattributes
- the attributes
-
-
Method Details
-
getType
Description copied from interface:QueryResult
Get the type of the result.- Specified by:
getType
in interfaceQueryResult
- Returns:
- the result type.
-
setType
Set the result type.- Parameters:
resultType
- the result type.
-
getSize
Description copied from interface:QueryResult
Get size- Specified by:
getSize
in interfaceQueryResult
- Returns:
- the size
-
getColumnNames
Description copied from interface:QueryResult
Get the column names.- Specified by:
getColumnNames
in interfaceQueryResult
- Returns:
- the column names as a Collection.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
iterator
- Specified by:
iterator
in interfaceIterable<QueryResultRow>
-
close
Description copied from interface:QueryResult
Close and cleanup the underlying objects and resources (resultset if SQL, LDAP resources...) if needed.- Specified by:
close
in interfaceQueryResult
-
_extractResults
protected void _extractResults(List<SearchResult> results, List<String> columnNames, Map<String, String> attributes) throws NamingExceptionExtract the column names and results from a LDAP naming enumeration.- Parameters:
results
- the LDAP naming enumeration.columnNames
- the names of the columnsattributes
- the attributes- Throws:
NamingException
- if something goes wrong when manipulating the context
-