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

# Class AbstractExecutableStatementBuilder

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

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

Direct Known Subclasses:
  `FormatExecutableStatementBuilder`, `TemplatedExecutableStatementBuilder`

public abstract class AbstractExecutableStatementBuilder extends AbstractInitializableComponent implements ExecutableSearchBuilder<ExecutableStatement>
Basis of statement builder. The derived classes just have to provide the per request sql string.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Duration`
`queryTimeout`
Query timeout.

## Constructor Summary

Constructors
Constructor
Description
`AbstractExecutableStatementBuilder()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`ExecutableStatement`
`build(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes)`
Creates an executable search that can be executed against a data source in order to produce results.
`Duration`
`getQueryTimeout()`
Gets the timeout of the SQL query.
`protected abstract String`
`getSQLQuery(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes)`
Method to return the query SQL.
`void`
`setQueryTimeout(Duration timeout)`
Sets the timeout of the SQL query.

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

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, 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

### queryTimeout

@Nonnull private Duration queryTimeout
Query timeout.

## Constructor Details

### AbstractExecutableStatementBuilder

public AbstractExecutableStatementBuilder()
Constructor.

## Method Details

### getQueryTimeout

@Nonnull public Duration getQueryTimeout()
Gets the timeout of the SQL query.

Returns:
  timeout of the SQL query

### setQueryTimeout

public void setQueryTimeout(@Nonnull Duration timeout)
Sets the timeout of the SQL query.

Parameters:
  `timeout` - of the SQL query

### getSQLQuery

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

Parameters:
  `resolutionContext` - the context of the resolution
  `dependencyAttributes` - made available to the executable search
Returns:
  the SQL string
Throws:
  `ResolutionException` - if we get an error building the exception.

### build

@Nonnull public ExecutableStatement build(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes) throws ResolutionException
Creates an executable search that can be executed against a data source in order to produce results.

Specified by:
  `build` in interface `ExecutableSearchBuilder<ExecutableStatement>`
Parameters:
  `resolutionContext` - current request context
  `dependencyAttributes` - made available to the executable search
Returns:
  executable search
Throws:
  `ResolutionException` - throw if their is a problem creating the executable search