Class ReactiveAuditingEntityCallback
java.lang.Object
org.springframework.data.couchbase.core.mapping.event.ReactiveAuditingEntityCallback
- All Implemented Interfaces:
Ordered
,ReactiveAfterConvertCallback<Object>
,ReactiveBeforeConvertCallback<Object>
,EntityCallback<Object>
public class ReactiveAuditingEntityCallback
extends Object
implements ReactiveBeforeConvertCallback<Object>, ReactiveAfterConvertCallback<Object>, Ordered
Reactive
EntityCallback
to populate auditing related fields on an entity about to be saved. Based on ReactiveAfterConvertCallback- Since:
- 4.2
- Author:
- Jorge Rodríguez Martín
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionReactiveAuditingEntityCallback
(ObjectFactory<ReactiveIsNewAwareAuditingHandler> auditingHandlerFactory) Creates a newReactiveAuditingEntityCallback
using the givenMappingContext
andAuditingHandler
provided by the givenObjectFactory
. -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
org.reactivestreams.Publisher<Object>
onAfterConvert
(Object entity, CouchbaseDocument document, String collection) Entity callback method invoked after a domain object is converted to be persisted.org.reactivestreams.Publisher<Object>
onBeforeConvert
(Object entity, String collection) Entity callback method invoked before a domain object is converted to be persisted.
-
Constructor Details
-
ReactiveAuditingEntityCallback
public ReactiveAuditingEntityCallback(ObjectFactory<ReactiveIsNewAwareAuditingHandler> auditingHandlerFactory) Creates a newReactiveAuditingEntityCallback
using the givenMappingContext
andAuditingHandler
provided by the givenObjectFactory
.- Parameters:
auditingHandlerFactory
- must not be null.
-
-
Method Details
-
onBeforeConvert
Description copied from interface:ReactiveBeforeConvertCallback
Entity callback method invoked before a domain object is converted to be persisted. Can return either the same of a modified instance of the domain object.- Specified by:
onBeforeConvert
in interfaceReactiveBeforeConvertCallback<Object>
- Parameters:
entity
- the domain object to save.collection
- name of the collection.- Returns:
- a
Publisher
emitting the domain object to be persisted.
-
onAfterConvert
public org.reactivestreams.Publisher<Object> onAfterConvert(Object entity, CouchbaseDocument document, String collection) Description copied from interface:ReactiveAfterConvertCallback
Entity callback method invoked after a domain object is converted to be persisted. Can return either the same of a modified instance of the domain object.- Specified by:
onAfterConvert
in interfaceReactiveAfterConvertCallback<Object>
- Parameters:
entity
- the domain object to save.collection
- name of the collection.- Returns:
- a
Publisher
emitting the domain object to be persisted.
-
getOrder
public int getOrder()
-