java.lang.Object
org.neo4j.driver.internal.messaging.v3.BoltProtocolV3
- All Implemented Interfaces:
BoltProtocol
- Direct Known Subclasses:
BoltProtocolV4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BoltProtocolstatic final MetadataExtractorstatic final BoltProtocolVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeginTransaction(Connection connection, Set<Bookmark> bookmarks, TransactionConfig config, String txType, NotificationConfig notificationConfig, Logging logging, boolean flush) Begin an unmanaged transaction.protected ResultCursorFactorybuildResultCursorFactory(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.InstantiateMessageFormatused by this Bolt protocol verison.protected booleanvoidinitializeChannel(String userAgent, org.neo4j.driver.internal.BoltAgent boltAgent, AuthToken authToken, RoutingContext routingContext, io.netty.channel.ChannelPromise channelInitializedPromise, NotificationConfig notificationConfig, Clock clock) Initialize channel after it is connected and handshake selected this protocol version.voidprepareToCloseChannel(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, NotificationConfig 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 voidverifyDatabaseNameBeforeTransaction(org.neo4j.driver.internal.DatabaseName databaseName) protected Neo4jExceptionverifyNotificationConfigSupported(NotificationConfig notificationConfig) version()Returns the protocol version.
-
Field Details
-
VERSION
-
INSTANCE
-
METADATA_EXTRACTOR
-
-
Constructor Details
-
BoltProtocolV3
public BoltProtocolV3()
-
-
Method Details
-
createMessageFormat
Description copied from interface:BoltProtocolInstantiateMessageFormatused by this Bolt protocol verison.- Specified by:
createMessageFormatin 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, NotificationConfig notificationConfig, Clock clock) Description copied from interface:BoltProtocolInitialize channel after it is connected and handshake selected this protocol version.- Specified by:
initializeChannelin 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:BoltProtocolPrepare to close channel before it is closed.- Specified by:
prepareToCloseChannelin interfaceBoltProtocol- Parameters:
channel- the channel to close.
-
beginTransaction
public CompletionStage<Void> beginTransaction(Connection connection, Set<Bookmark> bookmarks, TransactionConfig config, String txType, NotificationConfig notificationConfig, Logging logging, boolean flush) Description copied from interface:BoltProtocolBegin an unmanaged transaction.- Specified by:
beginTransactionin 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:BoltProtocolCommit the unmanaged transaction.- Specified by:
commitTransactionin 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:BoltProtocolRollback the unmanaged transaction.- Specified by:
rollbackTransactionin 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, NotificationConfig notificationConfig, Logging logging) Description copied from interface:BoltProtocolExecute the given query in an auto-commit transaction, i.e.SimpleQueryRunner.run(Query).- Specified by:
runInAutoCommitTransactionin 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:BoltProtocolExecute the given query in a running unmanaged transaction, i.e.SimpleQueryRunner.run(Query).- Specified by:
runInUnmanagedTransactionin 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:BoltProtocolSends telemetry message to the server.- Specified by:
telemetryin interfaceBoltProtocolapi- 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:BoltProtocolReturns the protocol version. It can be used for version specific error messages.- Specified by:
versionin interfaceBoltProtocol- Returns:
- the protocol version.
-
includeDateTimeUtcPatchInHello
protected boolean includeDateTimeUtcPatchInHello() -
verifyNotificationConfigSupported
-