public class AuditableFilter extends Object implements DataChannelFilter
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.| Modifier and Type | Field and Description |
|---|---|
protected EntityResolver |
entityResolver |
protected AuditableProcessor |
processor |
| Constructor and Description |
|---|
AuditableFilter(EntityResolver entityResolver,
AuditableProcessor processor) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanupPostSync()
A method called at the end of every
onSync(ObjectContext, GraphDiff, int, DataChannelFilterChain) invocation. |
protected Object |
getParent(Object 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) |
protected AuditableProcessor processor
protected EntityResolver entityResolver
public AuditableFilter(EntityResolver entityResolver, AuditableProcessor processor)
public void init(DataChannel channel)
init in interface DataChannelFilterpublic QueryResponse onQuery(ObjectContext originatingContext, Query query, DataChannelFilterChain filterChain)
onQuery in interface DataChannelFilterpublic GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelFilterChain filterChain)
onSync in interface DataChannelFilterprotected void cleanupPostSync()
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.protected boolean isAuditableUpdate(Object object, boolean child)
Copyright © 2001–2014 Apache Cayenne. All rights reserved.