Class RecordsManagementAuditServiceImpl
- All Implemented Interfaces:
EventListener
,RecordsManagementAuditService
,RecordsManagementAuditServiceDeprecated
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationListener
- Since:
- 3.2
- Author:
- Gavin Cornwell
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService
RecordsManagementAuditService.ReportFormat
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected CapabilityService
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected HoldService
protected PermissionService
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
auditEvent
(NodeRef nodeRef, String eventName) Audits an event, assumes no properties where modified and that the event should not be audited immediately.void
auditEvent
(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after) Audits an event, assumes that the event should not be audited immediately and not be removed if no property is changed.void
auditEvent
(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after, boolean immediate) Audit event, assumes not to be removed if no property is changed.void
auditEvent
(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after, boolean immediate, boolean removeIfNoPropertyChanged) Audit event.void
auditOrUpdateEvent
(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after, boolean removeIfNoPropertyChanged) Supply incremental changes as part of an event.void
auditRMAction
(RecordsManagementAction action, NodeRef nodeRef, Map<String, Serializable> parameters) Deprecated.since 2.1void
clear()
Deprecated.void
clearAuditLog
(NodeRef filePlan) Clears the RM audit.fileAuditTrailAsRecord
(RecordsManagementAuditQueryParameters params, NodeRef destination, RecordsManagementAuditService.ReportFormat format) Retrieves a list of audit log entries using the provided parameters represented by the RecordsManagementAuditQueryParameters instance and then files the resulting log as an undeclared record in the record folder represented by the given NodeRef.Retrieves a list of audit events.Retrieves a list of audit log entries using the provided parameters represented by the RecordsManagementAuditQueryParameters instance.getAuditTrailFile
(RecordsManagementAuditQueryParameters params, RecordsManagementAuditService.ReportFormat format) Retrieves a list of audit log entries using the provided parameters represented by the RecordsManagementAuditQueryParameters instance.protected void
getAuditTrailImpl
(RecordsManagementAuditQueryParameters params, List<RecordsManagementAuditEntry> results, Writer writer, RecordsManagementAuditService.ReportFormat reportFormat) Get the audit trail, optionally dumping the results the the given writer dumping to a list.getDateAuditLogLastStarted
(NodeRef filePlan) Returns the date the RM audit was last started.getDateAuditLogLastStopped
(NodeRef filePlan) Returns the date the RM audit was last stopped.Deprecated.Deprecated.protected Date
getStartOfDay
(Date date) Calculates the start of the given date.void
init()
Checks that all necessary properties have been set.boolean
isAuditLogEnabled
(NodeRef filePlan) Determines whether the RM audit log is currently enabled.boolean
Deprecated.protected void
onBootstrap
(org.springframework.context.ApplicationEvent event) protected void
onShutdown
(org.springframework.context.ApplicationEvent event) void
registerAuditEvent
(String name, String label) Register audit event.void
registerAuditEvent
(AuditEvent auditEvent) Register audit event.void
setAuditComponent
(AuditComponent auditComponent) The component to create audit eventsvoid
setAuditService
(AuditService auditService) Sets the AuditService instancevoid
setCapabilityService
(CapabilityService capabilityService) void
setContentService
(ContentService contentService) Sets the ContentService instancevoid
setDictionaryService
(DictionaryService dictionaryService) Provides user-readable names for typesvoid
setFilePlanService
(FilePlanService filePlanService) void
setHoldService
(HoldService holdService) void
setIgnoredAuditProperties
(List<String> ignoredAuditProperties) void
setNamespaceService
(NamespaceService namespaceService) void
setNodeService
(NodeService nodeService) Sets the NodeService instancevoid
setPermissionService
(PermissionService permissionService) void
setPolicyComponent
(PolicyComponent policyComponent) Set the component used to bind to behaviour callbacksvoid
setRecordsManagementActionService
(RecordsManagementActionService rmActionService) Sets the RecordsManagementActionService instancevoid
setSiteService
(SiteService siteService) Set the site service (used to check the type of RM site created).void
setTransactionService
(TransactionService transactionService) Set the component used to start new transactionsvoid
start()
Deprecated.void
startAuditLog
(NodeRef filePlan) Start RM auditing.void
stop()
Deprecated.void
stopAuditLog
(NodeRef filePlan) Stop RM auditing.Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContext
-
Field Details
-
RM_AUDIT_EVENT_LOGIN_SUCCESS
- See Also:
-
RM_AUDIT_EVENT_LOGIN_FAILURE
- See Also:
-
RM_AUDIT_APPLICATION_NAME
- See Also:
-
RM_AUDIT_PATH_ROOT
- See Also:
-
RM_AUDIT_SNIPPET_EVENT
- See Also:
-
RM_AUDIT_SNIPPET_PERSON
- See Also:
-
RM_AUDIT_SNIPPET_NAME
- See Also:
-
RM_AUDIT_SNIPPET_NODE
- See Also:
-
RM_AUDIT_SNIPPET_CHANGES
- See Also:
-
RM_AUDIT_SNIPPET_BEFORE
- See Also:
-
RM_AUDIT_SNIPPET_AFTER
- See Also:
-
RM_AUDIT_SITES_PATH
- See Also:
-
RM_AUDIT_DATA_PERSON_FULLNAME
- See Also:
-
RM_AUDIT_DATA_PERSON_ROLES
- See Also:
-
RM_AUDIT_DATA_EVENT_NAME
- See Also:
-
RM_AUDIT_DATA_NODE_NODEREF
- See Also:
-
RM_AUDIT_DATA_NODE_NAME
- See Also:
-
RM_AUDIT_DATA_NODE_TYPE
- See Also:
-
RM_AUDIT_DATA_NODE_IDENTIFIER
- See Also:
-
RM_AUDIT_DATA_NODE_NAMEPATH
- See Also:
-
RM_AUDIT_DATA_NODE_CHANGES_BEFORE
- See Also:
-
RM_AUDIT_DATA_NODE_CHANGES_AFTER
- See Also:
-
RM_AUDIT_DATA_LOGIN_USERNAME
- See Also:
-
RM_AUDIT_DATA_LOGIN_FULLNAME
- See Also:
-
RM_AUDIT_DATA_LOGIN_ERROR
- See Also:
-
DOD5015_AUDIT_APPLICATION_NAME
- See Also:
-
DOD5015_AUDIT_PATH_ROOT
- See Also:
-
DOD5015_AUDIT_SNIPPET_EVENT
- See Also:
-
DOD5015_AUDIT_SNIPPET_PERSON
- See Also:
-
DOD5015_AUDIT_SNIPPET_NAME
- See Also:
-
DOD5015_AUDIT_SNIPPET_NODE
- See Also:
-
DOD5015_AUDIT_SNIPPET_CHANGES
- See Also:
-
DOD5015_AUDIT_SNIPPET_BEFORE
- See Also:
-
DOD5015_AUDIT_SNIPPET_AFTER
- See Also:
-
DOD5015_AUDIT_DATA_PERSON_FULLNAME
- See Also:
-
DOD5015_AUDIT_DATA_PERSON_ROLES
- See Also:
-
DOD5015_AUDIT_DATA_EVENT_NAME
- See Also:
-
DOD5015_AUDIT_DATA_NODE_NODEREF
- See Also:
-
DOD5015_AUDIT_DATA_NODE_NAME
- See Also:
-
DOD5015_AUDIT_DATA_NODE_TYPE
- See Also:
-
DOD5015_AUDIT_DATA_NODE_IDENTIFIER
- See Also:
-
DOD5015_AUDIT_DATA_NODE_NAMEPATH
- See Also:
-
DOD5015_AUDIT_DATA_NODE_CHANGES_BEFORE
- See Also:
-
DOD5015_AUDIT_DATA_NODE_CHANGES_AFTER
- See Also:
-
DOD5015_AUDIT_DATA_LOGIN_USERNAME
- See Also:
-
DOD5015_AUDIT_DATA_LOGIN_FULLNAME
- See Also:
-
DOD5015_AUDIT_DATA_LOGIN_ERROR
- See Also:
-
AUDIT_TRAIL_FILE_PREFIX
- See Also:
-
AUDIT_TRAIL_JSON_FILE_SUFFIX
- See Also:
-
AUDIT_TRAIL_HTML_FILE_SUFFIX
- See Also:
-
capabilityService
-
permissionService
-
holdService
-
-
Constructor Details
-
RecordsManagementAuditServiceImpl
public RecordsManagementAuditServiceImpl()
-
-
Method Details
-
setPolicyComponent
Set the component used to bind to behaviour callbacks -
setDictionaryService
Provides user-readable names for types -
setTransactionService
Set the component used to start new transactions -
setNodeService
Sets the NodeService instance -
setSiteService
Set the site service (used to check the type of RM site created).- Parameters:
siteService
- The site service.
-
setContentService
Sets the ContentService instance -
setAuditComponent
The component to create audit events -
setAuditService
Sets the AuditService instance -
setRecordsManagementActionService
Sets the RecordsManagementActionService instance -
setFilePlanService
- Parameters:
filePlanService
- file plan service
-
setNamespaceService
- Parameters:
namespaceService
- namespace service
-
setCapabilityService
- Parameters:
capabilityService
- capability service
-
setIgnoredAuditProperties
- Parameters:
ignoredAuditProperties
-
-
setPermissionService
- Parameters:
permissionService
-
-
setHoldService
- Parameters:
holdService
-
-
registerAuditEvent
Description copied from interface:RecordsManagementAuditService
Register audit event.Creates an instance of a simple audit event and registers it with the service.
- Specified by:
registerAuditEvent
in interfaceRecordsManagementAuditService
- Parameters:
name
- name of audit eventlabel
- display label of audit event- See Also:
-
registerAuditEvent
Description copied from interface:RecordsManagementAuditService
Register audit event.- Specified by:
registerAuditEvent
in interfaceRecordsManagementAuditService
- Parameters:
auditEvent
- audit event- See Also:
-
init
public void init()Checks that all necessary properties have been set. -
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event) - Specified by:
onBootstrap
in classorg.springframework.extensions.surf.util.AbstractLifecycleBean
- See Also:
-
AbstractLifecycleBean.onBootstrap(org.springframework.context.ApplicationEvent)
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event) - Specified by:
onShutdown
in classorg.springframework.extensions.surf.util.AbstractLifecycleBean
- See Also:
-
AbstractLifecycleBean.onShutdown(org.springframework.context.ApplicationEvent)
-
isAuditLogEnabled
Description copied from interface:RecordsManagementAuditService
Determines whether the RM audit log is currently enabled.- Specified by:
isAuditLogEnabled
in interfaceRecordsManagementAuditService
- Parameters:
filePlan
- file plan- Returns:
- true if RM auditing is active false otherwise
- See Also:
-
startAuditLog
Description copied from interface:RecordsManagementAuditService
Start RM auditing.- Specified by:
startAuditLog
in interfaceRecordsManagementAuditService
- Parameters:
filePlan
- file plan- See Also:
-
stopAuditLog
Description copied from interface:RecordsManagementAuditService
Stop RM auditing.- Specified by:
stopAuditLog
in interfaceRecordsManagementAuditService
- Parameters:
filePlan
- file plan- See Also:
-
clearAuditLog
Description copied from interface:RecordsManagementAuditService
Clears the RM audit.- Specified by:
clearAuditLog
in interfaceRecordsManagementAuditService
- Parameters:
filePlan
- file plan- See Also:
-
getDateAuditLogLastStarted
Returns the date the RM audit was last started.- Specified by:
getDateAuditLogLastStarted
in interfaceRecordsManagementAuditService
- Parameters:
filePlan
- file plan- Returns:
- Date the audit was last started
-
getDateAuditLogLastStopped
Description copied from interface:RecordsManagementAuditService
Returns the date the RM audit was last stopped.- Specified by:
getDateAuditLogLastStopped
in interfaceRecordsManagementAuditService
- Returns:
- Date the audit was last stopped
- See Also:
-
auditEvent
Description copied from interface:RecordsManagementAuditService
Audits an event, assumes no properties where modified and that the event should not be audited immediately.- Specified by:
auditEvent
in interfaceRecordsManagementAuditService
- Parameters:
nodeRef
- node referenceeventName
- event name- See Also:
-
auditEvent
public void auditEvent(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after) Description copied from interface:RecordsManagementAuditService
Audits an event, assumes that the event should not be audited immediately and not be removed if no property is changed.- Specified by:
auditEvent
in interfaceRecordsManagementAuditService
- Parameters:
nodeRef
- node referenceeventName
- event namebefore
- property values before event (this must be modifiable and may be changed by the method).after
- property values after event (this must be modifiable and may be changed by the method).- See Also:
-
auditEvent
public void auditEvent(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after, boolean immediate) Description copied from interface:RecordsManagementAuditService
Audit event, assumes not to be removed if no property is changed.- Specified by:
auditEvent
in interfaceRecordsManagementAuditService
- Parameters:
nodeRef
- node referenceeventName
- event namebefore
- property values before event (this must be modifiable and may be changed by the method).after
- property values after event (this must be modifiable and may be changed by the method).immediate
- true if event is to be audited immediately, false otherwise- See Also:
-
auditEvent
public void auditEvent(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after, boolean immediate, boolean removeIfNoPropertyChanged) Description copied from interface:RecordsManagementAuditService
Audit event.- Specified by:
auditEvent
in interfaceRecordsManagementAuditService
- Parameters:
nodeRef
- node referenceeventName
- event namebefore
- property values before event (this must be modifiable and may be changed by the method).after
- property values after event (this must be modifiable and may be changed by the method).immediate
- true if event is to be audited immediately, false otherwiseremoveIfNoPropertyChanged
- true if event is not audited when there are no properties changed, false otherwise- See Also:
-
auditOrUpdateEvent
public void auditOrUpdateEvent(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after, boolean removeIfNoPropertyChanged) Supply incremental changes as part of an event. This will either create a new event or update the existing details to put any supplied properties into the map.- Specified by:
auditOrUpdateEvent
in interfaceRecordsManagementAuditService
- Parameters:
nodeRef
- node referenceeventName
- event namebefore
- additional property values before event (this must be modifiable and may be changed by the method).after
- additional property values after event (this must be modifiable and may be changed by the method).removeIfNoPropertyChanged
- true if event is not audited when there are no properties changed, false otherwise
-
getAuditTrailFile
public File getAuditTrailFile(RecordsManagementAuditQueryParameters params, RecordsManagementAuditService.ReportFormat format) Retrieves a list of audit log entries using the provided parameters represented by the RecordsManagementAuditQueryParameters instance.The parameters are all optional so an empty RecordsManagementAuditQueryParameters object will result in ALL audit log entries for the RM system being returned. Setting the various parameters effectively filters the full audit trail.
- Specified by:
getAuditTrailFile
in interfaceRecordsManagementAuditService
- Parameters:
params
- Parameters to use to retrieve audit trail (never null)format
- The format the report should be produced in- Returns:
- File containing JSON representation of audit trail
-
getAuditTrail
public List<RecordsManagementAuditEntry> getAuditTrail(RecordsManagementAuditQueryParameters params) Retrieves a list of audit log entries using the provided parameters represented by the RecordsManagementAuditQueryParameters instance.The parameters are all optional so an empty RecordsManagementAuditQueryParameters object will result in ALL audit log entries for the RM system being returned. Setting the various parameters effectively filters the full audit trail.
- Specified by:
getAuditTrail
in interfaceRecordsManagementAuditService
- Parameters:
params
- Parameters to use to retrieve audit trail (never null)- Returns:
- All entries for the audit trail
-
getAuditTrailImpl
protected void getAuditTrailImpl(RecordsManagementAuditQueryParameters params, List<RecordsManagementAuditEntry> results, Writer writer, RecordsManagementAuditService.ReportFormat reportFormat) throws IOException Get the audit trail, optionally dumping the results the the given writer dumping to a list.- Parameters:
params
- the search parametersresults
- the list to which individual results will be dumpedwriter
- Writer to write the audit trailreportFormat
- Format to write the audit trail in, ignored if writer isnull
- Throws:
IOException
-
getStartOfDay
Calculates the start of the given date. For example, if you had the date time of 12 Aug 2013 12:10:15.158 the result would be 12 Aug 2013 00:00:00.000.- Parameters:
date
- The date for which the start should be calculated.- Returns:
- Returns the start of the given date.
-
fileAuditTrailAsRecord
public NodeRef fileAuditTrailAsRecord(RecordsManagementAuditQueryParameters params, NodeRef destination, RecordsManagementAuditService.ReportFormat format) Retrieves a list of audit log entries using the provided parameters represented by the RecordsManagementAuditQueryParameters instance and then files the resulting log as an undeclared record in the record folder represented by the given NodeRef.The parameters are all optional so an empty RecordsManagementAuditQueryParameters object will result in ALL audit log entries for the RM system being returned. Setting the various parameters effectively filters the full audit trail.
- Specified by:
fileAuditTrailAsRecord
in interfaceRecordsManagementAuditService
- Parameters:
params
- Parameters to use to retrieve audit trail (never null)destination
- NodeRef representing a record folder in which to file the audit logformat
- The format the report should be produced in- Returns:
- NodeRef of the undeclared record filed
-
getAuditEvents
Retrieves a list of audit events.- Specified by:
getAuditEvents
in interfaceRecordsManagementAuditService
- Returns:
- List of audit events
-
isEnabled
Deprecated.- Specified by:
isEnabled
in interfaceRecordsManagementAuditServiceDeprecated
-
start
Deprecated.usestartAuditLog(NodeRef)
instead -
stop
Deprecated.- Specified by:
stop
in interfaceRecordsManagementAuditServiceDeprecated
-
getDateLastStarted
Deprecated.- Specified by:
getDateLastStarted
in interfaceRecordsManagementAuditServiceDeprecated
-
getDateLastStopped
Deprecated.- Specified by:
getDateLastStopped
in interfaceRecordsManagementAuditServiceDeprecated
-
clear
Deprecated.- Specified by:
clear
in interfaceRecordsManagementAuditServiceDeprecated
-
auditRMAction
@Deprecated public void auditRMAction(RecordsManagementAction action, NodeRef nodeRef, Map<String, Serializable> parameters) Deprecated.since 2.1- Specified by:
auditRMAction
in interfaceRecordsManagementAuditServiceDeprecated
- Since:
- 3.2
-