Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Config.bookmarkManager return Optional #1292

Merged
merged 1 commit into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions driver/src/main/java/org/neo4j/driver/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import org.neo4j.driver.internal.SecuritySettings;
Expand Down Expand Up @@ -258,10 +259,10 @@ public String userAgent() {
/**
* A {@link BookmarkManager} implementation for the driver to use.
*
* @return bookmark implementation or {@code null}.
* @return bookmark implementation
*/
public BookmarkManager bookmarkManager() {
return bookmarkManager;
public Optional<BookmarkManager> bookmarkManager() {
return Optional.ofNullable(bookmarkManager);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ protected InternalDriver createRoutingDriver(
protected InternalDriver createDriver(
SecurityPlan securityPlan, SessionFactory sessionFactory, MetricsProvider metricsProvider, Config config) {
return new InternalDriver(
securityPlan, sessionFactory, metricsProvider, config.logging(), config.bookmarkManager());
securityPlan,
sessionFactory,
metricsProvider,
config.logging(),
config.bookmarkManager().orElse(null));
}

/**
Expand Down