java.lang.Object
org.neo4j.driver.internal.messaging.v3.BoltProtocolV3
- All Implemented Interfaces:
BoltProtocol
- Direct Known Subclasses:
BoltProtocolV4
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BoltProtocol
static final MetadataExtractor
static final BoltProtocolVersion
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbeginTransaction
(Connection connection, Set<Bookmark> bookmarks, TransactionConfig config, String txType, org.neo4j.driver.internal.GqlNotificationConfig notificationConfig, Logging logging, boolean flush) Begin an unmanaged transaction.protected ResultCursorFactory
buildResultCursorFactory
(Connection connection, Query query, Consumer<org.neo4j.driver.internal.DatabaseBookmark> bookmarkConsumer, UnmanagedTransaction tx, RunWithMetadataMessage runMessage, long ignored) CompletionStage<org.neo4j.driver.internal.DatabaseBookmark>
commitTransaction
(Connection connection) Commit the unmanaged transaction.InstantiateMessageFormat
used by this Bolt protocol verison.protected boolean
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) Initialize channel after it is connected and handshake selected this protocol version.void
prepareToCloseChannel
(io.netty.channel.Channel channel) Prepare to close channel before it is closed.rollbackTransaction
(Connection connection) Rollback the unmanaged transaction.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) Execute the given query in an auto-commit transaction, i.e.runInUnmanagedTransaction
(Connection connection, Query query, UnmanagedTransaction tx, long fetchSize) Execute the given query in a running unmanaged transaction, i.e.telemetry
(Connection connection, Integer api) Sends telemetry message to the server.protected boolean
protected void
verifyDatabaseNameBeforeTransaction
(org.neo4j.driver.internal.DatabaseName databaseName) protected Neo4jException
verifyNotificationConfigSupported
(org.neo4j.driver.internal.GqlNotificationConfig notificationConfig) version()
Returns the protocol version.
-
Field Details
-
VERSION
-
INSTANCE
-
METADATA_EXTRACTOR
-
-
Constructor Details
-
BoltProtocolV3
public BoltProtocolV3()
-
-
Method Details
-
createMessageFormat
Description copied from interface:BoltProtocol
InstantiateMessageFormat
used by this Bolt protocol verison.- Specified by:
createMessageFormat
in interfaceBoltProtocol
- 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 interfaceBoltProtocol
- Parameters:
userAgent
- the user agent string.boltAgent
- the bolt agentauthToken
- the authentication token.routingContext
- the configured routing contextchannelInitializedPromise
- the promise to be notified when initialization is completed.notificationConfig
- the notification configurationclock
- 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 interfaceBoltProtocol
- 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 interfaceBoltProtocol
- 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 beTransactionConfig.empty()
when absent.txType
- the Kernel transaction typenotificationConfig
- the notification configurationlogging
- the driver loggingflush
- 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 interfaceBoltProtocol
- 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
Description copied from interface:BoltProtocol
Rollback the unmanaged transaction.- Specified by:
rollbackTransaction
in interfaceBoltProtocol
- 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 interfaceBoltProtocol
- 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 configurationlogging
- 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 interfaceBoltProtocol
- 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
Description copied from interface:BoltProtocol
Sends telemetry message to the server.- Specified by:
telemetry
in interfaceBoltProtocol
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
Description copied from interface:BoltProtocol
Returns the protocol version. It can be used for version specific error messages.- Specified by:
version
in interfaceBoltProtocol
- Returns:
- the protocol version.
-
includeDateTimeUtcPatchInHello
protected boolean includeDateTimeUtcPatchInHello() -
verifyNotificationConfigSupported
protected Neo4jException verifyNotificationConfigSupported(org.neo4j.driver.internal.GqlNotificationConfig notificationConfig) -
useLegacyNotifications
protected boolean useLegacyNotifications()
-