public class AuditManager extends Object implements IAuditManager
Modifier and Type | Class and Description |
---|---|
static class |
AuditManager.AuditType
Enum of audit types used by audit actions taken.
|
QUERY_CACHE_REGION
Constructor and Description |
---|
AuditManager() |
Modifier and Type | Method and Description |
---|---|
void |
audit(String title,
String description,
String typeKey)
Register an audit entry.
|
lumis.portal.audit.AuditEntry |
audit(String title,
String description,
String typeKey,
boolean registerChilds,
ITransaction t)
Starts an operation for audit and add register an observer to the
transaction in order to end the operation.
|
lumis.portal.audit.AuditEntry |
beginAudit(String title,
String description,
String typeKey,
boolean registerChilds)
Starts an operation for audit.
|
boolean |
clearContextThreadData()
Clears the
AuditContext thread data. |
void |
disableType(String auditEntryTypeId)
Disable the
AuditEntryType by it's id. |
void |
enableType(String auditEntryTypeId)
Enable the
AuditEntryType by it's id. |
void |
endAudit(lumis.portal.audit.AuditEntry auditEntry)
Ends the AuditEntry operation.
|
protected void |
endContext(lumis.portal.audit.AuditEntry auditEntry)
End the audit context.
|
protected AuditCategory |
findCategoryById(String categoryId)
Find the category by it's id.
|
protected AuditCategory |
findCategoryByKey(String categoryKey)
Find the AuditCategory by it's key.
|
protected AuditEntryType |
findEntryTypeByKey(String entryTypeKey)
Find the AuditEntryType by it's key.
|
protected void |
initContext(lumis.portal.audit.AuditEntry auditEntry,
boolean registerChilds)
Initializes the audit context.
|
protected lumis.portal.audit.AuditEntry |
initEntry(String userId,
String userLogin,
String title,
String description,
AuditEntryType type,
boolean registerChilds)
Creates an instance of AuditEntry.
|
protected void |
logEntry(lumis.portal.audit.AuditEntry auditEntry)
Log the audit entry.
|
AuditConfig |
obtainConfiguration()
Obtain the audit configuration.
|
protected void |
registerEntry(lumis.portal.audit.AuditEntry auditEntry,
AuditEntryState state)
Register the audit entry in database.
|
void |
removeOldEntries()
Remove audit entries older than the number of days specified by the
cleanInterval field in configuration.
|
void |
updateCleanInterval(int cleanInterval)
Updates the time interval to clean audit entries.
|
public void audit(String title, String description, String typeKey) throws PortalException
audit
in interface IAuditManager
title
- the operation title. If the title is bigger
than the allowed size, the string is truncated.description
- the operation description.typeKey
- the AuditEntryType key.PortalException
public lumis.portal.audit.AuditEntry audit(String title, String description, String typeKey, boolean registerChilds, ITransaction t) throws PortalException
title
- the operation title.description
- the operation description.categoryKey
- the AuditCategory key.typeKey
- the AuditEntryType key.registerChilds
- true if the child entries must be saved in
database, false otherwise.PortalException
public lumis.portal.audit.AuditEntry beginAudit(String title, String description, String typeKey, boolean registerChilds) throws PortalException
title
- the operation title.description
- the operation description.categoryKey
- the AuditCategory key.typeKey
- the AuditEntryType key.registerChilds
- true if the child entries must be saved in
database, false otherwise.PortalException
public void endAudit(lumis.portal.audit.AuditEntry auditEntry) throws PortalException
auditEntry
- the AuditEntry instance.PortalException
public void enableType(String auditEntryTypeId) throws PortalException
AuditEntryType
by it's id.auditEntryTypeId
- the type id.AccessDeniedException
- if the user has not permission to use
management functions.PortalException
public void disableType(String auditEntryTypeId) throws PortalException
AuditEntryType
by it's id.auditEntryTypeId
- the type id.AccessDeniedException
- if the user has not permission to use
management functions.PortalException
public void removeOldEntries() throws PortalException
PortalException
public void updateCleanInterval(int cleanInterval) throws PortalException
cleanInterval
- the new value for time interval in
days.AccessDeniedException
- if the user has not permission to use
management functions.PortalException
- if an error occur updating the time
interval.public AuditConfig obtainConfiguration() throws PortalException
AuditConfig
.PortalException
- if an error occur retrieving the configuration.public boolean clearContextThreadData()
AuditContext
thread
data.true
if there was data to be cleared or false
if the thread data was already clear.protected lumis.portal.audit.AuditEntry initEntry(String userId, String userLogin, String title, String description, AuditEntryType type, boolean registerChilds)
user
- user.title
- a title for the operation being audited.
If the title is bigger than the allowed, a
substring is created.description
- a description for the operation.type
- the AuditEntryType instance.registerChilds
- true if the child entries must be saved in
database, false otherwise.protected AuditCategory findCategoryByKey(String categoryKey) throws PortalException
categoryKey
- the audit category key.PortalException
- if an error occur in audit category dao.protected AuditCategory findCategoryById(String categoryId) throws PortalException
categoryId
- the category id.PortalException
protected AuditEntryType findEntryTypeByKey(String entryTypeKey) throws PortalException
entryTypeKey
- the audit entry type key.PortalException
- if an error occur in audit entry type dao.protected void initContext(lumis.portal.audit.AuditEntry auditEntry, boolean registerChilds)
auditEntry
- the AuditEntry instance.registerChilds
- true if the child entries must be saved in
database, false otherwise.protected void endContext(lumis.portal.audit.AuditEntry auditEntry)
auditEntry
- the AuditEntry instance.protected void logEntry(lumis.portal.audit.AuditEntry auditEntry)
auditEntry
- the AuditEntry instance.protected void registerEntry(lumis.portal.audit.AuditEntry auditEntry, AuditEntryState state) throws PortalException
auditEntry
- the AuditEntry instance.state
- the state of audit entry.PortalException
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.