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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild
(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes) Creates an executable search that can be executed against a data source in order to produce results.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.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Field Details
-
queryTimeout
Query timeout.
-
-
Constructor Details
-
AbstractExecutableStatementBuilder
public AbstractExecutableStatementBuilder()Constructor.
-
-
Method Details
-
getQueryTimeout
Gets the timeout of the SQL query.- Returns:
- timeout of the SQL query
-
setQueryTimeout
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 ResolutionExceptionMethod 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 ResolutionExceptionCreates an executable search that can be executed against a data source in order to produce results.- Specified by:
build
in 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
-