Class AuditServiceInternalImpl

java.lang.Object
org.craftercms.studio.impl.v2.service.audit.internal.AuditServiceInternalImpl
All Implemented Interfaces:
AuditServiceInternal

public class AuditServiceInternalImpl extends Object implements AuditServiceInternal
  • Constructor Details

    • AuditServiceInternalImpl

      public AuditServiceInternalImpl()
  • Method Details

    • getAuditLog

      public List<AuditLog> getAuditLog(String siteId, int offset, int limit, String user, List<String> operations, boolean includeParameters, ZonedDateTime dateFrom, ZonedDateTime dateTo, String target, String origin, String clusterNodeId, String sort, String order)
      Description copied from interface: AuditServiceInternal
      Get audit log filtered by parameters
      Specified by:
      getAuditLog in interface AuditServiceInternal
      Parameters:
      siteId - site identifier
      offset - offset of first record in result set
      limit - number of records to return as result set
      user - filter by user
      operations - filter by list of operations
      includeParameters - include audit log parameters in result set
      dateFrom - filter results by lower border for date
      dateTo - filter results by upper border for date
      target - filter results by target
      origin - filter results by origin
      clusterNodeId - filter results by cluster node
      sort - sort strategy
      order - order strategy
      Returns:
      List of audit log entries
    • getAuditLogTotal

      public int getAuditLogTotal(String siteId, String user, List<String> operations, boolean includeParameters, ZonedDateTime dateFrom, ZonedDateTime dateTo, String target, String origin, String clusterNodeId)
      Description copied from interface: AuditServiceInternal
      Get the audit log entry count given the provided filter parameters
      Specified by:
      getAuditLogTotal in interface AuditServiceInternal
      Parameters:
      siteId - site ID
      user - filter by user
      operations - filter by list of operations
      includeParameters - include audit log parameters in result set
      dateFrom - filter results by lower border for date
      dateTo - filter results by upper border for date
      target - filter results by target
      origin - filter results by origin
      clusterNodeId - filter results by cluster node
      Returns:
      total number of records matching the filter
    • getAuditLogEntry

      public AuditLog getAuditLogEntry(String siteId, long auditLogId)
      Description copied from interface: AuditServiceInternal
      Get audit log entry by id
      Specified by:
      getAuditLogEntry in interface AuditServiceInternal
      Parameters:
      siteId - the site ID. When null or empty, it will retrieve entries for all sites and include admin activities.
      auditLogId - id of audit log entry to get
      Returns:
      Audit log entry
    • insertAuditLog

      public boolean insertAuditLog(AuditLog auditLog)
      Description copied from interface: AuditServiceInternal
      Insert log audit entry
      Specified by:
      insertAuditLog in interface AuditServiceInternal
      Parameters:
      auditLog - Audit log to insert
      Returns:
      true if successful, otherwise false
    • createAuditLogEntry

      public AuditLog createAuditLogEntry()
      Description copied from interface: AuditServiceInternal
      Create Audit log entry and populate common properties
      Specified by:
      createAuditLogEntry in interface AuditServiceInternal
      Returns:
      Audit log entry
    • selectUserFeedEntries

      public List<AuditLog> selectUserFeedEntries(String user, String siteId, int offset, int limit, String contentType, boolean hideLiveItems)
      Specified by:
      selectUserFeedEntries in interface AuditServiceInternal
    • deleteAuditLogForSite

      public void deleteAuditLogForSite(long siteId)
      Description copied from interface: AuditServiceInternal
      Delete audit log for site
      Specified by:
      deleteAuditLogForSite in interface AuditServiceInternal
      Parameters:
      siteId - site id
    • getCommitAuthors

      public List<CommitAuthor> getCommitAuthors(long siteId, List<String> commitIds, String path)
      Description copied from interface: AuditServiceInternal
      Get commit authors from a list of commit ids This will look in the audit data and retrieve a CommitAuthor when:
      • There is an audit entry for the given commit id
      • AND the audit entry origin is API
      • AND the audit entry primary_target_value correspond to the given path
      Specified by:
      getCommitAuthors in interface AuditServiceInternal
      Parameters:
      siteId - site id
      commitIds - commit ids
      path - path of the file
      Returns:
      list CommitAuthor of the commit
    • isAudited

      public boolean isAudited(long siteId, String commitId)
      Description copied from interface: AuditServiceInternal
      Check if a commit has been audited.
      Specified by:
      isAudited in interface AuditServiceInternal
      Parameters:
      siteId - site id
      commitId - commit id
      Returns:
      true if there is an audit entry for the given commit id, otherwise false
    • setAuditDao

      public void setAuditDao(AuditDAO auditDao)
    • setRetryingDatabaseOperationFacade

      public void setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)