@EachProperty(value="r2dbc.datasources", primary="default") public class DefaultBasicR2dbcProperties extends java.lang.Object implements BasicR2dbcProperties
BasicR2dbcProperties
.PREFIX
Modifier | Constructor and Description |
---|---|
protected |
DefaultBasicR2dbcProperties(java.lang.String name,
io.micronaut.context.env.Environment environment)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
io.r2dbc.spi.ConnectionFactoryOptions.Builder |
builder() |
io.r2dbc.spi.ConnectionFactoryOptions.Builder |
getBuilder() |
java.lang.String |
getName() |
protected static io.r2dbc.spi.ConnectionFactoryOptions.Builder |
newConnectionFactoryOptionsBuilder(java.lang.String name,
io.micronaut.context.env.Environment env,
java.lang.String defaultUrl)
Create a
ConnectionFactoryOptions.Builder from the configured URL if present. |
BasicR2dbcProperties |
setConnectTimeout(java.time.Duration duration)
Sets the connect timeout.
|
BasicR2dbcProperties |
setDatabase(@NotBlank java.lang.String database)
Sets the initial database name.
|
BasicR2dbcProperties |
setDriver(@NotBlank java.lang.String driver)
Sets the driver.
|
BasicR2dbcProperties |
setHost(@NotBlank java.lang.String host)
Sets the host.
|
BasicR2dbcProperties |
setOptions(java.util.Map<java.lang.String,java.lang.String> options)
Sets the connection properties.
|
BasicR2dbcProperties |
setPassword(java.lang.CharSequence password)
Sets the password.
|
BasicR2dbcProperties |
setPort(@Positive int port)
Sets the port.
|
BasicR2dbcProperties |
setProtocol(@NotBlank java.lang.String protocol)
Sets the protocol.
|
BasicR2dbcProperties |
setSsl(boolean ssl)
Sets whether to prefer SSL configuration.
|
BasicR2dbcProperties |
setUsername(@NotBlank java.lang.String username)
Sets the username.
|
protected DefaultBasicR2dbcProperties(@Parameter java.lang.String name, io.micronaut.context.env.Environment environment)
name
- The name of the datasourceenvironment
- The environment@NonNull public io.r2dbc.spi.ConnectionFactoryOptions.Builder builder()
builder
in interface BasicR2dbcProperties
public BasicR2dbcProperties setDriver(@NotBlank @NotBlank java.lang.String driver)
setDriver
in interface BasicR2dbcProperties
driver
- The driverpublic BasicR2dbcProperties setOptions(@MapFormat(keyFormat=RAW) @Nullable java.util.Map<java.lang.String,java.lang.String> options)
setOptions
in interface BasicR2dbcProperties
options
- The optionspublic BasicR2dbcProperties setProtocol(@NotBlank @NotBlank java.lang.String protocol)
setProtocol
in interface BasicR2dbcProperties
protocol
- The protocolpublic BasicR2dbcProperties setConnectTimeout(java.time.Duration duration)
setConnectTimeout
in interface BasicR2dbcProperties
duration
- The durationpublic BasicR2dbcProperties setSsl(boolean ssl)
setSsl
in interface BasicR2dbcProperties
ssl
- Sets whether to prefer SSLprotected static io.r2dbc.spi.ConnectionFactoryOptions.Builder newConnectionFactoryOptionsBuilder(java.lang.String name, io.micronaut.context.env.Environment env, @Nullable java.lang.String defaultUrl)
ConnectionFactoryOptions.Builder
from the configured URL if present.name
- The name of the datasourceenv
- The environmentdefaultUrl
- The default URL to usepublic java.lang.String getName()
getName
in interface io.micronaut.core.naming.Named
public io.r2dbc.spi.ConnectionFactoryOptions.Builder getBuilder()
public BasicR2dbcProperties setHost(@NotBlank @NotBlank java.lang.String host)
setHost
in interface BasicR2dbcProperties
host
- The hostpublic BasicR2dbcProperties setPort(@Positive @Positive int port)
setPort
in interface BasicR2dbcProperties
port
- The portpublic BasicR2dbcProperties setUsername(@NotBlank @NotBlank java.lang.String username)
setUsername
in interface BasicR2dbcProperties
username
- The usernamepublic BasicR2dbcProperties setPassword(java.lang.CharSequence password)
setPassword
in interface BasicR2dbcProperties
password
- The passwordpublic BasicR2dbcProperties setDatabase(@NotBlank @NotBlank java.lang.String database)
setDatabase
in interface BasicR2dbcProperties
database
- The database