@ThreadSafe public final class AuditManager extends AbstractSimpleDAO implements IAuditManager
IDAO.EMode| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_DT_STRING |
static String |
ATTR_SUCCESS |
static String |
ATTR_TYPE |
static String |
ATTR_USER |
static String |
ELEMENT_ITEM |
static String |
ELEMENT_ITEMS |
DEFAULT_AUTO_SAVE_ENABLED, m_aRWLock| Constructor and Description |
|---|
AuditManager(String sBaseDir,
ICurrentUserIDProvider aUserIDProvider)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected com.helger.commons.microdom.IMicroDocument |
createWriteData()
Create the XML document that should be saved to the file.
|
boolean |
equals(Object o) |
List<IAuditItem> |
getAllAuditItemsOfDate(org.joda.time.LocalDate aDate) |
int |
getAuditItemCount() |
AsynchronousAuditor |
getAuditor() |
List<IAuditItem> |
getLastAuditItems(int nMaxItems) |
static String |
getRelativeAuditFilename(org.joda.time.LocalDate aDate) |
int |
hashCode() |
protected void |
onFilenameChange(String sPreviousFilename,
String sNewFilename)
Called after a successful write of the file, if the filename is different
from the previous filename.
|
protected com.helger.commons.state.EChange |
onRead(com.helger.commons.microdom.IMicroDocument aDoc)
Fill the internal structures with from the passed XML document.
|
static void |
readFromXML(com.helger.commons.microdom.IMicroDocument aDoc,
com.helger.photon.basic.security.audit.AuditManager.IReadHandler aHandler) |
void |
stop()
Stop taking new audits.
|
String |
toString() |
beforeWriteToFile, getDAOIO, getFilenameProvider, getInitCount, getLastFilename, getLastInitDateTime, getLastReadDateTime, getLastWriteDateTime, getReadCount, getSafeFile, getWriteCount, getXMLWriterSettings, initialRead, markAsChanged, modifyWriteData, onInit, triggerExceptionHandlersRead, triggerExceptionHandlersWrite, writeToFileOnPendingChangesbeginWithoutAutoSave, endWithoutAutoSave, getExceptionHandlersRead, getExceptionHandlersWrite, hasPendingChanges, internalHasPendingChanges, internalIsAutoSaveEnabled, internalSetPendingChanges, isAutoSaveEnabled, performWithoutAutoSave, performWithoutAutoSave, performWithoutAutoSave, performWithoutAutoSavepublic static final String ELEMENT_ITEMS
public static final String ELEMENT_ITEM
public static final String ATTR_DT_STRING
public static final String ATTR_USER
public static final String ATTR_TYPE
public static final String ATTR_SUCCESS
public AuditManager(@Nullable String sBaseDir, @Nonnull ICurrentUserIDProvider aUserIDProvider) throws DAOException
sBaseDir - The base directory, relative to the default IO base directory. May
be null to indicate an in-memory auditor only.aUserIDProvider - The current user ID provider. May not be null.DAOException - In case reading failed@Nonnull @Nonempty public static String getRelativeAuditFilename(@Nonnull org.joda.time.LocalDate aDate)
@Nonnull public AsynchronousAuditor getAuditor()
getAuditor in interface IAuditManagernull.public static void readFromXML(@Nonnull com.helger.commons.microdom.IMicroDocument aDoc, @Nonnull com.helger.photon.basic.security.audit.AuditManager.IReadHandler aHandler)
@Nonnull protected com.helger.commons.state.EChange onRead(@Nonnull com.helger.commons.microdom.IMicroDocument aDoc)
AbstractSimpleDAOonRead in class AbstractSimpleDAOaDoc - The XML document to read from. Never null.EChange.CHANGED if reading the data changed something in
the internal structures that requires a writing.protected com.helger.commons.microdom.IMicroDocument createWriteData()
AbstractSimpleDAOcreateWriteData in class AbstractSimpleDAOnull document to write to the file.protected void onFilenameChange(@Nullable String sPreviousFilename, @Nonnull String sNewFilename)
AbstractSimpleDAOonFilenameChange in class AbstractSimpleDAOsPreviousFilename - The previous filename. May be null.sNewFilename - The new filename. Never null.@Nonnegative public int getAuditItemCount()
@Nonnull @ReturnsMutableCopy public List<IAuditItem> getLastAuditItems(@Nonnegative int nMaxItems)
getLastAuditItems in interface IAuditManagernMaxItems - The maximum number of items. Must be > 0.null.public void stop()
IAuditManagerstop in interface IAuditManager@Nullable @ReturnsMutableCopy public List<IAuditItem> getAllAuditItemsOfDate(@Nonnull org.joda.time.LocalDate aDate)
public String toString()
toString in class AbstractSimpleDAOCopyright © 2014–2015 Philip Helger. All rights reserved.