Class AbstractExecutableStatementBuilder
- java.lang.Object
-
- net.shibboleth.utilities.java.support.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 DurationqueryTimeoutQuery timeout.
-
Constructor Summary
Constructors Constructor Description AbstractExecutableStatementBuilder()Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ExecutableStatementbuild(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes)Creates an executable search that can be executed against a data source in order to produce results.DurationgetQueryTimeout()Gets the timeout of the SQL query.protected abstract StringgetSQLQuery(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes)Method to return the query SQL.voidsetQueryTimeout(Duration timeout)Sets the timeout of the SQL query.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
queryTimeout
@Nonnull private Duration queryTimeout
Query timeout.
-
-
Method Detail
-
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
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 resolutiondependencyAttributes- made available to the executable search- Returns:
- the SQL string
- Throws:
ResolutionException- if we get an error building the exception.
-
build
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:
buildin interfaceExecutableSearchBuilder<ExecutableStatement>- Parameters:
resolutionContext- current request contextdependencyAttributes- made available to the executable search- Returns:
- executable search
- Throws:
ResolutionException- throw if their is a problem creating the executable search
-
-