@Immutable public class Config extends Object
To build a simple config with custom logging implementation:
Config config = Config
.build()
.withLogging(new MyLogging())
.toConfig();
To build a more complicated config with tuned connection pool options:
Config config = Config.build()
.withEncryption()
.withConnectionTimeout(10, TimeUnit.SECONDS)
.withMaxConnectionLifetime(30, TimeUnit.MINUTES)
.withMaxConnectionPoolSize(10)
.withConnectionAcquisitionTimeout(20, TimeUnit.SECONDS)
.toConfig();
Modifier and Type | Class and Description |
---|---|
static class |
Config.ConfigBuilder
Used to build new config instances
|
static class |
Config.EncryptionLevel
Control the level of encryption to require
|
static class |
Config.LoadBalancingStrategy |
static class |
Config.TrustStrategy
Control how the driver determines if it can trust the encryption certificates provided by the Neo4j instance it is connected to.
|
Modifier and Type | Method and Description |
---|---|
static Config.ConfigBuilder |
build()
Start building a
Config object using a newly created builder. |
static Config.ConfigBuilder |
builder()
Start building a
Config object using a newly created builder. |
long |
connectionAcquisitionTimeoutMillis() |
int |
connectionPoolSize()
Deprecated.
please use
maxConnectionPoolSize() instead. |
int |
connectionTimeoutMillis() |
static Config |
defaultConfig() |
boolean |
encrypted() |
Config.EncryptionLevel |
encryptionLevel()
Deprecated.
|
long |
idleTimeBeforeConnectionTest()
Pooled connections that have been idle in the pool for longer than this timeout
will be tested before they are used again, to ensure they are still live.
|
Config.LoadBalancingStrategy |
loadBalancingStrategy()
Load balancing strategy.
|
Logging |
logging()
Logging provider
|
boolean |
logLeakedSessions()
Check if leaked sessions logging is enabled.
|
long |
maxConnectionLifetimeMillis()
Pooled connections older than this threshold will be closed and removed from the pool.
|
int |
maxConnectionPoolSize() |
int |
maxIdleConnectionPoolSize()
Deprecated.
please use
maxConnectionPoolSize() instead. |
ServerAddressResolver |
resolver()
Server address resolver.
|
Config.TrustStrategy |
trustStrategy() |
public Logging logging()
public boolean logLeakedSessions()
true
if enabled, false
otherwise.@Deprecated public int connectionPoolSize()
maxConnectionPoolSize()
instead.@Deprecated public int maxIdleConnectionPoolSize()
maxConnectionPoolSize()
instead.public long idleTimeBeforeConnectionTest()
public long maxConnectionLifetimeMillis()
public int connectionTimeoutMillis()
public int maxConnectionPoolSize()
public long connectionAcquisitionTimeoutMillis()
@Deprecated public Config.EncryptionLevel encryptionLevel()
public boolean encrypted()
public Config.TrustStrategy trustStrategy()
@Experimental public Config.LoadBalancingStrategy loadBalancingStrategy()
public ServerAddressResolver resolver()
public static Config.ConfigBuilder build()
Config.ConfigBuilder
instance.public static Config.ConfigBuilder builder()
Config
object using a newly created builder.Config.ConfigBuilder
instance.public static Config defaultConfig()
Copyright © 2019. All rights reserved.