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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.audit.AuditService
AuditService.AuditQueryCallback
 
Constructor Summary
AuditServiceImpl()
           
 
Method Summary
 void audit(java.lang.String source, java.lang.String description)
          Add an application audit entry.
 void audit(java.lang.String source, java.lang.String description, NodeRef key)
           
 void audit(java.lang.String source, java.lang.String description, NodeRef key, java.lang.Object[] args)
           
 void audit(java.lang.String source, java.lang.String description, java.lang.Object[] args)
           
 void auditQuery(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults)
          Issue an audit query using the given parameters and consuming results in the callback.
 void auditQuery(AuditService.AuditQueryCallback callback, boolean forward, java.lang.String applicationName, java.lang.String user, java.lang.Long from, java.lang.Long to, int maxResults)
          Get the audit entries that match the given criteria.
 void auditQuery(AuditService.AuditQueryCallback callback, boolean forward, java.lang.String applicationName, java.lang.String user, java.lang.Long from, java.lang.Long to, java.lang.String searchKey, java.io.Serializable searchValue, int maxResults)
          Get the audit entries that match the given criteria.
 void clearAudit(java.lang.String applicationName)
          Remove all audit entries for the given application
 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.List getAuditTrail(NodeRef nodeRef)
          Get the audit trail for a node ref.
 boolean isAuditEnabled(java.lang.String applicationName, java.lang.String path)
          
static void main(java.lang.String[] args)
           
 void setAuditComponent(AuditComponent auditComponent)
           
 
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)

audit

public void audit(java.lang.String source,
                  java.lang.String description)
Description copied from interface: AuditService
Add an application audit entry.

Specified by:
audit in interface AuditService
Parameters:
source - - a string that represents the application
description - - the audit entry

audit

public void audit(java.lang.String source,
                  java.lang.String description,
                  NodeRef key)
Specified by:
audit in interface AuditService
Parameters:
source - - a string that represents the application
description - - the audit entry
key - - a node ref to use as the key for filtering etc

audit

public void audit(java.lang.String source,
                  java.lang.String description,
                  java.lang.Object[] args)
Specified by:
audit in interface AuditService
Parameters:
source - - a string that represents the application
description - - the audit entry
args - - an arbitrary list of parameters

audit

public void audit(java.lang.String source,
                  java.lang.String description,
                  NodeRef key,
                  java.lang.Object[] args)
Specified by:
audit in interface AuditService
Parameters:
source - - a string that represents the application
description - - the audit entry *
key - - a node ref to use as the key for filtering etc
args - - an arbitrary list of parameters

getAuditTrail

public java.util.List getAuditTrail(NodeRef nodeRef)
Description copied from interface: AuditService
Get the audit trail for a node ref.

Specified by:
getAuditTrail in interface AuditService
Parameters:
nodeRef - - the node ref for which to get the audit trail.
Returns:
- tha audit trail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

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 void 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
Since:
3.2

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.

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

auditQuery

public void auditQuery(AuditService.AuditQueryCallback callback,
                       boolean forward,
                       java.lang.String applicationName,
                       java.lang.String user,
                       java.lang.Long from,
                       java.lang.Long to,
                       int maxResults)
Get the audit entries that match the given criteria.

Specified by:
auditQuery in interface AuditService
Parameters:
callback - the callback that will handle results
forward - true for results to ordered from first to last, or false to order from last to first
applicationName - if not null, find entries logged against this application
user - if not null, find entries logged against this user
from - the start search time (null to start at the beginning)
to - the end search time (null for no limit)
maxResults - the maximum number of results to retrieve (zero or negative to ignore)
Since:
3.2

auditQuery

public void auditQuery(AuditService.AuditQueryCallback callback,
                       boolean forward,
                       java.lang.String applicationName,
                       java.lang.String user,
                       java.lang.Long from,
                       java.lang.Long to,
                       java.lang.String searchKey,
                       java.io.Serializable searchValue,
                       int maxResults)
Get the audit entries that match the given criteria.

Specified by:
auditQuery in interface AuditService
Parameters:
callback - the callback that will handle results
forward - true for results to ordered from first to last, or false to order from last to first
applicationName - if not null, find entries logged against this application
user - if not null, find entries logged against this user
from - the start search time (null to start at the beginning)
to - the end search time (null for no limit)
searchKey - the audit key path that must exist (null to ignore)
searchValue - an audit value that must exist (null to ignore)
maxResults - the maximum number of results to retrieve (zero or negative to ignore)
Since:
3.2


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