public class SqlAttributesFilter extends Object implements org.forgerock.http.Filter
Map
object, whose location is specified by the target
expression. If the query yields no result, then the resulting map will be empty.
The execution of the query is performed lazily; it does not occur until the first attempt
to access a value in the target. This defers the overhead of connection pool, network
and database query processing until a value is first required. This also means that the
parameters
expressions will not be evaluated until the map is first accessed.
PreparedStatement
Modifier and Type | Class and Description |
---|---|
static class |
SqlAttributesFilter.Heaplet
Creates and initializes a static attribute provider in a heap environment.
|
Constructor and Description |
---|
SqlAttributesFilter(DataSource dataSource,
LeftValueExpression<Map> target,
String preparedStatement)
Builds a new SqlAttributesFilter that will execute the given SQL statement on the given
DataSource ,
placing the results in a Map in the specified target. |
Modifier and Type | Method and Description |
---|---|
org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,org.forgerock.util.promise.NeverThrowsException> |
filter(org.forgerock.services.context.Context context,
org.forgerock.http.protocol.Request request,
org.forgerock.http.Handler next) |
List<Expression<?>> |
getParameters()
Returns the list of parameters to evaluate and include in the execution of the prepared statement.
|
public SqlAttributesFilter(DataSource dataSource, LeftValueExpression<Map> target, String preparedStatement)
DataSource
,
placing the results in a Map
in the specified target.dataSource
- JDBC data sourcetarget
- Expression that yields the target object that will contain the mapped resultspreparedStatement
- The parameterized SQL query to execute, with ? parameter placeholderspublic List<Expression<?>> getParameters()
public org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,org.forgerock.util.promise.NeverThrowsException> filter(org.forgerock.services.context.Context context, org.forgerock.http.protocol.Request request, org.forgerock.http.Handler next)
filter
in interface org.forgerock.http.Filter
Copyright © 2025 Open Identity Platform Community. All rights reserved.