@@ -75,11 +75,7 @@ public final class Config implements Serializable {
75
75
76
76
private static final Config EMPTY = builder ().build ();
77
77
78
- private final BookmarkManager queryBookmarkManager ;
79
-
80
- /**
81
- * User defined logging
82
- */
78
+ /** User defined logging */
83
79
private final Logging logging ;
84
80
85
81
private final boolean logLeakedSessions ;
@@ -104,7 +100,6 @@ public final class Config implements Serializable {
104
100
private final MetricsAdapter metricsAdapter ;
105
101
106
102
private Config (ConfigBuilder builder ) {
107
- this .queryBookmarkManager = builder .queryBookmarkManager ;
108
103
this .logging = builder .logging ;
109
104
this .logLeakedSessions = builder .logLeakedSessions ;
110
105
@@ -126,22 +121,8 @@ private Config(ConfigBuilder builder) {
126
121
this .metricsAdapter = builder .metricsAdapter ;
127
122
}
128
123
129
- /**
130
- * A {@link BookmarkManager} implementation for the driver to use on
131
- * {@link Driver#executeQuery(Query, QueryConfig)} method and its variants by default.
132
- * <p>
133
- * Please note that sessions will not use this automatically, but it is possible to enable it explicitly
134
- * using {@link SessionConfig.Builder#withBookmarkManager(BookmarkManager)}.
135
- *
136
- * @return bookmark manager, must not be {@code null}
137
- */
138
- public BookmarkManager queryBookmarkManager () {
139
- return queryBookmarkManager ;
140
- }
141
-
142
124
/**
143
125
* Logging provider
144
- *
145
126
* @return the Logging provider to use
146
127
*/
147
128
public Logging logging () {
@@ -275,8 +256,6 @@ public String userAgent() {
275
256
* Used to build new config instances
276
257
*/
277
258
public static final class ConfigBuilder {
278
- private BookmarkManager queryBookmarkManager =
279
- BookmarkManagers .defaultManager (BookmarkManagerConfig .builder ().build ());
280
259
private Logging logging = DEV_NULL_LOGGING ;
281
260
private boolean logLeakedSessions ;
282
261
private int maxConnectionPoolSize = PoolSettings .DEFAULT_MAX_CONNECTION_POOL_SIZE ;
@@ -296,22 +275,6 @@ public static final class ConfigBuilder {
296
275
297
276
private ConfigBuilder () {}
298
277
299
- /**
300
- * Sets a {@link BookmarkManager} implementation for the driver to use on
301
- * {@link Driver#executeQuery(Query, QueryConfig)} method and its variants by default.
302
- * <p>
303
- * Please note that sessions will not use this automatically, but it is possible to enable it explicitly
304
- * using {@link SessionConfig.Builder#withBookmarkManager(BookmarkManager)}.
305
- *
306
- * @param queryBookmarkManager bookmark manager, must not be {@code null}
307
- * @return this builder
308
- */
309
- public ConfigBuilder withQueryBookmarkManager (BookmarkManager queryBookmarkManager ) {
310
- Objects .requireNonNull (queryBookmarkManager , "queryBookmarkManager must not be null" );
311
- this .queryBookmarkManager = queryBookmarkManager ;
312
- return this ;
313
- }
314
-
315
278
/**
316
279
* Provide a logging implementation for the driver to use. Java logging framework {@link java.util.logging} with {@link Level#INFO} is used by default.
317
280
* Callers are expected to either implement {@link Logging} interface or provide one of the existing implementations available from static factory
@@ -368,7 +331,7 @@ public ConfigBuilder withLeakedSessionsLogging() {
368
331
* validity and negative values mean connections will never be tested.
369
332
*
370
333
* @param value the minimum idle time
371
- * @param unit the unit in which the duration is given
334
+ * @param unit the unit in which the duration is given
372
335
* @return this builder
373
336
*/
374
337
public ConfigBuilder withConnectionLivenessCheckTimeout (long value , TimeUnit unit ) {
@@ -393,7 +356,7 @@ public ConfigBuilder withConnectionLivenessCheckTimeout(long value, TimeUnit uni
393
356
* checked.
394
357
*
395
358
* @param value the maximum connection lifetime
396
- * @param unit the unit in which the duration is given
359
+ * @param unit the unit in which the duration is given
397
360
* @return this builder
398
361
*/
399
362
public ConfigBuilder withMaxConnectionLifetime (long value , TimeUnit unit ) {
@@ -439,7 +402,7 @@ public ConfigBuilder withMaxConnectionPoolSize(int value) {
439
402
* of {@code 0} is allowed and results in no timeout and immediate failure when connection is unavailable.
440
403
*
441
404
* @param value the acquisition timeout
442
- * @param unit the unit in which the duration is given
405
+ * @param unit the unit in which the duration is given
443
406
* @return this builder
444
407
* @see #withMaxConnectionPoolSize(int)
445
408
*/
@@ -455,7 +418,6 @@ public ConfigBuilder withConnectionAcquisitionTimeout(long value, TimeUnit unit)
455
418
456
419
/**
457
420
* Set to use encrypted traffic.
458
- *
459
421
* @return this builder
460
422
*/
461
423
public ConfigBuilder withEncryption () {
@@ -465,7 +427,6 @@ public ConfigBuilder withEncryption() {
465
427
466
428
/**
467
429
* Set to use unencrypted traffic.
468
- *
469
430
* @return this builder
470
431
*/
471
432
public ConfigBuilder withoutEncryption () {
@@ -500,12 +461,13 @@ public ConfigBuilder withTrustStrategy(TrustStrategy trustStrategy) {
500
461
* The routing table of a database get refreshed if the database is used frequently.
501
462
* If the database is not used for a long time,
502
463
* the driver use the timeout specified here to purge the stale routing table.
503
- * <p>
464
+ *
504
465
* After a routing table is removed, next time when using the database of the purged routing table,
505
466
* the driver will fall back to use seed URI for a new routing table.
506
- *
507
- * @param delay the amount of time to wait before purging routing tables
508
- * @param unit the unit in which the duration is given
467
+ * @param delay
468
+ * the amount of time to wait before purging routing tables
469
+ * @param unit
470
+ * the unit in which the duration is given
509
471
* @return this builder
510
472
*/
511
473
public ConfigBuilder withRoutingTablePurgeDelay (long delay , TimeUnit unit ) {
@@ -521,16 +483,15 @@ public ConfigBuilder withRoutingTablePurgeDelay(long delay, TimeUnit unit) {
521
483
/**
522
484
* Specify how many records to fetch in each batch.
523
485
* This config is only valid when the driver is used with servers that support Bolt V4 (Server version 4.0 and later).
524
- * <p>
486
+ *
525
487
* Bolt V4 enables pulling records in batches to allow client to take control of data population and apply back pressure to server.
526
488
* This config specifies the default fetch size for all query runs using {@link Session} and {@link org.neo4j.driver.async.AsyncSession}.
527
489
* By default, the value is set to {@code 1000}.
528
490
* Use {@code -1} to disables back pressure and config client to pull all records at once after each run.
529
- * <p>
491
+ *
530
492
* This config only applies to run result obtained via {@link Session} and {@link org.neo4j.driver.async.AsyncSession}.
531
493
* As with {@link org.neo4j.driver.reactive.RxSession}, the batch size is provided via
532
494
* {@link org.reactivestreams.Subscription#request(long)} instead.
533
- *
534
495
* @param size the default record fetch size when pulling records in batches using Bolt V4.
535
496
* @return this builder
536
497
*/
@@ -551,10 +512,10 @@ public ConfigBuilder withFetchSize(long size) {
551
512
* The default value of this parameter is {@code 30 SECONDS}.
552
513
*
553
514
* @param value the timeout duration
554
- * @param unit the unit in which duration is given
515
+ * @param unit the unit in which duration is given
555
516
* @return this builder
556
517
* @throws IllegalArgumentException when given value is negative or does not fit in {@code int} when
557
- * converted to milliseconds.
518
+ * converted to milliseconds.
558
519
*/
559
520
public ConfigBuilder withConnectionTimeout (long value , TimeUnit unit ) {
560
521
long connectionTimeoutMillis = unit .toMillis (value );
@@ -582,7 +543,7 @@ public ConfigBuilder withConnectionTimeout(long value, TimeUnit unit) {
582
543
* Default value is 30 seconds.
583
544
*
584
545
* @param value the timeout duration
585
- * @param unit the unit in which duration is given
546
+ * @param unit the unit in which duration is given
586
547
* @return this builder
587
548
* @throws IllegalArgumentException when given value is negative
588
549
*/
@@ -625,7 +586,6 @@ public ConfigBuilder withDriverMetrics() {
625
586
626
587
/**
627
588
* Disable driver metrics. When disabled, driver metrics cannot be accessed via {@link Driver#metrics()}.
628
- *
629
589
* @return this builder.
630
590
*/
631
591
public ConfigBuilder withoutDriverMetrics () {
@@ -659,7 +619,6 @@ public ConfigBuilder withMetricsAdapter(MetricsAdapter metricsAdapter) {
659
619
/**
660
620
* Configure the event loop thread count. This specifies how many threads the driver can use to handle network I/O events
661
621
* and user's events in driver's I/O threads. By default, 2 * NumberOfProcessors amount of threads will be used instead.
662
- *
663
622
* @param size the thread count.
664
623
* @return this builder.
665
624
* @throws IllegalArgumentException if the value of the size is set to a number that is less than 1.
@@ -675,7 +634,6 @@ public ConfigBuilder withEventLoopThreads(int size) {
675
634
676
635
/**
677
636
* Configure the user_agent field sent to the server to identify the connected client.
678
- *
679
637
* @param userAgent the string to configure user_agent.
680
638
* @return this builder.
681
639
*/
@@ -844,7 +802,6 @@ public static TrustStrategy trustAllCertificates() {
844
802
845
803
/**
846
804
* The revocation strategy used for verifying certificates.
847
- *
848
805
* @return this {@link TrustStrategy}'s revocation strategy
849
806
*/
850
807
public RevocationCheckingStrategy revocationCheckingStrategy () {
@@ -854,7 +811,6 @@ public RevocationCheckingStrategy revocationCheckingStrategy() {
854
811
/**
855
812
* Configures the {@link TrustStrategy} to not carry out OCSP revocation checks on certificates. This is the
856
813
* option that is configured by default.
857
- *
858
814
* @return the current trust strategy
859
815
*/
860
816
public TrustStrategy withoutCertificateRevocationChecks () {
@@ -867,7 +823,6 @@ public TrustStrategy withoutCertificateRevocationChecks() {
867
823
* stapled to the certificate. If no stapled response is found, then certificate verification continues
868
824
* (and does not fail verification). This setting also requires the server to be configured to enable
869
825
* OCSP stapling.
870
- *
871
826
* @return the current trust strategy
872
827
*/
873
828
public TrustStrategy withVerifyIfPresentRevocationChecks () {
@@ -879,10 +834,9 @@ public TrustStrategy withVerifyIfPresentRevocationChecks() {
879
834
* Configures the {@link TrustStrategy} to carry out strict OCSP revocation checks for revocation status that
880
835
* are stapled to the certificate. If no stapled response is found, then the driver will fail certificate verification
881
836
* and not connect to the server. This setting also requires the server to be configured to enable OCSP stapling.
882
- * <p>
837
+ *
883
838
* Note: enabling this setting will prevent the driver connecting to the server when the server is unable to reach
884
839
* the certificate's configured OCSP responder URL.
885
- *
886
840
* @return the current trust strategy
887
841
*/
888
842
public TrustStrategy withStrictRevocationChecks () {
0 commit comments