Package com.helger.photon.audit
Class LoggingAuditor
- java.lang.Object
-
- com.helger.photon.audit.AbstractAuditor
-
- com.helger.photon.audit.LoggingAuditor
-
- All Implemented Interfaces:
IAuditor
public class LoggingAuditor extends AbstractAuditor
An implementation ofIAuditorusing SLF4J logging.- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static StringVALUE_FAILUREstatic StringVALUE_SUCCESS
-
Constructor Summary
Constructors Constructor Description LoggingAuditor(com.helger.security.authentication.subject.user.ICurrentUserIDProvider aUserIDProvider)LoggingAuditor(com.helger.security.authentication.subject.user.ICurrentUserIDProvider aUserIDProvider, String sCommonPrefix)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetAuditItemString(IAuditItem aAuditItem)StringgetCommonPrefix()static StringgetDefaultAuditItemString(IAuditItem aAuditItem)protected voidhandleAuditItem(IAuditItem aAuditItem)Implement this method to handle the created audit items.-
Methods inherited from class com.helger.photon.audit.AbstractAuditor
createAuditItem, getActionStringProvider, getCurrentUserIDProvider, setActionStringProvider, setCurrentUserIDProvider
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.helger.photon.audit.IAuditor
onCreateFailure, onCreateSuccess, onDeleteFailure, onDeleteSuccess, onExecuteFailure, onExecuteFailure, onExecuteSuccess, onExecuteSuccess, onModifyFailure, onModifySuccess, onUndeleteFailure, onUndeleteSuccess
-
-
-
-
Field Detail
-
VALUE_SUCCESS
public static final String VALUE_SUCCESS
- See Also:
- Constant Field Values
-
VALUE_FAILURE
public static final String VALUE_FAILURE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LoggingAuditor
public LoggingAuditor(@Nonnull com.helger.security.authentication.subject.user.ICurrentUserIDProvider aUserIDProvider)
-
-
Method Detail
-
getCommonPrefix
@Nonnull public String getCommonPrefix()
- Returns:
- The prefix to be used in all logging lines. Never
nullbut maybe empty.
-
getDefaultAuditItemString
@Nonnull @OverrideOnDemand public static String getDefaultAuditItemString(@Nonnull IAuditItem aAuditItem)
-
getAuditItemString
@Nonnull @OverrideOnDemand protected String getAuditItemString(@Nonnull IAuditItem aAuditItem)
-
handleAuditItem
protected void handleAuditItem(@Nonnull IAuditItem aAuditItem)
Description copied from class:AbstractAuditorImplement this method to handle the created audit items.- Specified by:
handleAuditItemin classAbstractAuditor- Parameters:
aAuditItem- The audit item to handle. Nevernull.
-
-