public class LdapQueryResult extends Object implements QueryResult
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
_attributes
The attribute labels.
|
protected List<String> |
_columnNames
The column names (ordered)
|
protected Query.ResultType |
_resultType
The result type.
|
protected List<QueryResultRow> |
_rows
The result rows.
|
Constructor and Description |
---|
LdapQueryResult(List<SearchResult> results,
List<String> columnNames,
Map<String,String> attributes)
Constructs a query result around a ResultSet.
|
Modifier and Type | Method and Description |
---|---|
protected 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.
|
Collection<String> |
getColumnNames()
Get the column names.
|
int |
getSize()
Get size
|
Query.ResultType |
getType()
Get the type of the result.
|
Iterator<QueryResultRow> |
iterator() |
void |
setType(Query.ResultType resultType)
Set the result type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected Query.ResultType _resultType
protected List<QueryResultRow> _rows
protected List<String> _columnNames
protected Map<String,String> _attributes
public LdapQueryResult(List<SearchResult> results, List<String> columnNames, Map<String,String> attributes)
results
- the list of search resultscolumnNames
- the names of the columnsattributes
- the attributespublic Query.ResultType getType()
QueryResult
getType
in interface QueryResult
public void setType(Query.ResultType resultType)
resultType
- the result type.public int getSize()
QueryResult
getSize
in interface QueryResult
public Collection<String> getColumnNames() throws DataInclusionException
QueryResult
getColumnNames
in interface QueryResult
DataInclusionException
- if an error occurs while manipulating the data sourcespublic Iterator<QueryResultRow> iterator()
iterator
in interface Iterable<QueryResultRow>
public void close()
QueryResult
close
in interface QueryResult
protected void _extractResults(List<SearchResult> results, List<String> columnNames, Map<String,String> attributes) throws NamingException
results
- the LDAP naming enumeration.columnNames
- the names of the columnsattributes
- the attributesNamingException
- if something goes wrong when manipulating the context