org.apache.cayenne.lifecycle.audit
Class AuditableFilter

java.lang.Object
  extended by org.apache.cayenne.lifecycle.audit.AuditableFilter
All Implemented Interfaces:
DataChannelFilter

public class AuditableFilter
extends Object
implements DataChannelFilter

A DataChannelFilter that enables audit of entities annotated with Auditable and AuditableChild. Note that this filter relies on ChangeSetFilter presence in the DataDomain filter chain to be able to analyze ignored properties.

Since:
3.1

Field Summary
protected  EntityResolver entityResolver
           
protected  AuditableProcessor processor
           
 
Constructor Summary
AuditableFilter(EntityResolver entityResolver, AuditableProcessor processor)
           
 
Method Summary
protected  void cleanupPostSync()
          A method called at the end of every onSync(ObjectContext, GraphDiff, int, DataChannelFilterChain) invocation.
protected  Persistent getParent(Persistent object)
           
 void init(DataChannel channel)
           
protected  boolean isAuditableUpdate(Object object, boolean child)
           
 QueryResponse onQuery(ObjectContext originatingContext, Query query, DataChannelFilterChain filterChain)
           
 GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelFilterChain filterChain)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

processor

protected AuditableProcessor processor

entityResolver

protected EntityResolver entityResolver
Constructor Detail

AuditableFilter

public AuditableFilter(EntityResolver entityResolver,
                       AuditableProcessor processor)
Method Detail

init

public void init(DataChannel channel)
Specified by:
init in interface DataChannelFilter

onQuery

public QueryResponse onQuery(ObjectContext originatingContext,
                             Query query,
                             DataChannelFilterChain filterChain)
Specified by:
onQuery in interface DataChannelFilter

onSync

public GraphDiff onSync(ObjectContext originatingContext,
                        GraphDiff changes,
                        int syncType,
                        DataChannelFilterChain filterChain)
Specified by:
onSync in interface DataChannelFilter

cleanupPostSync

protected void cleanupPostSync()
A method called at the end of every onSync(ObjectContext, GraphDiff, int, DataChannelFilterChain) invocation. This implementation uses it for cleaning up thread-local state of the filter. Subclasses may override it to do their own cleanup, and are expected to call super.


getParent

protected Persistent getParent(Persistent object)

isAuditableUpdate

protected boolean isAuditableUpdate(Object object,
                                    boolean child)


Copyright © 2001-2013 Apache Cayenne. All Rights Reserved.