package com.atlassian.bitbucket.internal.audit;

import com.atlassian.bitbucket.audit.AuditEntry;
import com.atlassian.bitbucket.audit.AuditService;
import com.atlassian.bitbucket.project.Project;
import com.atlassian.bitbucket.repository.Repository;

import javax.annotation.Nonnull;

/**
 * Handles the storing and retrieval of audit events for use in the UI
 *
 * @since 4.0
 */
public interface InternalAuditService extends AuditService {

    /**
     * Cleans up historical audit events to control storage usage.
     */
    void cleanup();

    int getMaxLogRows();

    /**
     * Store the provided event at the project level against the provided project
     *
     * @param project the project
     * @param event   the audit event
     */
    void save(@Nonnull Project project, @Nonnull AuditEntry event);

    /**
     * Store the provided event at the repository level against the provided repository
     *
     * @param repository the repository
     * @param event      the audit event
     */
    void save(@Nonnull Repository repository, @Nonnull AuditEntry event);
}
