Module org.neo4j.bolt.connection
Package org.neo4j.bolt.connection
Interface RoutedBoltConnectionParameters.Builder
- All Superinterfaces:
BoltConnectionParameters.Builder
- Enclosing interface:
RoutedBoltConnectionParameters
public static interface RoutedBoltConnectionParameters.Builder
extends BoltConnectionParameters.Builder
A builder for creating
RoutedBoltConnectionParameters.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newRoutedBoltConnectionParameters.withAccessMode(AccessMode accessMode) Sets anAccessModethat the connection must support.withAuthToken(AuthToken authToken) Sets anAuthTokenthat the given connection must use.withBookmarks(Set<String> bookmarks) Sets routing bookmarks.withDatabaseName(DatabaseName databaseName) Sets a database that the connection must lead to.withDatabaseNameListener(Consumer<DatabaseName> databaseNameListener) Sets a database name consumer that will be notified with the database name used for the given connection.withHomeDatabaseHint(String homeDatabaseHint) Sets a home database name hint.withImpersonatedUser(String impersonatedUser) Sets impersonated user.withMinVersion(BoltProtocolVersion minVersion) Sets an optional minimumBoltProtocolVersionthat the connection must support.
-
Method Details
-
withAuthToken
Sets anAuthTokenthat the given connection must use.It is intended for cases when a specific
AuthTokenmust be used that may differ from theBoltConnectionSourcedefault one.The default is
null.- Specified by:
withAuthTokenin interfaceBoltConnectionParameters.Builder- Parameters:
authToken- theAuthTokenornullto use theBoltConnectionSourcedefault one- Returns:
- this builder
-
withMinVersion
Sets an optional minimumBoltProtocolVersionthat the connection must support.The default is
null.- Specified by:
withMinVersionin interfaceBoltConnectionParameters.Builder- Parameters:
minVersion- the minimumBoltProtocolVersionornullif there is no minimum- Returns:
- this builder
-
withAccessMode
Sets anAccessModethat the connection must support.The default is
AccessMode.WRITE.- Parameters:
accessMode- the access mode- Returns:
- this builder
-
withDatabaseName
Sets a database that the connection must lead to.The default is
null.- Parameters:
databaseName- the database name ornullfor home database- Returns:
- this builder
-
withDatabaseNameListener
RoutedBoltConnectionParameters.Builder withDatabaseNameListener(Consumer<DatabaseName> databaseNameListener) Sets a database name consumer that will be notified with the database name used for the given connection.The default is a noop consumer.
- Parameters:
databaseNameListener- the database name consumer- Returns:
- this builder
-
withHomeDatabaseHint
Sets a home database name hint.The default is
null.- Parameters:
homeDatabaseHint- the home database hint ornull- Returns:
- this builder
-
withBookmarks
Sets routing bookmarks.The default is an empty set.
- Parameters:
bookmarks- the bookmarks- Returns:
- this builder
-
withImpersonatedUser
Sets impersonated user.The default is
null.- Parameters:
impersonatedUser- the impersonated user ornull- Returns:
- this builder
-
build
RoutedBoltConnectionParameters build()Builds a newRoutedBoltConnectionParameters.- Specified by:
buildin interfaceBoltConnectionParameters.Builder- Returns:
- the new
RoutedBoltConnectionParameters
-