Interface RoutedBoltConnectionParameters

All Superinterfaces:
BoltConnectionParameters

public interface RoutedBoltConnectionParameters extends BoltConnectionParameters
An extended BoltConnectionParameters version that includes Neo4j routing parameters and is used by BoltConnectionSource instances that implement routing.
Since:
4.0.0
  • Method Details

    • accessMode

      AccessMode accessMode()
      An AccessMode that 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 BoltConnectionSource must 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 to null. 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 to null.

      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 BEGIN or autocommit RUN message 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
    • bookmarks

      Set<String> bookmarks()
      Bookmarks used for routing.
      Returns:
      the routing bookmarks.
    • impersonatedUser

      String impersonatedUser()
      An optional impersonated user.
      Returns:
      the impersonated user or null
    • defaultParameters

      static RoutedBoltConnectionParameters defaultParameters()
      Returns:
      the default RoutedBoltConnectionParameters
    • builder

      Returns:
      a new builder