Interface RoutedBoltConnectionParameters
- All Superinterfaces:
BoltConnectionParameters
BoltConnectionParameters version that includes Neo4j routing parameters and is used by
BoltConnectionSource instances that implement routing.- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for creatingRoutedBoltConnectionParameters. -
Method Summary
Modifier and TypeMethodDescriptionAnAccessModethat the connection must support.Bookmarks used for routing.builder()Returns a newRoutedBoltConnectionParameters.Builderinstance.A database name that the connection should be established for.A database name consumer that will be notified with the database name used for the given connection.Returns defaultRoutedBoltConnectionParameters.A home database name hint.An optional impersonated user.Methods inherited from interface org.neo4j.bolt.connection.BoltConnectionParameters
authToken, minVersion
-
Method Details
-
accessMode
AccessMode accessMode()AnAccessModethat the connection must support.- Returns:
- the access mode
-
databaseName
DatabaseName databaseName()A database name that the connection should be established for.In a clustered Neo4j DBMS not every cluster member may host the desired database, so the
BoltConnectionSourcemust know which database the given connection must be established for.When it is set to
null, the user's home database must be used on Bolt 4.1 and above. For previous Bolt versions, the default database determined by the server is used instead.- Returns:
- the database name
-
databaseNameListener
Consumer<DatabaseName> databaseNameListener()A database name consumer that will be notified with the database name used for the given connection.This option is only used when the
databaseName()is set tonull. It is intended for getting user's home database when it gets resolved.- Returns:
- the database name consumer
- Since:
- 4.0.0
-
homeDatabaseHint
String homeDatabaseHint()A home database name hint.This option is only used when the
databaseName()is set tonull.The objective is to minimise the need for an explicit home database resolution that requires an extra network exchange.
The home database hint should be used to check if a server-side routing (SSR) enabled connection may be returned without having to explicitly resolve home database. If such connection is returned, the following applies:
- The
databaseNameListener()is not notified as no home database resolution takes place. - This value MUST NOT be considered to be the user's home database as it may have changed. The home
database can be determined later by sending
BEGINor autocommitRUNmessage without database name set. In that case, the server includes the home database in the response summary. This behaviour only applies from Bolt 5.8 and higher. - The server-side routing is required to make sure the messages can be forwarded to a relevant server if this value has actually changed and is no longer true. However, such forwarding may inccur extra network exchanges within the cluster.
- Returns:
- the database name hint
- Since:
- 4.0.0
- The
-
bookmarks
Bookmarks used for routing.- Returns:
- the routing bookmarks.
-
impersonatedUser
String impersonatedUser()An optional impersonated user.- Returns:
- the impersonated user or
null
-
defaultParameters
Returns defaultRoutedBoltConnectionParameters.- Returns:
- the default
RoutedBoltConnectionParameters
-
builder
Returns a newRoutedBoltConnectionParameters.Builderinstance.- Returns:
- a new builder
-