- All Known Implementing Classes:
- DbClientServiceContextImpl
public interface DbClientServiceContext
Interceptor context to get (and possibly manipulate) database operations.
 
 This is a mutable object - acts as a builder during the invocation of DbClientService.
 The interceptors are executed sequentially, so there is no need for synchronization.
- 
Method SummaryModifier and TypeMethodDescriptioncontext()Context with parameters passed from the caller, such asSpanContextfor tracing.Set a new context to be used by other interceptors and when executing the statement.static DbClientServiceContextcreate(DbExecuteContext execContext, DbStatementType stmtType, CompletionStage<Void> stmtFuture, CompletionStage<Long> queryFuture, DbStatementParameters stmtParams) Create a new client service context.dbType()Type of this database (usually the same string used by theDbClientProvider.name()).parameters(List<Object> parameters) Set new indexed parameters to be used.parameters(Map<String, Object> parameters) Set new named parameters to be used.A stage that is completed once the results were fully read.Text of the statement to be executed.Set a new statement to be used.Set a new statement with indexed parameters to be used.Set a new statement with named parameters to be used.A stage that is completed once the statement finishes execution.Name of a statement to be executed.statementName(String name) Set a new statement name to be used.Get the statement parameters.Type of the statement being executed.
- 
Method Details- 
contextContext context()Context with parameters passed from the caller, such asSpanContextfor tracing.- Returns:
- context associated with this request
 
- 
statementString statement()Text of the statement to be executed.- Returns:
- statement text
 
- 
statementNameString statementName()Name of a statement to be executed. Ad hoc statements have names generated.- Returns:
- name of the statement
 
- 
statementTypeDbStatementType statementType()Type of the statement being executed.- Returns:
- statement type
 
- 
statementParametersDbStatementParameters statementParameters()Get the statement parameters.- Returns:
- statement parameters
 
- 
dbTypeString dbType()Type of this database (usually the same string used by theDbClientProvider.name()).- Returns:
- type of database
 
- 
statementFutureCompletionStage<Void> statementFuture()A stage that is completed once the statement finishes execution.- Returns:
- statement future
 
- 
resultFutureCompletionStage<Long> resultFuture()A stage that is completed once the results were fully read. The number returns either the number of modified records or the number of records actually read.- Returns:
- stage that completes once all query results were processed.
 
- 
statementSet a new statement with indexed parameters to be used.- Parameters:
- stmt- statement text
- parameters- indexed parameters
- Returns:
- updated interceptor context
 
- 
statementSet a new statement with named parameters to be used.- Parameters:
- stmt- statement text
- parameters- named parameters
- Returns:
- updated interceptor context
 
- 
parametersSet new indexed parameters to be used.- Parameters:
- parameters- parameters
- Returns:
- updated interceptor context
- Throws:
- IllegalArgumentException- in case the statement is using named parameters
 
- 
parametersSet new named parameters to be used.- Parameters:
- parameters- parameters
- Returns:
- updated interceptor context
- Throws:
- IllegalArgumentException- in case the statement is using indexed parameters
 
- 
contextSet a new context to be used by other interceptors and when executing the statement.- Parameters:
- context- context to use
- Returns:
- updated interceptor context
 
- 
statementSet a new statement to be used.- Parameters:
- name- statement text to use
- Returns:
- updated interceptor context
 
- 
statementNameSet a new statement name to be used.- Parameters:
- name- statement name to use
- Returns:
- updated interceptor context
 
- 
createstatic DbClientServiceContext create(DbExecuteContext execContext, DbStatementType stmtType, CompletionStage<Void> stmtFuture, CompletionStage<Long> queryFuture, DbStatementParameters stmtParams) Create a new client service context.- Parameters:
- execContext- execution context
- stmtType- statement type
- stmtFuture- statement future
- queryFuture- query future
- stmtParams- statement parameters
- Returns:
- new client service context
 
 
-