Class BoltProtocolV3

java.lang.Object
org.neo4j.driver.internal.messaging.v3.BoltProtocolV3
All Implemented Interfaces:
BoltProtocol
Direct Known Subclasses:
BoltProtocolV4

public class BoltProtocolV3 extends Object implements BoltProtocol
  • Field Details

  • Constructor Details

    • BoltProtocolV3

      public BoltProtocolV3()
  • Method Details

    • createMessageFormat

      public MessageFormat createMessageFormat()
      Description copied from interface: BoltProtocol
      Instantiate MessageFormat used by this Bolt protocol verison.
      Specified by:
      createMessageFormat in interface BoltProtocol
      Returns:
      new message format.
    • initializeChannel

      public void initializeChannel(String userAgent, org.neo4j.driver.internal.BoltAgent boltAgent, AuthToken authToken, RoutingContext routingContext, io.netty.channel.ChannelPromise channelInitializedPromise, org.neo4j.driver.internal.GqlNotificationConfig notificationConfig, Clock clock)
      Description copied from interface: BoltProtocol
      Initialize channel after it is connected and handshake selected this protocol version.
      Specified by:
      initializeChannel in interface BoltProtocol
      Parameters:
      userAgent - the user agent string.
      boltAgent - the bolt agent
      authToken - the authentication token.
      routingContext - the configured routing context
      channelInitializedPromise - the promise to be notified when initialization is completed.
      notificationConfig - the notification configuration
      clock - the clock to use
    • prepareToCloseChannel

      public void prepareToCloseChannel(io.netty.channel.Channel channel)
      Description copied from interface: BoltProtocol
      Prepare to close channel before it is closed.
      Specified by:
      prepareToCloseChannel in interface BoltProtocol
      Parameters:
      channel - the channel to close.
    • beginTransaction

      public CompletionStage<Void> beginTransaction(Connection connection, Set<Bookmark> bookmarks, TransactionConfig config, String txType, org.neo4j.driver.internal.GqlNotificationConfig notificationConfig, Logging logging, boolean flush)
      Description copied from interface: BoltProtocol
      Begin an unmanaged transaction.
      Specified by:
      beginTransaction in interface BoltProtocol
      Parameters:
      connection - the connection to use.
      bookmarks - the bookmarks. Never null, should be empty when there are no bookmarks.
      config - the transaction configuration. Never null, should be TransactionConfig.empty() when absent.
      txType - the Kernel transaction type
      notificationConfig - the notification configuration
      logging - the driver logging
      flush - defines whether to flush the message to the connection
      Returns:
      a completion stage completed when transaction is started or completed exceptionally when there was a failure.
    • commitTransaction

      public CompletionStage<org.neo4j.driver.internal.DatabaseBookmark> commitTransaction(Connection connection)
      Description copied from interface: BoltProtocol
      Commit the unmanaged transaction.
      Specified by:
      commitTransaction in interface BoltProtocol
      Parameters:
      connection - the connection to use.
      Returns:
      a completion stage completed with a bookmark when transaction is committed or completed exceptionally when there was a failure.
    • rollbackTransaction

      public CompletionStage<Void> rollbackTransaction(Connection connection)
      Description copied from interface: BoltProtocol
      Rollback the unmanaged transaction.
      Specified by:
      rollbackTransaction in interface BoltProtocol
      Parameters:
      connection - the connection to use.
      Returns:
      a completion stage completed when transaction is rolled back or completed exceptionally when there was a failure.
    • runInAutoCommitTransaction

      public ResultCursorFactory runInAutoCommitTransaction(Connection connection, Query query, Set<Bookmark> bookmarks, Consumer<org.neo4j.driver.internal.DatabaseBookmark> bookmarkConsumer, TransactionConfig config, long fetchSize, org.neo4j.driver.internal.GqlNotificationConfig notificationConfig, Logging logging)
      Description copied from interface: BoltProtocol
      Execute the given query in an auto-commit transaction, i.e. SimpleQueryRunner.run(Query).
      Specified by:
      runInAutoCommitTransaction in interface BoltProtocol
      Parameters:
      connection - the network connection to use.
      query - the cypher to execute.
      bookmarkConsumer - the database bookmark consumer.
      config - the transaction config for the implicitly started auto-commit transaction.
      fetchSize - the record fetch size for PULL message.
      notificationConfig - the notification configuration
      logging - the driver logging
      Returns:
      stage with cursor.
    • runInUnmanagedTransaction

      public ResultCursorFactory runInUnmanagedTransaction(Connection connection, Query query, UnmanagedTransaction tx, long fetchSize)
      Description copied from interface: BoltProtocol
      Execute the given query in a running unmanaged transaction, i.e. SimpleQueryRunner.run(Query).
      Specified by:
      runInUnmanagedTransaction in interface BoltProtocol
      Parameters:
      connection - the network connection to use.
      query - the cypher to execute.
      tx - the transaction which executes the query.
      fetchSize - the record fetch size for PULL message.
      Returns:
      stage with cursor.
    • telemetry

      public CompletionStage<Void> telemetry(Connection connection, Integer api)
      Description copied from interface: BoltProtocol
      Sends telemetry message to the server.
      Specified by:
      telemetry in interface BoltProtocol
      api - The api number.
      Returns:
      Promise of message be delivered
    • buildResultCursorFactory

      protected ResultCursorFactory buildResultCursorFactory(Connection connection, Query query, Consumer<org.neo4j.driver.internal.DatabaseBookmark> bookmarkConsumer, UnmanagedTransaction tx, RunWithMetadataMessage runMessage, long ignored)
    • verifyDatabaseNameBeforeTransaction

      protected void verifyDatabaseNameBeforeTransaction(org.neo4j.driver.internal.DatabaseName databaseName)
    • version

      public BoltProtocolVersion version()
      Description copied from interface: BoltProtocol
      Returns the protocol version. It can be used for version specific error messages.
      Specified by:
      version in interface BoltProtocol
      Returns:
      the protocol version.
    • includeDateTimeUtcPatchInHello

      protected boolean includeDateTimeUtcPatchInHello()
    • verifyNotificationConfigSupported

      protected Neo4jException verifyNotificationConfigSupported(org.neo4j.driver.internal.GqlNotificationConfig notificationConfig)
    • useLegacyNotifications

      protected boolean useLegacyNotifications()