Interface ReactiveNeo4jClient
@API(status=STABLE,
since="6.0")
public interface ReactiveNeo4jClient
Reactive Neo4j client. The main difference to the
imperative Neo4j
client is the fact that all operations will only be executed once something subscribes
to the reactive sequence defined.- Since:
- 6.0
- Author:
- Michael J. Simons
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forreactive Neo4j clients.static interfaceStep for defining the mapping.static interfaceA contract for an ongoing delegation in the selected database.static interfaceFinal step that triggers fetching.static interfaceA runnable delegation.static interfaceContract for a runnable query that can be either run returning its result, run without results or be parameterized.static interfaceContract for a runnable query inside a dedicated database.static interfaceCombination ofNeo4jClient.RunnableSpecBoundToDatabaseandNeo4jClient.RunnableSpecBoundToUser, can't be bound any further.static interfaceContract for a runnable query bound to a user to be impersonated.static interfaceContract for a runnable query specification which still can be bound to a specific database and an impersonated user. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LogAccessorAll Cypher statements executed will be logged here.static final LogAccessorSome methods of theReactiveNeo4jClientwill be logged here. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReactiveNeo4jClientcreate(org.neo4j.driver.Driver driver) static ReactiveNeo4jClientcreate(org.neo4j.driver.Driver driver, ReactiveDatabaseSelectionProvider databaseSelectionProvider) delegateTo(Function<org.neo4j.driver.reactivestreams.ReactiveQueryRunner, Mono<T>> callback) Delegates interaction with the default database to the given callback.@Nullable ReactiveDatabaseSelectionProviderReturns the assigned database selection provider.default Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner> Retrieves a query runner matching the plain Neo4j Java Driver api bound to Spring * transactions.default Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner> getQueryRunner(Mono<DatabaseSelection> databaseSelection) Retrieves a query runner matching the plain Neo4j Java Driver api bound to Spring * transactions configured to use a specific database.Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner> getQueryRunner(Mono<DatabaseSelection> databaseSelection, Mono<UserSelection> userSelection) Retrieves a query runner that will participate in ongoing Spring transactions (either in declarative (implicit via@Transactional) or in programmatically (explicit via transaction template) ones).Entrypoint for creating a new Cypher query.Entrypoint for creating a new Cypher query based on a supplier.static ReactiveNeo4jClient.Builderwith(org.neo4j.driver.Driver driver)
-
Field Details
-
cypherLog
All Cypher statements executed will be logged here. -
log
Some methods of theReactiveNeo4jClientwill be logged here.
-
-
Method Details
-
create
-
create
static ReactiveNeo4jClient create(org.neo4j.driver.Driver driver, ReactiveDatabaseSelectionProvider databaseSelectionProvider) -
with
-
getQueryRunner
Retrieves a query runner matching the plain Neo4j Java Driver api bound to Spring * transactions.- Returns:
- a managed query runner
- Since:
- 6.2
- See Also:
-
getQueryRunner
default Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner> getQueryRunner(Mono<DatabaseSelection> databaseSelection) Retrieves a query runner matching the plain Neo4j Java Driver api bound to Spring * transactions configured to use a specific database.- Parameters:
databaseSelection- the database to use- Returns:
- a managed query runner
- Since:
- 6.2
- See Also:
-
getQueryRunner
Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner> getQueryRunner(Mono<DatabaseSelection> databaseSelection, Mono<UserSelection> userSelection) Retrieves a query runner that will participate in ongoing Spring transactions (either in declarative (implicit via@Transactional) or in programmatically (explicit via transaction template) ones). This runner can be used with the Cypher-DSL for example. If the client cannot retrieve an ongoing Spring transaction, this runner will use auto-commit semantics.- Parameters:
databaseSelection- the target database.userSelection- the user selection- Returns:
- a managed query runner
- Since:
- 6.2
-
query
Entrypoint for creating a new Cypher query. Doesn't matter at this point whether it's a match, merge, create or removal of things.- Parameters:
cypher- the cypher code that shall be executed- Returns:
- a new CypherSpec
-
query
Entrypoint for creating a new Cypher query based on a supplier. Doesn't matter at this point whether it's a match, merge, create or removal of things. The supplier can be an arbitrary Supplier that may provide a DSL for generating the Cypher statement.- Parameters:
cypherSupplier- a supplier of arbitrary Cypher code- Returns:
- a runnable query specification.
-
delegateTo
<T> ReactiveNeo4jClient.OngoingDelegation<T> delegateTo(Function<org.neo4j.driver.reactivestreams.ReactiveQueryRunner, Mono<T>> callback) Delegates interaction with the default database to the given callback.- Type Parameters:
T- the type of the result being produced- Parameters:
callback- a function receiving a reactive statement runner for database interaction that can optionally return a publisher with none or exactly one element- Returns:
- a single publisher containing none or exactly one element that will be produced by the callback
-
getDatabaseSelectionProvider
@Nullable ReactiveDatabaseSelectionProvider getDatabaseSelectionProvider()Returns the assigned database selection provider.- Returns:
- the database selection provider - can be null
-