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
Modifier and TypeInterfaceDescriptionstatic class
A builder forreactive Neo4j clients
.static interface
static interface
A contract for an ongoing delegation in the selected database.static interface
static interface
A runnable delegation.static interface
Contract for a runnable query that can be either run returning its result, run without results or be parameterized.static interface
Contract for a runnable query inside a dedicated database.static interface
Combination ofNeo4jClient.RunnableSpecBoundToDatabase
andNeo4jClient.RunnableSpecBoundToUser
, can't be bound any further.static interface
Contract for a runnable query bound to a user to be impersonated.static interface
Contract for a runnable query specification which still can be bound to a specific database and an impersonated user. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ReactiveNeo4jClient
create
(org.neo4j.driver.Driver driver) static ReactiveNeo4jClient
create
(org.neo4j.driver.Driver driver, ReactiveDatabaseSelectionProvider databaseSelectionProvider) delegateTo
(Function<org.neo4j.driver.reactivestreams.ReactiveQueryRunner, reactor.core.publisher.Mono<T>> callback) Delegates interaction with the default database to the given callback.Returns the assigned database selection provider.default reactor.core.publisher.Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner>
default reactor.core.publisher.Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner>
getQueryRunner
(reactor.core.publisher.Mono<DatabaseSelection> databaseSelection) reactor.core.publisher.Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner>
getQueryRunner
(reactor.core.publisher.Mono<DatabaseSelection> databaseSelection, reactor.core.publisher.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.Builder
with
(org.neo4j.driver.Driver driver)
-
Field Details
-
cypherLog
-
log
-
-
Method Details
-
create
-
create
static ReactiveNeo4jClient create(org.neo4j.driver.Driver driver, ReactiveDatabaseSelectionProvider databaseSelectionProvider) -
with
-
getQueryRunner
default reactor.core.publisher.Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner> getQueryRunner()- Returns:
- A managed query runner
- Since:
- 6.2
- See Also:
-
getQueryRunner
default reactor.core.publisher.Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner> getQueryRunner(reactor.core.publisher.Mono<DatabaseSelection> databaseSelection) - Returns:
- A managed query runner
- Since:
- 6.2
- See Also:
-
getQueryRunner
reactor.core.publisher.Mono<org.neo4j.driver.reactivestreams.ReactiveQueryRunner> getQueryRunner(reactor.core.publisher.Mono<DatabaseSelection> databaseSelection, reactor.core.publisher.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, reactor.core.publisher.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
Returns the assigned database selection provider.- Returns:
- The database selection provider - can be null
-