Skip to content

Commit 84c3c0b

Browse files
authored
Revert "Introduce executeQuery on Driver level (#1321)" (#1324)
This reverts commit 477577b.
1 parent 2532d44 commit 84c3c0b

24 files changed

+159
-1308
lines changed

driver/clirr-ignored-differences.xml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -391,40 +391,4 @@
391391
<differenceType>3003</differenceType>
392392
</difference>
393393

394-
<difference>
395-
<className>org/neo4j/driver/Driver</className>
396-
<differenceType>7012</differenceType>
397-
<method>org.neo4j.driver.EagerResult executeQuery(org.neo4j.driver.Query)</method>
398-
</difference>
399-
400-
<difference>
401-
<className>org/neo4j/driver/Driver</className>
402-
<differenceType>7012</differenceType>
403-
<method>java.lang.Object executeQuery(org.neo4j.driver.Query, org.neo4j.driver.QueryConfig)</method>
404-
</difference>
405-
406-
<difference>
407-
<className>org/neo4j/driver/Driver</className>
408-
<differenceType>7012</differenceType>
409-
<method>org.neo4j.driver.EagerResult executeQuery(java.lang.String)</method>
410-
</difference>
411-
412-
<difference>
413-
<className>org/neo4j/driver/Driver</className>
414-
<differenceType>7012</differenceType>
415-
<method>org.neo4j.driver.EagerResult executeQuery(java.lang.String, java.util.Map)</method>
416-
</difference>
417-
418-
<difference>
419-
<className>org/neo4j/driver/Driver</className>
420-
<differenceType>7012</differenceType>
421-
<method>java.lang.Object executeQuery(java.lang.String, java.util.Map, org.neo4j.driver.QueryConfig)</method>
422-
</difference>
423-
424-
<difference>
425-
<className>org/neo4j/driver/Driver</className>
426-
<differenceType>7012</differenceType>
427-
<method>org.neo4j.driver.BookmarkManager queryBookmarkManager()</method>
428-
</difference>
429-
430394
</differences>

driver/src/main/java/org/neo4j/driver/Config.java

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ public final class Config implements Serializable {
7575

7676
private static final Config EMPTY = builder().build();
7777

78-
private final BookmarkManager queryBookmarkManager;
79-
80-
/**
81-
* User defined logging
82-
*/
78+
/** User defined logging */
8379
private final Logging logging;
8480

8581
private final boolean logLeakedSessions;
@@ -104,7 +100,6 @@ public final class Config implements Serializable {
104100
private final MetricsAdapter metricsAdapter;
105101

106102
private Config(ConfigBuilder builder) {
107-
this.queryBookmarkManager = builder.queryBookmarkManager;
108103
this.logging = builder.logging;
109104
this.logLeakedSessions = builder.logLeakedSessions;
110105

@@ -126,22 +121,8 @@ private Config(ConfigBuilder builder) {
126121
this.metricsAdapter = builder.metricsAdapter;
127122
}
128123

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-
142124
/**
143125
* Logging provider
144-
*
145126
* @return the Logging provider to use
146127
*/
147128
public Logging logging() {
@@ -275,8 +256,6 @@ public String userAgent() {
275256
* Used to build new config instances
276257
*/
277258
public static final class ConfigBuilder {
278-
private BookmarkManager queryBookmarkManager =
279-
BookmarkManagers.defaultManager(BookmarkManagerConfig.builder().build());
280259
private Logging logging = DEV_NULL_LOGGING;
281260
private boolean logLeakedSessions;
282261
private int maxConnectionPoolSize = PoolSettings.DEFAULT_MAX_CONNECTION_POOL_SIZE;
@@ -296,22 +275,6 @@ public static final class ConfigBuilder {
296275

297276
private ConfigBuilder() {}
298277

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-
315278
/**
316279
* Provide a logging implementation for the driver to use. Java logging framework {@link java.util.logging} with {@link Level#INFO} is used by default.
317280
* 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() {
368331
* validity and negative values mean connections will never be tested.
369332
*
370333
* @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
372335
* @return this builder
373336
*/
374337
public ConfigBuilder withConnectionLivenessCheckTimeout(long value, TimeUnit unit) {
@@ -393,7 +356,7 @@ public ConfigBuilder withConnectionLivenessCheckTimeout(long value, TimeUnit uni
393356
* checked.
394357
*
395358
* @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
397360
* @return this builder
398361
*/
399362
public ConfigBuilder withMaxConnectionLifetime(long value, TimeUnit unit) {
@@ -439,7 +402,7 @@ public ConfigBuilder withMaxConnectionPoolSize(int value) {
439402
* of {@code 0} is allowed and results in no timeout and immediate failure when connection is unavailable.
440403
*
441404
* @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
443406
* @return this builder
444407
* @see #withMaxConnectionPoolSize(int)
445408
*/
@@ -455,7 +418,6 @@ public ConfigBuilder withConnectionAcquisitionTimeout(long value, TimeUnit unit)
455418

456419
/**
457420
* Set to use encrypted traffic.
458-
*
459421
* @return this builder
460422
*/
461423
public ConfigBuilder withEncryption() {
@@ -465,7 +427,6 @@ public ConfigBuilder withEncryption() {
465427

466428
/**
467429
* Set to use unencrypted traffic.
468-
*
469430
* @return this builder
470431
*/
471432
public ConfigBuilder withoutEncryption() {
@@ -500,12 +461,13 @@ public ConfigBuilder withTrustStrategy(TrustStrategy trustStrategy) {
500461
* The routing table of a database get refreshed if the database is used frequently.
501462
* If the database is not used for a long time,
502463
* the driver use the timeout specified here to purge the stale routing table.
503-
* <p>
464+
*
504465
* After a routing table is removed, next time when using the database of the purged routing table,
505466
* 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
509471
* @return this builder
510472
*/
511473
public ConfigBuilder withRoutingTablePurgeDelay(long delay, TimeUnit unit) {
@@ -521,16 +483,15 @@ public ConfigBuilder withRoutingTablePurgeDelay(long delay, TimeUnit unit) {
521483
/**
522484
* Specify how many records to fetch in each batch.
523485
* 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+
*
525487
* Bolt V4 enables pulling records in batches to allow client to take control of data population and apply back pressure to server.
526488
* This config specifies the default fetch size for all query runs using {@link Session} and {@link org.neo4j.driver.async.AsyncSession}.
527489
* By default, the value is set to {@code 1000}.
528490
* Use {@code -1} to disables back pressure and config client to pull all records at once after each run.
529-
* <p>
491+
*
530492
* This config only applies to run result obtained via {@link Session} and {@link org.neo4j.driver.async.AsyncSession}.
531493
* As with {@link org.neo4j.driver.reactive.RxSession}, the batch size is provided via
532494
* {@link org.reactivestreams.Subscription#request(long)} instead.
533-
*
534495
* @param size the default record fetch size when pulling records in batches using Bolt V4.
535496
* @return this builder
536497
*/
@@ -551,10 +512,10 @@ public ConfigBuilder withFetchSize(long size) {
551512
* The default value of this parameter is {@code 30 SECONDS}.
552513
*
553514
* @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
555516
* @return this builder
556517
* @throws IllegalArgumentException when given value is negative or does not fit in {@code int} when
557-
* converted to milliseconds.
518+
* converted to milliseconds.
558519
*/
559520
public ConfigBuilder withConnectionTimeout(long value, TimeUnit unit) {
560521
long connectionTimeoutMillis = unit.toMillis(value);
@@ -582,7 +543,7 @@ public ConfigBuilder withConnectionTimeout(long value, TimeUnit unit) {
582543
* Default value is 30 seconds.
583544
*
584545
* @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
586547
* @return this builder
587548
* @throws IllegalArgumentException when given value is negative
588549
*/
@@ -625,7 +586,6 @@ public ConfigBuilder withDriverMetrics() {
625586

626587
/**
627588
* Disable driver metrics. When disabled, driver metrics cannot be accessed via {@link Driver#metrics()}.
628-
*
629589
* @return this builder.
630590
*/
631591
public ConfigBuilder withoutDriverMetrics() {
@@ -659,7 +619,6 @@ public ConfigBuilder withMetricsAdapter(MetricsAdapter metricsAdapter) {
659619
/**
660620
* Configure the event loop thread count. This specifies how many threads the driver can use to handle network I/O events
661621
* and user's events in driver's I/O threads. By default, 2 * NumberOfProcessors amount of threads will be used instead.
662-
*
663622
* @param size the thread count.
664623
* @return this builder.
665624
* @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) {
675634

676635
/**
677636
* Configure the user_agent field sent to the server to identify the connected client.
678-
*
679637
* @param userAgent the string to configure user_agent.
680638
* @return this builder.
681639
*/
@@ -844,7 +802,6 @@ public static TrustStrategy trustAllCertificates() {
844802

845803
/**
846804
* The revocation strategy used for verifying certificates.
847-
*
848805
* @return this {@link TrustStrategy}'s revocation strategy
849806
*/
850807
public RevocationCheckingStrategy revocationCheckingStrategy() {
@@ -854,7 +811,6 @@ public RevocationCheckingStrategy revocationCheckingStrategy() {
854811
/**
855812
* Configures the {@link TrustStrategy} to not carry out OCSP revocation checks on certificates. This is the
856813
* option that is configured by default.
857-
*
858814
* @return the current trust strategy
859815
*/
860816
public TrustStrategy withoutCertificateRevocationChecks() {
@@ -867,7 +823,6 @@ public TrustStrategy withoutCertificateRevocationChecks() {
867823
* stapled to the certificate. If no stapled response is found, then certificate verification continues
868824
* (and does not fail verification). This setting also requires the server to be configured to enable
869825
* OCSP stapling.
870-
*
871826
* @return the current trust strategy
872827
*/
873828
public TrustStrategy withVerifyIfPresentRevocationChecks() {
@@ -879,10 +834,9 @@ public TrustStrategy withVerifyIfPresentRevocationChecks() {
879834
* Configures the {@link TrustStrategy} to carry out strict OCSP revocation checks for revocation status that
880835
* are stapled to the certificate. If no stapled response is found, then the driver will fail certificate verification
881836
* and not connect to the server. This setting also requires the server to be configured to enable OCSP stapling.
882-
* <p>
837+
*
883838
* Note: enabling this setting will prevent the driver connecting to the server when the server is unable to reach
884839
* the certificate's configured OCSP responder URL.
885-
*
886840
* @return the current trust strategy
887841
*/
888842
public TrustStrategy withStrictRevocationChecks() {

0 commit comments

Comments
 (0)