Module io.helidon.dbclient.mongodb
Package io.helidon.dbclient.mongodb
Class MongoDbClientProviderBuilder
java.lang.Object
io.helidon.dbclient.mongodb.MongoDbClientProviderBuilder
- All Implemented Interfaces:
Builder<MongoDbClientProviderBuilder,
,DbClient> DbClientProviderBuilder<MongoDbClientProviderBuilder>
,Supplier<DbClient>
public final class MongoDbClientProviderBuilder
extends Object
implements DbClientProviderBuilder<MongoDbClientProviderBuilder>
Builder for mongoDB database.
-
Method Summary
Modifier and TypeMethodDescription<TYPE> MongoDbClientProviderBuilder
addMapper
(DbMapper<TYPE> dbMapper, GenericType<TYPE> mappedType) Add a custom mapper with generic types support.<TYPE> MongoDbClientProviderBuilder
Add a custom mapper.addMapperProvider
(DbMapperProvider provider) Database schema mappers provider.addService
(DbClientService clientService) Add an interceptor.build()
Build database handler for specific provider.Use database connection configuration from configuration file.Credential database.mapperManager
(MapperManager manager) Mapper manager for generic mapping, such as mapping of parameters to expected types.Set database connection p¨assword.statements
(DbStatements statements) Statements to use either from configuration or manually configured.Set database connection string (URL).Set database connection user name.
-
Method Details
-
build
Description copied from interface:DbClientProviderBuilder
Build database handler for specific provider.- Specified by:
build
in interfaceBuilder<MongoDbClientProviderBuilder,
DbClient> - Specified by:
build
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Returns:
- database handler instance
-
config
Description copied from interface:DbClientProviderBuilder
Use database connection configuration from configuration file.- Specified by:
config
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Parameters:
config
-Config
instance with database connection attributes- Returns:
- database provider builder
-
url
Description copied from interface:DbClientProviderBuilder
Set database connection string (URL).- Specified by:
url
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Parameters:
url
- database connection string- Returns:
- database provider builder
-
username
Description copied from interface:DbClientProviderBuilder
Set database connection user name.- Specified by:
username
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Parameters:
username
- database connection user name- Returns:
- database provider builder
-
password
Description copied from interface:DbClientProviderBuilder
Set database connection p¨assword.- Specified by:
password
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Parameters:
password
- database connection password- Returns:
- database provider builder
-
credDb
Credential database.- Parameters:
db
- database name- Returns:
- updated builder instance
-
statements
Description copied from interface:DbClientProviderBuilder
Statements to use either from configuration or manually configured.- Specified by:
statements
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Parameters:
statements
- Statements to use- Returns:
- updated builder instance
-
addService
Description copied from interface:DbClientProviderBuilder
Add an interceptor. This allows to add implementation of tracing, metrics, logging etc. without the need to hard-code these into the base.- Specified by:
addService
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Parameters:
clientService
- interceptor instance- Returns:
- updated builder instance
-
addMapper
public <TYPE> MongoDbClientProviderBuilder addMapper(DbMapper<TYPE> dbMapper, Class<TYPE> mappedClass) Description copied from interface:DbClientProviderBuilder
Add a custom mapper.- Specified by:
addMapper
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Type Parameters:
TYPE
- type of the supported class- Parameters:
dbMapper
- the mapper capable of mapping the mappedClass to various database objectsmappedClass
- class that this mapper supports- Returns:
- updated builder instance.
-
addMapper
public <TYPE> MongoDbClientProviderBuilder addMapper(DbMapper<TYPE> dbMapper, GenericType<TYPE> mappedType) Description copied from interface:DbClientProviderBuilder
Add a custom mapper with generic types support.- Specified by:
addMapper
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Type Parameters:
TYPE
- type of the supported class- Parameters:
dbMapper
- the mapper capable of mapping the mappedClass to various database objectsmappedType
- type that this mapper supports- Returns:
- updated builder instance.
-
mapperManager
Description copied from interface:DbClientProviderBuilder
Mapper manager for generic mapping, such as mapping of parameters to expected types.- Specified by:
mapperManager
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Parameters:
manager
- mapper manager- Returns:
- updated builder instance
-
addMapperProvider
Description copied from interface:DbClientProviderBuilder
Database schema mappers provider.- Specified by:
addMapperProvider
in interfaceDbClientProviderBuilder<MongoDbClientProviderBuilder>
- Parameters:
provider
- database schema mappers provider to use- Returns:
- updated builder instance
-