001package io.ebean.event.readaudit;
002
003/**
004 * Log that the query was executed
005 */
006public interface ReadAuditLogger {
007
008  /**
009   * Called when a new query plan is created.
010   * <p>
011   * The query plan has the full sql and logging the query plan separately means that each of
012   * the bean and many read events can log the query plan key and not the full sql (reducing the
013   * bulk size of the read audit logs).
014   * </p>
015   */
016  void queryPlan(ReadAuditQueryPlan queryPlan);
017
018  /**
019   * Audit a find bean query that returned a bean.
020   * <p>
021   * Finds that did not return a bean are excluded.
022   * </p>
023   */
024  void auditBean(ReadEvent readBean);
025
026  /**
027   * Audit a find many query that returned some beans.
028   * <p>
029   * Finds that did not return any beans are excluded.
030   * </p>
031   * <p>
032   * For large queries executed via findEach() etc the ids are collected in batches
033   * and logged. Hence the ids list has a maximum size of the batch size.
034   * </p>
035   */
036  void auditMany(ReadEvent readMany);
037}