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 LoggedEntity and LoggedAttribute entities.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    flush(String storeName)
    Flush records accumulated by invocations of registerCreate(Object) and other registration methods to the database.
    void
    Invalidates configuration cache.
    boolean
     
    boolean
     
    void
    Disables/enables entity logging for current thread.
    void
    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 the auto parameter).
    void
    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 the auto parameter).
    void
    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 the auto parameter).
    void
    registerModify(Object entity, boolean auto, AttributeChanges changes)
    Logs modification of an entity which is configured for auto or manual logging (depending on the auto parameter).
    void
    setEnabled(boolean enabled)
     
  • Method Details

    • isEnabled

      boolean isEnabled()
    • setEnabled

      void setEnabled(boolean enabled)
    • registerCreate

      void registerCreate(Object entity)
      Logs creation of an entity which is configured for manual logging (LoggedEntity.auto == false).
    • registerCreate

      void registerCreate(Object entity, boolean auto)
      Logs creation of an entity which is configured for auto or manual logging (depending on the auto parameter).
    • registerModify

      void registerModify(Object entity)
      Logs modification of an entity which is configured for manual logging (LoggedEntity.auto == false).
    • registerModify

      void registerModify(Object entity, boolean auto)
      Logs modification of an entity which is configured for auto or manual logging (depending on the auto parameter).
    • registerModify

      void registerModify(Object entity, boolean auto, @Nullable AttributeChanges changes)
      Logs modification of an entity which is configured for auto or manual logging (depending on the auto parameter).
      Parameters:
      changes - attribute changes provided by caller
    • registerDelete

      void registerDelete(Object entity)
      Logs deletion of an entity which is configured for manual logging (LoggedEntity.auto == false).
    • registerDelete

      void registerDelete(Object entity, boolean auto)
      Logs deletion of an entity which is configured for auto or manual logging (depending on the auto 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

      void flush(String storeName)
      Flush records accumulated by invocations of registerCreate(Object) and other registration methods to the database.