All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.icfolson.aem.groovy.console.audit.AuditService.groovy Maven / Gradle / Ivy

Go to download

The AEM Groovy Console provides an interface for running Groovy scripts in the AEM container. Scripts can be created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the AEM, Sling, or JCR APIs.

There is a newer version: 16.0.0
Show newest version
package com.icfolson.aem.groovy.console.audit

import com.icfolson.aem.groovy.console.response.RunScriptResponse
import org.apache.sling.api.resource.PersistenceException

import javax.jcr.RepositoryException
import javax.jcr.Session

interface AuditService {

    /**
     * Create an audit record for the given script execution response.
     *
     * @param session request session for the user executing the script
     * @param response response containing execution result or exception
     * @throws RepositoryException if error occurs creating audit record
     * @throws PersistenceException if error occurs creating audit record
     */
    AuditRecord createAuditRecord(Session session,
        RunScriptResponse response) throws RepositoryException, PersistenceException

    /**
     * Delete all audit records.
     *
     * @param session request session, only audit records for the current user will be deleted
     * @throws PersistenceException if an error occurs while deleting audit resources
     */
    void deleteAllAuditRecords(Session session) throws PersistenceException

    /**
     * Delete an audit record.
     *
     * @param session request session, only audit records for the current user will be deleted
     * @param userId user that owns the audit record
     * @param relativePath relative path to audit record from parent audit resource
     * @throws PersistenceException if an error occurs while deleting the audit record resource
     */
    void deleteAuditRecord(Session session, String userId, String relativePath) throws PersistenceException

    /**
     * Get all audit records.
     *
     * @param session request session, only audit records for the current user will be retrieved
     * @return all audit records
     */
    List getAllAuditRecords(Session session)

    /**
     * Get the audit record at the given relative path.
     *
     * @param session request session, only audit records for the current user will be retrieved
     * @param userId user that owns the audit record
     * @param relativePath relative path to audit record from parent audit node
     * @return audit record or null if none exists
     */
    AuditRecord getAuditRecord(Session session, String userId, String relativePath)

    /**
     * Get a list of audit records for the given date range.
     *
     * @param session request session, only audit records for the current user will be retrieved
     * @param startDate start date
     * @param endDate end date
     * @return list of audit records in the given date range
     */
    List getAuditRecords(Session session, Calendar startDate, Calendar endDate)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy