org.alfresco.repo.audit
Class AuditServiceImpl

java.lang.Object
  extended by org.alfresco.repo.audit.AuditServiceImpl
All Implemented Interfaces:
AuditService

public class AuditServiceImpl
extends java.lang.Object
implements AuditService

The implementation of the AuditService for application auditing.

Since:
3.2

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.audit.AuditService
AuditService.AuditApplication, AuditService.AuditQueryCallback
 
Constructor Summary
AuditServiceImpl()
           
 
Method Summary
 void auditQuery(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults)
          Issue an audit query using the given parameters and consuming results in the callback.
 int clearAudit(java.util.List auditEntryIds)
          Delete a discrete list of audit entries.
 int clearAudit(java.lang.String applicationName)
          Remove all audit entries for the given application
 int clearAudit(java.lang.String applicationName, java.lang.Long fromTime, java.lang.Long toTime)
          Remove audit entries for the given application between the time ranges.
 void disableAudit(java.lang.String applicationName, java.lang.String path)
          Disable auditing for an application path
 void enableAudit(java.lang.String applicationName, java.lang.String path)
          Enable auditing for an application path
 java.util.Map getAuditApplications()
          Get all registered audit applications
 boolean isAuditEnabled()
          
 boolean isAuditEnabled(java.lang.String applicationName, java.lang.String path)
          
 void setAuditComponent(AuditComponent auditComponent)
           
 void setAuditEnabled(boolean enable)
          Enable or disable the global auditing state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuditServiceImpl

public AuditServiceImpl()
Method Detail

setAuditComponent

public void setAuditComponent(AuditComponent auditComponent)

isAuditEnabled

public boolean isAuditEnabled()

Specified by:
isAuditEnabled in interface AuditService
Returns:
Returns true if auditing is globally enabled
Since:
3.4

setAuditEnabled

public void setAuditEnabled(boolean enable)
Enable or disable the global auditing state

Specified by:
setAuditEnabled in interface AuditService
Parameters:
enable - true to enable auditing globally or false to disable
Since:
3.4

getAuditApplications

public java.util.Map getAuditApplications()
Get all registered audit applications

Specified by:
getAuditApplications in interface AuditService
Returns:
Returns a map of audit applications keyed by their name
Since:
3.4

isAuditEnabled

public boolean isAuditEnabled(java.lang.String applicationName,
                              java.lang.String path)

Specified by:
isAuditEnabled in interface AuditService
Parameters:
applicationName - the name of the application to check
path - the path to check
Returns:
Returns true if auditing is enabled for the given path
Since:
3.2

enableAudit

public void enableAudit(java.lang.String applicationName,
                        java.lang.String path)
Enable auditing for an application path

Specified by:
enableAudit in interface AuditService
Parameters:
applicationName - the name of the application to check
path - the path to enable
Since:
3.2

disableAudit

public void disableAudit(java.lang.String applicationName,
                         java.lang.String path)
Disable auditing for an application path

Specified by:
disableAudit in interface AuditService
Parameters:
applicationName - the name of the application to check
path - the path to disable
Since:
3.2

clearAudit

public int clearAudit(java.lang.String applicationName)
Remove all audit entries for the given application

Specified by:
clearAudit in interface AuditService
Parameters:
applicationName - the name of the application for which to remove entries
Returns:
Returns the number of audit entries deleted
Since:
3.2

clearAudit

public int clearAudit(java.lang.String applicationName,
                      java.lang.Long fromTime,
                      java.lang.Long toTime)
Remove audit entries for the given application between the time ranges. If no start time is given then entries are deleted as far back as they exist. If no end time is given then entries are deleted up until the current time.

Specified by:
clearAudit in interface AuditService
Parameters:
applicationName - the name of the application for which to remove entries
fromTime - the start time of entries to remove (inclusive and optional)
toTime - the end time of entries to remove (exclusive and optional)
Returns:
Returns the number of audit entries deleted
Since:
3.4

clearAudit

public int clearAudit(java.util.List auditEntryIds)
Delete a discrete list of audit entries.

This method should not be called while processing query results.

Specified by:
clearAudit in interface AuditService
Parameters:
auditEntryIds - the IDs of all audit entries to delete
Returns:
Returns the number of audit entries deleted
Since:
3.4

auditQuery

public void auditQuery(AuditService.AuditQueryCallback callback,
                       AuditQueryParameters parameters,
                       int maxResults)
Issue an audit query using the given parameters and consuming results in the callback. Results are returned in entry order, corresponding to time order.

Specified by:
auditQuery in interface AuditService
Parameters:
callback - the callback that will handle results
parameters - the parameters for the query (may not be null)
maxResults - the maximum number of results to retrieve (zero or negative to ignore)
Since:
3.3


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.