com.icfolson.aem.groovy.console.audit.AuditService.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aem-groovy-console Show documentation
Show all versions of aem-groovy-console Show documentation
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.
package com.icfolson.aem.groovy.console.audit
import com.icfolson.aem.groovy.console.response.RunScriptResponse
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
*/
AuditRecord createAuditRecord(Session session, RunScriptResponse response) throws RepositoryException
/**
* Delete all audit records.
*
* @param session request session, only audit records for the current user will be deleted
* @throws RepositoryException if an error occurs while deleting audit nodes
*/
void deleteAllAuditRecords(Session session) throws RepositoryException
/**
* 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 node
* @throws RepositoryException if an error occurs while deleting the audit record node
*/
void deleteAuditRecord(Session session, String userId, String relativePath) throws RepositoryException
/**
* Get all audit records.
*
* @param session request session, only audit records for the current user will be retrieved
* @return all audit records
* @throws RepositoryException if error occurs getting audit records
*/
List getAllAuditRecords(Session session) throws RepositoryException
/**
* 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
* @throws RepositoryException if error occurs getting audit record
*/
AuditRecord getAuditRecord(Session session, String userId, String relativePath) throws RepositoryException
/**
* 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
* @throws RepositoryException if error occurs getting audit records
*/
List getAuditRecords(Session session, Calendar startDate, Calendar endDate) throws RepositoryException
}