- java.lang.Object
-
- io.helidon.dbclient.common.DbClientServiceBase
-
- All Implemented Interfaces:
DbClientService
- Direct Known Subclasses:
DbClientTracing
public abstract class DbClientServiceBase extends Object implements DbClientService
A base implementation of a client service that supports configuration of execution based on a statement name pattern and statement types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DbClientServiceBase.DbClientServiceBuilderBase<B extends DbClientServiceBase.DbClientServiceBuilderBase<B>>
A base class for builders ofDbClientServiceBase
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
DbClientServiceBase(DbClientServiceBase.DbClientServiceBuilderBase<?> builder)
Create a new instance based on the builder base each implementation must extend.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Single<DbClientServiceContext>
apply(DbClientServiceContext context)
This method is only invoked if the predicate for this service was passed.Single<DbClientServiceContext>
statement(DbClientServiceContext context)
Statement execution to be intercepted.
-
-
-
Constructor Detail
-
DbClientServiceBase
protected DbClientServiceBase(DbClientServiceBase.DbClientServiceBuilderBase<?> builder)
Create a new instance based on the builder base each implementation must extend.- Parameters:
builder
- builder to configure predicate to use
-
-
Method Detail
-
statement
public final Single<DbClientServiceContext> statement(DbClientServiceContext context)
Description copied from interface:DbClientService
Statement execution to be intercepted. This method is called before the statement execution starts. If there is no need to modify the context and you do not block, returnSingle.just(context)
.- Specified by:
statement
in interfaceDbClientService
- Parameters:
context
- Context to access data needed to process an interceptor- Returns:
- single that completes when this service is finished
-
apply
protected abstract Single<DbClientServiceContext> apply(DbClientServiceContext context)
This method is only invoked if the predicate for this service was passed.- Parameters:
context
- db client invocation context- Returns:
- single with the new context (or the same one if not modified)
- See Also:
statement(io.helidon.dbclient.DbClientServiceContext)
-
-