Interface AuditLog


  • public interface AuditLog
    The AuditLog defines an interface to retrieve audit event information from the respective audit log. The audit log is path based: the content path in the repository is used as a unique identifier to group all entries.

    The audit framework is still subject to change and will be improved. Adding entries to the audit log can be done by sending a job event with the job topic AuditLogEvent.JOB_TOPIC and the AuditLogEvent stored in the property AuditLogEvent.AUDIT_EVENT_PROPERTY or by directly calling add(AuditLogEntry) or add(List).

    • Method Detail

      • getLatestEvent

        @Deprecated
        AuditLogEntry getLatestEvent​(java.lang.String category,
                                     java.lang.String path)
        Returns the latest event for the path and category.
        Parameters:
        category - the event category
        path - the path of the event
        Returns:
        the latest event with the given path or null. throws IllegalArgumentException If category or path are null.
      • getLatestEvent

        AuditLogEntry getLatestEvent​(ResourceResolver resolver,
                                     java.lang.String category,
                                     java.lang.String path)
        Returns the latest event for the path and category.
        Parameters:
        resolver - ResourceResolver instance
        category - the event category
        path - the path of the event
        Returns:
        the latest event with the given path or null. throws IllegalArgumentException If category or path are null.
      • getLatestEvent

        @Deprecated
        AuditLogEntry getLatestEvent​(java.lang.String category,
                                     java.lang.String path,
                                     java.lang.String type)
        Returns the latest event for the path, type and category.
        Parameters:
        category - the event category
        path - the path of the event
        type - the type of the event
        Returns:
        the latest event with the given path or null. throws IllegalArgumentException If category, type or path are null.
      • getLatestEvent

        AuditLogEntry getLatestEvent​(ResourceResolver resolver,
                                     java.lang.String category,
                                     java.lang.String path,
                                     java.lang.String type)
        Returns the latest event for the path, type and category.
        Parameters:
        resolver - ResourceResolver instance
        category - the event category
        path - the path of the event
        type - the type of the event
        Returns:
        the latest event with the given path or null. throws IllegalArgumentException If category, type or path are null.
      • getLatestEvents

        @Deprecated
        AuditLogEntry[] getLatestEvents​(java.lang.String category,
                                        java.lang.String path,
                                        int max)
        Returns the latest events for the path and category.
        Parameters:
        category - the event category
        path - the path of the events
        max - the maximum number of events to return or -1 for all.
        Returns:
        an array of AuditEvents throws IllegalArgumentException If category or path are null.
      • getLatestEvents

        AuditLogEntry[] getLatestEvents​(ResourceResolver resolver,
                                        java.lang.String category,
                                        java.lang.String path,
                                        int max)
        Returns the latest events for the path and category.
        Parameters:
        resolver - ResourceResolver instance
        category - the event category
        path - the path of the events
        max - the maximum number of events to return or -1 for all.
        Returns:
        an array of AuditEvents throws IllegalArgumentException If category or path are null.
      • getLatestEvents

        @Deprecated
        AuditLogEntry[] getLatestEvents​(java.lang.String[] categories,
                                        java.lang.String path,
                                        int max)
        Returns the latest events for the path and category.
        Parameters:
        categories - the event categories
        path - the path of the events
        max - the maximum number of events to return or -1 for all.
        Returns:
        an array of AuditEvents throws IllegalArgumentException If category or path are null.
      • getLatestEvents

        AuditLogEntry[] getLatestEvents​(ResourceResolver resolver,
                                        java.lang.String[] categories,
                                        java.lang.String path,
                                        int max)
        Returns the latest events for the path and category.
        Parameters:
        resolver - ResourceResolver instance
        categories - the event categories
        path - the path of the events
        max - the maximum number of events to return or -1 for all.
        Returns:
        an array of AuditEvents throws IllegalArgumentException If category or path are null.
      • getCategories

        java.lang.String[] getCategories()
        Return an array containing all audit log categories (that have entries)
        Returns:
        An array with the categories or null
      • getLatestEventsFromTree

        @Deprecated
        AuditLogEntry[] getLatestEventsFromTree​(java.lang.String[] categories,
                                                java.lang.String pathPrefix,
                                                int max)
        Returns the latest events for all paths which will start with the prefix.
        Parameters:
        categories - the event categories
        pathPrefix - the pattern to match
        max - the maximum number of events per path to return or -1 for all.
        Returns:
        an array of AuditEvents throws IllegalArgumentException If category or pathPrefix are null.
      • getLatestEventsFromTree

        AuditLogEntry[] getLatestEventsFromTree​(ResourceResolver resolver,
                                                java.lang.String[] categories,
                                                java.lang.String pathPrefix,
                                                int max)
        Returns the latest events for all paths which will start with the prefix.
        Parameters:
        resolver - ResourceResolver instance
        categories - the event categories
        pathPrefix - the pattern to match
        max - the maximum number of events per path to return or -1 for all.
        Returns:
        an array of AuditEvents throws IllegalArgumentException If category or pathPrefix are null.
      • add

        void add​(AuditLogEntry entry)
        Add a new audit log entry.
        Parameters:
        entry - The audit log entry.
      • add

        void add​(java.util.List<AuditLogEntry> entries)
        Add new audit log entries
        Parameters:
        entries - The audit log entries.
      • move

        void move​(java.lang.String srcPath,
                  java.lang.String destPath)
        Move audit log entries from one place to another.