Package net.shibboleth.idp.attribute.resolver.dc.rdbms

# Class FormatExecutableStatementBuilder

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.rdbms.AbstractExecutableStatementBuilder
net.shibboleth.idp.attribute.resolver.dc.rdbms.FormatExecutableStatementBuilder

All Implemented Interfaces:
  `ExecutableSearchBuilder<ExecutableStatement>`, `Component`, `DestructableComponent`, `InitializableComponent`

public class FormatExecutableStatementBuilder extends AbstractExecutableStatementBuilder
An `ExecutableSearchBuilder`. It generates the SQL statement to be executed by invoking `String.format(String, Object...)` with `AttributeResolutionContext.getPrincipal()`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`sqlQuery`
SQL query string.

## Constructor Summary

Constructors
Constructor
Description
`FormatExecutableStatementBuilder()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`protected String`
`getSQLQuery(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes)`
Method to return the query SQL.
`void`
`setQuery(String query)`
Set the query to search the database.

### Methods inherited from class net.shibboleth.idp.attribute.resolver.dc.rdbms.AbstractExecutableStatementBuilder

`build, getQueryTimeout, setQueryTimeout`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### sqlQuery

@NonnullAfterInit private String sqlQuery
SQL query string.

## Constructor Details

### FormatExecutableStatementBuilder

public FormatExecutableStatementBuilder()

## Method Details

### setQuery

public void setQuery(@Nonnull String query)
Set the query to search the database.

Parameters:
  `query` - query to search the database

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### getSQLQuery

@Nonnull protected String getSQLQuery(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes)
Method to return the query SQL.

Specified by:
  `getSQLQuery` in class `AbstractExecutableStatementBuilder`
Parameters:
  `resolutionContext` - the context of the resolution
  `dependencyAttributes` - made available to the executable search
Returns:
  the SQL string