Package io.jmix.audit
Interface EntityLog
- All Known Implementing Classes:
EntityLogImpl
public interface EntityLog
Allows to log entity lifecycle events: create, modify, delete.
Configured by
Configured by
LoggedEntity
and
LoggedAttribute
entities.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Flush records accumulated by invocations ofregisterCreate(Object)
and other registration methods to the database.void
Invalidates configuration cache.boolean
boolean
void
processLoggingForCurrentThread
(boolean enabled) Disables/enables entity logging for current thread.void
registerCreate
(Object entity) Logs creation of an entity which is configured for manual logging (LoggedEntity.auto == false).void
registerCreate
(Object entity, boolean auto) Logs creation of an entity which is configured for auto or manual logging (depending on theauto
parameter).void
registerDelete
(Object entity) Logs deletion of an entity which is configured for manual logging (LoggedEntity.auto == false).void
registerDelete
(Object entity, boolean auto) Logs deletion of an entity which is configured for auto or manual logging (depending on theauto
parameter).void
registerModify
(Object entity) Logs modification of an entity which is configured for manual logging (LoggedEntity.auto == false).void
registerModify
(Object entity, boolean auto) Logs modification of an entity which is configured for auto or manual logging (depending on theauto
parameter).void
registerModify
(Object entity, boolean auto, AttributeChanges changes) Logs modification of an entity which is configured for auto or manual logging (depending on theauto
parameter).void
setEnabled
(boolean enabled)
-
Method Details
-
isEnabled
boolean isEnabled() -
setEnabled
void setEnabled(boolean enabled) -
registerCreate
Logs creation of an entity which is configured for manual logging (LoggedEntity.auto == false). -
registerCreate
Logs creation of an entity which is configured for auto or manual logging (depending on theauto
parameter). -
registerModify
Logs modification of an entity which is configured for manual logging (LoggedEntity.auto == false). -
registerModify
Logs modification of an entity which is configured for auto or manual logging (depending on theauto
parameter). -
registerModify
Logs modification of an entity which is configured for auto or manual logging (depending on theauto
parameter).- Parameters:
changes
- attribute changes provided by caller
-
registerDelete
Logs deletion of an entity which is configured for manual logging (LoggedEntity.auto == false). -
registerDelete
Logs deletion of an entity which is configured for auto or manual logging (depending on theauto
parameter). -
invalidateCache
void invalidateCache()Invalidates configuration cache. The configuration will be recreated from the database on next lifecycle event. -
processLoggingForCurrentThread
void processLoggingForCurrentThread(boolean enabled) Disables/enables entity logging for current thread. Enabled by default.- Parameters:
enabled
- entity logging disabled if false, enabled otherwise.
-
isLoggingForCurrentThread
boolean isLoggingForCurrentThread()- Returns:
- whether logging for the current thread is enabled
- See Also:
-
flush
Flush records accumulated by invocations ofregisterCreate(Object)
and other registration methods to the database.
-