Class ExportSearchAuditPlugin

java.lang.Object
fr.becpg.repo.audit.plugin.AbstractAuditPlugin
fr.becpg.repo.audit.plugin.impl.ExportSearchAuditPlugin
All Implemented Interfaces:
AuditPlugin, DatabaseAuditPlugin, org.springframework.beans.factory.InitializingBean

@Service public class ExportSearchAuditPlugin extends AbstractAuditPlugin implements DatabaseAuditPlugin

ExportSearchAuditPlugin class.

Author:
matthieu
  • Field Details

  • Constructor Details

    • ExportSearchAuditPlugin

      public ExportSearchAuditPlugin()
  • Method Details

    • isRecordOnStart

      public boolean isRecordOnStart()
      Whether the entry has to be recorded when the audited operation starts and completed when it ends, instead of being recorded once at the end. An operation heavy enough to bring the server down leaves no trace at all when its entry is only written on completion. Recording it upfront keeps the author, the volume and the start time available even when the operation never returns: such an entry simply stays flagged as not completed. An export is heavy enough to bring the server down: its entry is recorded when the export starts so that the user who requested it stays traceable even when it never completes.
      Specified by:
      isRecordOnStart in interface DatabaseAuditPlugin
      Returns:
      a boolean
    • applyTo

      public boolean applyTo(AuditType type)

      applyTo.

      Specified by:
      applyTo in interface AuditPlugin
      Parameters:
      type - a AuditType object
      Returns:
      a boolean
    • getAuditApplicationId

      public String getAuditApplicationId()

      getAuditApplicationId.

      Specified by:
      getAuditApplicationId in interface DatabaseAuditPlugin
      Returns:
      a String object
    • getAuditApplicationPath

      public String getAuditApplicationPath()

      getAuditApplicationPath.

      Specified by:
      getAuditApplicationPath in interface DatabaseAuditPlugin
      Returns:
      a String object
    • getAuditedClass

      public Class<?> getAuditedClass()

      getAuditedClass.

      Specified by:
      getAuditedClass in interface AuditPlugin
      Returns:
      a Class object
    • setAuditParameters

      @Value("${becpg.audit.exportSearch}") public void setAuditParameters(String auditParameters)

      Setter for the field auditParameters.

      Overrides:
      setAuditParameters in class AbstractAuditPlugin
      Parameters:
      auditParameters - a String object
    • beforeRecordAuditEntry

      public void beforeRecordAuditEntry(Map<String,Serializable> auditValues)

      beforeRecordAuditEntry.

      The entry of an asynchronous export is completed by the thread running it, as system: the export is credited to the user who requested it, not to the one recording the entry.
      Specified by:
      beforeRecordAuditEntry in interface DatabaseAuditPlugin
      Parameters:
      auditValues - a Map object
    • afterRecordAuditEntry

      public void afterRecordAuditEntry(Map<String,Serializable> auditValues)

      afterRecordAuditEntry.

      Specified by:
      afterRecordAuditEntry in interface DatabaseAuditPlugin
      Parameters:
      auditValues - a Map object