Package org.javers.spring.auditable
Interface AdvancedCommitPropertiesProvider
- All Superinterfaces:
CommitPropertiesProvider
- All Known Implementing Classes:
AdvancedCommitPropertiesProvider.EmptyAdvancedCommitPropertiesProvider
This is an extended version of
Both interfaces exist because of backward compatibility reasons.
Choose this extended version of the interface to generate commit properties that might depend on a current method being executed. See
It's not recommended to implement both interfaces in your class, if so, Javers merges the results.
Usage
Create a bean in your Spring context, for example:
CommitPropertiesProvider.
Both interfaces exist because of backward compatibility reasons.
Choose this extended version of the interface to generate commit properties that might depend on a current method being executed. See
AuditedMethodExecutionContext.
It's not recommended to implement both interfaces in your class, if so, Javers merges the results.
Usage
Create a bean in your Spring context, for example:
@Bean
@ConditionalOnMissingBean
public AdvancedCommitPropertiesProvider advancedCommitPropertiesProvider() {
return new MyAdvancedCommitPropertiesProvider();
}
- Since:
- 7.5
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class -
Method Summary
Modifier and TypeMethodDescriptionempty()Default implementation returning empty maps.provideForCommittedObject(Object savedDomainObject, AuditedMethodExecutionContext ctx) Extended version ofCommitPropertiesProvider.provideForCommittedObject(Object), which gives access to an audited method execution context.provideForDeleteById(Class<?> deletedDomainObjectClass, Object deletedDomainObjectId, AuditedMethodExecutionContext ctx) Extended version ofCommitPropertiesProvider.provideForDeleteById(Class, Object), which gives access to an audited method execution context.provideForDeletedObject(Object deletedDomainObject, AuditedMethodExecutionContext ctx) Extended version ofCommitPropertiesProvider.provideForDeletedObject(Object), which gives access to an audited method execution context.Methods inherited from interface org.javers.spring.auditable.CommitPropertiesProvider
provide, provideForCommittedObject, provideForDeleteById, provideForDeletedObject
-
Method Details
-
provideForCommittedObject
default Map<String,String> provideForCommittedObject(Object savedDomainObject, AuditedMethodExecutionContext ctx) Extended version ofCommitPropertiesProvider.provideForCommittedObject(Object), which gives access to an audited method execution context.
These two method variants exist because of backward compatibility reasons. Pick one you want to override. If you override both of them (which is not recommended) — Javers merges the results.
Both method variants returns empty Map by default.- Returns:
- a map of commit properties
- See Also:
-
provideForDeletedObject
default Map<String,String> provideForDeletedObject(Object deletedDomainObject, AuditedMethodExecutionContext ctx) Extended version ofCommitPropertiesProvider.provideForDeletedObject(Object), which gives access to an audited method execution context.
These two method variants exist because of backward compatibility reasons. Pick one you want to override. If you override both of them (which is not recommended) — Javers merges the results.
Default impl delegates toprovideForCommittedObject(Object, AuditedMethodExecutionContext).- Returns:
- a map of commit properties
- See Also:
-
provideForDeleteById
default Map<String,String> provideForDeleteById(Class<?> deletedDomainObjectClass, Object deletedDomainObjectId, AuditedMethodExecutionContext ctx) Extended version ofCommitPropertiesProvider.provideForDeleteById(Class, Object), which gives access to an audited method execution context.
These two method variants exist because of backward compatibility reasons. Pick one you want to override. If you override both of them (which is not recommended) — Javers merges the results.
Both method variants returns empty Map by default.- Returns:
- a map of commit properties
- See Also:
-
empty
Default implementation returning empty maps.
-