Class AuditHelper


  • @ThreadSafe
    public final class AuditHelper
    extends Object
    Simplify system auditing calls.
    For each predefined action (see EAuditActionType - CREATE, MODIFY, DELETE, UNDELETE, EXECUTE) this class provided static helpers methods.
    For MODIFY actions, the performed action (like "set-name") should always be first.
    Error details should always go last.
    Author:
    Philip Helger
    • Method Detail

      • isDefaultAuditorSet

        public static boolean isDefaultAuditorSet()
        Returns:
        true if the current Auditor is the default auditor.
        Since:
        8.3.2
      • setAuditor

        public static void setAuditor​(@Nonnull
                                      IAuditor aAuditor)
        Set the global auditor to use.
        Parameters:
        aAuditor - The auditor to be set. May not be null.
      • setDefaultAuditor

        public static void setDefaultAuditor()
        Set the default auditor again. This may be helpful when shutting down the main auditor, and at least want some prove, when something auditible happens.
      • onAuditCreateSuccess

        public static void onAuditCreateSuccess​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType)
      • onAuditCreateSuccess

        public static void onAuditCreateSuccess​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType,
                                                @Nullable
                                                Object... aArgs)
      • onAuditCreateFailure

        @Deprecated(forRemoval=false)
        @UnsupportedOperation
        @DevelopersNote("Use the version with parameters!")
        public static void onAuditCreateFailure​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType)
        Deprecated.
      • onAuditCreateFailure

        public static void onAuditCreateFailure​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType,
                                                @Nullable
                                                Object... aArgs)
      • onAuditModifySuccess

        @Deprecated(forRemoval=false)
        @UnsupportedOperation
        @DevelopersNote("Use the version with parameters!")
        public static void onAuditModifySuccess​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType,
                                                @Nonnull
                                                String sWhat)
        Deprecated.
      • onAuditModifyFailure

        @Deprecated(forRemoval=false)
        @UnsupportedOperation
        @DevelopersNote("Use the version with parameters!")
        public static void onAuditModifyFailure​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType,
                                                @Nonnull
                                                String sWhat)
        Deprecated.
      • onAuditDeleteSuccess

        @Deprecated(forRemoval=false)
        @UnsupportedOperation
        @DevelopersNote("Use the version with parameters!")
        public static void onAuditDeleteSuccess​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType)
        Deprecated.
      • onAuditDeleteSuccess

        public static void onAuditDeleteSuccess​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType,
                                                @Nullable
                                                Object... aArgs)
      • onAuditDeleteFailure

        @Deprecated(forRemoval=false)
        @UnsupportedOperation
        @DevelopersNote("Use the version with parameters!")
        public static void onAuditDeleteFailure​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType)
        Deprecated.
      • onAuditDeleteFailure

        public static void onAuditDeleteFailure​(@Nonnull
                                                com.helger.commons.type.ObjectType aObjectType,
                                                @Nullable
                                                Object... aArgs)
      • onAuditUndeleteSuccess

        @Deprecated(forRemoval=false)
        @UnsupportedOperation
        @DevelopersNote("Use the version with parameters!")
        public static void onAuditUndeleteSuccess​(@Nonnull
                                                  com.helger.commons.type.ObjectType aObjectType)
        Deprecated.
      • onAuditUndeleteSuccess

        public static void onAuditUndeleteSuccess​(@Nonnull
                                                  com.helger.commons.type.ObjectType aObjectType,
                                                  @Nullable
                                                  Object... aArgs)
      • onAuditUndeleteFailure

        @Deprecated(forRemoval=false)
        @UnsupportedOperation
        @DevelopersNote("Use the version with parameters!")
        public static void onAuditUndeleteFailure​(@Nonnull
                                                  com.helger.commons.type.ObjectType aObjectType)
        Deprecated.
      • onAuditUndeleteFailure

        public static void onAuditUndeleteFailure​(@Nonnull
                                                  com.helger.commons.type.ObjectType aObjectType,
                                                  @Nullable
                                                  Object... aArgs)