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 TypeMethodDescriptionvoidFlush records accumulated by invocations ofregisterCreate(Object)and other registration methods to the database.voidInvalidates configuration cache.booleanbooleanvoidprocessLoggingForCurrentThread(boolean enabled) Disables/enables entity logging for current thread.voidregisterCreate(Object entity) Logs creation of an entity which is configured for manual logging (LoggedEntity.auto == false).voidregisterCreate(Object entity, boolean auto) Logs creation of an entity which is configured for auto or manual logging (depending on theautoparameter).voidregisterDelete(Object entity) Logs deletion of an entity which is configured for manual logging (LoggedEntity.auto == false).voidregisterDelete(Object entity, boolean auto) Logs deletion of an entity which is configured for auto or manual logging (depending on theautoparameter).voidregisterModify(Object entity) Logs modification of an entity which is configured for manual logging (LoggedEntity.auto == false).voidregisterModify(Object entity, boolean auto) Logs modification of an entity which is configured for auto or manual logging (depending on theautoparameter).voidregisterModify(Object entity, boolean auto, AttributeChanges changes) Logs modification of an entity which is configured for auto or manual logging (depending on theautoparameter).voidsetEnabled(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 theautoparameter). -
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 theautoparameter). -
registerModify
Logs modification of an entity which is configured for auto or manual logging (depending on theautoparameter).- 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 theautoparameter). -
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.
-