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 Stringprotected static final Stringprotected static final Stringprotected CapabilityServiceprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected HoldServiceprotected PermissionServiceprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauditEvent(NodeRef nodeRef, String eventName) Audits an event, assumes no properties where modified and that the event should not be audited immediately.voidauditEvent(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.voidauditEvent(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.voidauditEvent(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after, boolean immediate, boolean removeIfNoPropertyChanged) Audit event.voidauditOrUpdateEvent(NodeRef nodeRef, String eventName, Map<QName, Serializable> before, Map<QName, Serializable> after, boolean removeIfNoPropertyChanged) Supply incremental changes as part of an event.voidauditRMAction(RecordsManagementAction action, NodeRef nodeRef, Map<String, Serializable> parameters) Deprecated.since 2.1voidclear()Deprecated.voidclearAuditLog(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 voidgetAuditTrailImpl(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 DategetStartOfDay(Date date) Calculates the start of the given date.voidinit()Checks that all necessary properties have been set.booleanisAuditLogEnabled(NodeRef filePlan) Determines whether the RM audit log is currently enabled.booleanDeprecated.protected voidonBootstrap(org.springframework.context.ApplicationEvent event) protected voidonShutdown(org.springframework.context.ApplicationEvent event) voidregisterAuditEvent(String name, String label) Register audit event.voidregisterAuditEvent(AuditEvent auditEvent) Register audit event.voidsetAuditComponent(AuditComponent auditComponent) The component to create audit eventsvoidsetAuditService(AuditService auditService) Sets the AuditService instancevoidsetCapabilityService(CapabilityService capabilityService) voidsetContentService(ContentService contentService) Sets the ContentService instancevoidsetDictionaryService(DictionaryService dictionaryService) Provides user-readable names for typesvoidsetFilePlanService(FilePlanService filePlanService) voidsetHoldService(HoldService holdService) voidsetIgnoredAuditProperties(List<String> ignoredAuditProperties) voidsetNamespaceService(NamespaceService namespaceService) voidsetNodeService(NodeService nodeService) Sets the NodeService instancevoidsetPermissionService(PermissionService permissionService) voidsetPolicyComponent(PolicyComponent policyComponent) Set the component used to bind to behaviour callbacksvoidsetRecordsManagementActionService(RecordsManagementActionService rmActionService) Sets the RecordsManagementActionService instancevoidsetSiteService(SiteService siteService) Set the site service (used to check the type of RM site created).voidsetTransactionService(TransactionService transactionService) Set the component used to start new transactionsvoidstart()Deprecated.voidstartAuditLog(NodeRef filePlan) Start RM auditing.voidstop()Deprecated.voidstopAuditLog(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:RecordsManagementAuditServiceRegister audit event.Creates an instance of a simple audit event and registers it with the service.
- Specified by:
registerAuditEventin interfaceRecordsManagementAuditService- Parameters:
name- name of audit eventlabel- display label of audit event- See Also:
-
registerAuditEvent
Description copied from interface:RecordsManagementAuditServiceRegister audit event.- Specified by:
registerAuditEventin 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:
onBootstrapin 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:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean- See Also:
-
AbstractLifecycleBean.onShutdown(org.springframework.context.ApplicationEvent)
-
isAuditLogEnabled
Description copied from interface:RecordsManagementAuditServiceDetermines whether the RM audit log is currently enabled.- Specified by:
isAuditLogEnabledin interfaceRecordsManagementAuditService- Parameters:
filePlan- file plan- Returns:
- true if RM auditing is active false otherwise
- See Also:
-
startAuditLog
Description copied from interface:RecordsManagementAuditServiceStart RM auditing.- Specified by:
startAuditLogin interfaceRecordsManagementAuditService- Parameters:
filePlan- file plan- See Also:
-
stopAuditLog
Description copied from interface:RecordsManagementAuditServiceStop RM auditing.- Specified by:
stopAuditLogin interfaceRecordsManagementAuditService- Parameters:
filePlan- file plan- See Also:
-
clearAuditLog
Description copied from interface:RecordsManagementAuditServiceClears the RM audit.- Specified by:
clearAuditLogin interfaceRecordsManagementAuditService- Parameters:
filePlan- file plan- See Also:
-
getDateAuditLogLastStarted
Returns the date the RM audit was last started.- Specified by:
getDateAuditLogLastStartedin interfaceRecordsManagementAuditService- Parameters:
filePlan- file plan- Returns:
- Date the audit was last started
-
getDateAuditLogLastStopped
Description copied from interface:RecordsManagementAuditServiceReturns the date the RM audit was last stopped.- Specified by:
getDateAuditLogLastStoppedin interfaceRecordsManagementAuditService- Returns:
- Date the audit was last stopped
- See Also:
-
auditEvent
Description copied from interface:RecordsManagementAuditServiceAudits an event, assumes no properties where modified and that the event should not be audited immediately.- Specified by:
auditEventin 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:RecordsManagementAuditServiceAudits an event, assumes that the event should not be audited immediately and not be removed if no property is changed.- Specified by:
auditEventin 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:RecordsManagementAuditServiceAudit event, assumes not to be removed if no property is changed.- Specified by:
auditEventin 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:RecordsManagementAuditServiceAudit event.- Specified by:
auditEventin 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:
auditOrUpdateEventin 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:
getAuditTrailFilein 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:
getAuditTrailin 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:
fileAuditTrailAsRecordin 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:
getAuditEventsin interfaceRecordsManagementAuditService- Returns:
- List of audit events
-
isEnabled
Deprecated.- Specified by:
isEnabledin interfaceRecordsManagementAuditServiceDeprecated
-
start
Deprecated.usestartAuditLog(NodeRef)instead -
stop
Deprecated.- Specified by:
stopin interfaceRecordsManagementAuditServiceDeprecated
-
getDateLastStarted
Deprecated.- Specified by:
getDateLastStartedin interfaceRecordsManagementAuditServiceDeprecated
-
getDateLastStopped
Deprecated.- Specified by:
getDateLastStoppedin interfaceRecordsManagementAuditServiceDeprecated
-
clear
Deprecated.- Specified by:
clearin interfaceRecordsManagementAuditServiceDeprecated
-
auditRMAction
@Deprecated public void auditRMAction(RecordsManagementAction action, NodeRef nodeRef, Map<String, Serializable> parameters) Deprecated.since 2.1- Specified by:
auditRMActionin interfaceRecordsManagementAuditServiceDeprecated- Since:
- 3.2
-