Class Neo4jEventPublicationRepository
java.lang.Object
org.springframework.modulith.events.neo4j.Neo4jEventPublicationRepository
- All Implemented Interfaces:
EventPublicationRepository
@Transactional
class Neo4jEventPublicationRepository
extends Object
implements EventPublicationRepository
A
Neo4jClient
based implementation of EventPublicationRepository
.- Since:
- 1.1
- Author:
- Gerrit Meier, Oliver Drotbohm, Cora Iberkleid
-
Constructor Summary
ConstructorDescriptionNeo4jEventPublicationRepository
(org.springframework.data.neo4j.core.Neo4jClient neo4jClient, org.neo4j.cypherdsl.core.renderer.Configuration cypherDslConfiguration, EventSerializer eventSerializer, CompletionMode completionMode) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(TargetEventPublication publication) Persists the givenTargetEventPublication
.void
Deletes all publications that were already marked as completed.void
deleteCompletedPublicationsBefore
(Instant instant) Deletes all publication that were already marked as completed with a completion date before the given one.void
deletePublications
(List<UUID> identifiers) Deletes all publications with the given identifiers.Returns all completed event publications currently found in the system.Returns allTargetEventPublication
s that have not been completed yet.findIncompletePublicationsByEventAndTargetIdentifier
(Object event, PublicationTargetIdentifier targetIdentifier) Return the incompleteTargetEventPublication
for the given serialized event and listener identifier.Returns allTargetEventPublication
s that have not been completed and were published before the givenInstant
.void
markCompleted
(Object event, PublicationTargetIdentifier identifier, Instant completionDate) Marks the publication for the given event andPublicationTargetIdentifier
to be completed at the givenInstant
.void
markCompleted
(UUID identifier, Instant completionDate) Marks the publication with the given identifier completed at the givenInstant
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.modulith.events.core.EventPublicationRepository
markCompleted
-
Constructor Details
-
Neo4jEventPublicationRepository
Neo4jEventPublicationRepository(org.springframework.data.neo4j.core.Neo4jClient neo4jClient, org.neo4j.cypherdsl.core.renderer.Configuration cypherDslConfiguration, EventSerializer eventSerializer, CompletionMode completionMode)
-
-
Method Details
-
create
Description copied from interface:EventPublicationRepository
Persists the givenTargetEventPublication
.- Specified by:
create
in interfaceEventPublicationRepository
- Parameters:
publication
- must not be null.- Returns:
- will never be null.
-
markCompleted
@Transactional public void markCompleted(Object event, PublicationTargetIdentifier identifier, Instant completionDate) Description copied from interface:EventPublicationRepository
Marks the publication for the given event andPublicationTargetIdentifier
to be completed at the givenInstant
.- Specified by:
markCompleted
in interfaceEventPublicationRepository
- Parameters:
event
- must not be null.identifier
- must not be null.completionDate
- must not be null.
-
markCompleted
Description copied from interface:EventPublicationRepository
Marks the publication with the given identifier completed at the givenInstant
.- Specified by:
markCompleted
in interfaceEventPublicationRepository
- Parameters:
identifier
- must not be null.completionDate
- must not be null.
-
findIncompletePublications
Description copied from interface:EventPublicationRepository
Returns allTargetEventPublication
s that have not been completed yet.- Specified by:
findIncompletePublications
in interfaceEventPublicationRepository
- Returns:
- will never be null.
-
findIncompletePublicationsPublishedBefore
@Transactional(readOnly=true) public List<TargetEventPublication> findIncompletePublicationsPublishedBefore(Instant instant) Description copied from interface:EventPublicationRepository
Returns allTargetEventPublication
s that have not been completed and were published before the givenInstant
.- Specified by:
findIncompletePublicationsPublishedBefore
in interfaceEventPublicationRepository
- Parameters:
instant
- must not be null.- Returns:
- will never be null.
-
findIncompletePublicationsByEventAndTargetIdentifier
@Transactional(readOnly=true) public Optional<TargetEventPublication> findIncompletePublicationsByEventAndTargetIdentifier(Object event, PublicationTargetIdentifier targetIdentifier) Description copied from interface:EventPublicationRepository
Return the incompleteTargetEventPublication
for the given serialized event and listener identifier.- Specified by:
findIncompletePublicationsByEventAndTargetIdentifier
in interfaceEventPublicationRepository
- Parameters:
event
- must not be null.targetIdentifier
- must not be null.- Returns:
- will never be null.
-
findCompletedPublications
Description copied from interface:EventPublicationRepository
Returns all completed event publications currently found in the system.- Specified by:
findCompletedPublications
in interfaceEventPublicationRepository
- Returns:
- will never be null.
-
deletePublications
Description copied from interface:EventPublicationRepository
Deletes all publications with the given identifiers.- Specified by:
deletePublications
in interfaceEventPublicationRepository
- Parameters:
identifiers
- must not be null.
-
deleteCompletedPublications
Description copied from interface:EventPublicationRepository
Deletes all publications that were already marked as completed.- Specified by:
deleteCompletedPublications
in interfaceEventPublicationRepository
-
deleteCompletedPublicationsBefore
Description copied from interface:EventPublicationRepository
Deletes all publication that were already marked as completed with a completion date before the given one.- Specified by:
deleteCompletedPublicationsBefore
in interfaceEventPublicationRepository
- Parameters:
instant
- must not be null.
-