java.lang.Object
org.neo4j.driver.Config
- All Implemented Interfaces:
Serializable
A configuration class to config driver properties.
To build a simple config with custom logging implementation:
Config config = Config.builder()
.withLogging(new MyLogging())
.build();
To build a more complicated config with tuned connection pool options:
Config config = Config.builder()
.withEncryption()
.withConnectionTimeout( 10, TimeUnit.SECONDS)
.withMaxConnectionLifetime(30, TimeUnit.MINUTES)
.withMaxConnectionPoolSize(10)
.withConnectionAcquisitionTimeout(20, TimeUnit.SECONDS)
.build();
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Used to build new config instancesstatic final class
Control how the driver determines if it can trust the encryption certificates provided by the Neo4j instance it is connected to. -
Method Summary
Modifier and TypeMethodDescriptionstatic Config.ConfigBuilder
builder()
Start building aConfig
object using a newly created builder.long
Returns the connection acquisition timeout in milliseconds.int
Returns the configured connection timeout value in milliseconds.static Config
Returns the config with all default settings.Returns a set of disabled notification classifications.boolean
Returns indicator for encrypted communication.int
Returns the number of EventLoop threads.long
Returns the fetch size.long
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.boolean
Returns whether the metrics is enabled or not on this driver.boolean
Returns if the telemetry is disabled on the driver side.logging()
Deprecated.boolean
Check if leaked sessions logging is enabled.long
Pooled connections older than this threshold will be closed and removed from the pool.int
Returns the maximum connection pool size.long
Returns managed transactions maximum retry time.Returns theMetricsAdapter
.Returns a minimum notification severity.Returns notification config.resolver()
Server address resolver.long
Returns stale routing table purge delay.Returns the strategy to use to determine the authenticity of an encryption certificate provided by the Neo4j instance we are connecting to.Returns the user_agent configured for this driver.
-
Method Details
-
logging
Deprecated.the logging abstraction has been deprecated in favour of theSystem.Logger
that the driver uses by defaultLogging provider- Returns:
- the Logging provider to use
-
logLeakedSessions
public boolean logLeakedSessions()Check if leaked sessions logging is enabled.- Returns:
true
if enabled,false
otherwise.
-
idleTimeBeforeConnectionTest
public 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.- Returns:
- idle time in milliseconds
-
maxConnectionLifetimeMillis
public long maxConnectionLifetimeMillis()Pooled connections older than this threshold will be closed and removed from the pool.- Returns:
- maximum lifetime in milliseconds
-
connectionTimeoutMillis
public int connectionTimeoutMillis()Returns the configured connection timeout value in milliseconds.- Returns:
- the configured connection timeout value in milliseconds
-
maxConnectionPoolSize
public int maxConnectionPoolSize()Returns the maximum connection pool size.- Returns:
- the maximum size
-
connectionAcquisitionTimeoutMillis
public long connectionAcquisitionTimeoutMillis()Returns the connection acquisition timeout in milliseconds.- Returns:
- the acquisition timeout
-
encrypted
public boolean encrypted()Returns indicator for encrypted communication.- Returns:
- indicator for encrypted communication
-
trustStrategy
Returns the strategy to use to determine the authenticity of an encryption certificate provided by the Neo4j instance we are connecting to.- Returns:
- the strategy to use to determine the authenticity of an encryption certificate provided by the Neo4j instance we are connecting to
-
resolver
Server address resolver.- Returns:
- the resolver to use.
-
builder
Start building aConfig
object using a newly created builder.- Returns:
- a new
Config.ConfigBuilder
instance.
-
defaultConfig
Returns the config with all default settings.- Returns:
- the config with all default settings
-
routingTablePurgeDelayMillis
public long routingTablePurgeDelayMillis()Returns stale routing table purge delay.- Returns:
- routing table purge delay
-
maxTransactionRetryTimeMillis
public long maxTransactionRetryTimeMillis()Returns managed transactions maximum retry time.- Returns:
- maximum retry time
-
fetchSize
public long fetchSize()Returns the fetch size.- Returns:
- the fetch size
-
notificationConfig
Returns notification config.- Returns:
- the notification config
- Since:
- 5.7
-
minimumNotificationSeverity
@Preview(name="GQL-status object") public Optional<NotificationSeverity> minimumNotificationSeverity()Returns a minimum notification severity.- Returns:
- an
Optional
of minimumNotificationSeverity
or an emptyOptional
if it is not set - Since:
- 5.22.0
-
disabledNotificationClassifications
@Preview(name="GQL-status object") public Set<NotificationClassification> disabledNotificationClassifications()Returns a set of disabled notification classifications.- Returns:
- the
Set
of disabledNotificationClassification
- Since:
- 5.22.0
-
eventLoopThreads
public int eventLoopThreads()Returns the number of EventLoop threads.- Returns:
- the number of threads
-
isMetricsEnabled
public boolean isMetricsEnabled()Returns whether the metrics is enabled or not on this driver.- Returns:
- if the metrics is enabled or not on this driver
-
metricsAdapter
Returns theMetricsAdapter
.- Returns:
- the metrics adapter
-
userAgent
Returns the user_agent configured for this driver.- Returns:
- the user_agent configured for this driver
-
isTelemetryDisabled
public boolean isTelemetryDisabled()Returns if the telemetry is disabled on the driver side.The telemetry is collected only when it is enabled both the server and the driver.
- Returns:
true
if telemetry is disabled orfalse
otherwise- Since:
- 5.13
-
System.Logger
that the driver uses by default