# Class CommitLogFilter

java.lang.Object
org.apache.cayenne.commitlog.CommitLogFilter

All Implemented Interfaces:
  `DataChannelSyncFilter`

public class CommitLogFilter extends Object implements DataChannelSyncFilter
A `DataChannelSyncFilter` that captures commit changes, delegating their processing to an underlying collection of listeners.

Since:
  4.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CommitLogFilter(CommitLogEntityFactory entityFactory, List<CommitLogListener> listeners)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `GraphDiff`
  `onSync(ObjectContext originatingContext, GraphDiff beforeDiff, int syncType, DataChannelSyncFilterChain filterChain)`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CommitLogFilter

    public CommitLogFilter(CommitLogEntityFactory entityFactory, List<CommitLogListener> listeners)

- ## Method Details

  - ### onSync

    public GraphDiff onSync(ObjectContext originatingContext, GraphDiff beforeDiff, int syncType, DataChannelSyncFilterChain filterChain)
    Specified by:
      `onSync` in interface `DataChannelSyncFilter`
    Parameters:
      `originatingContext` - originating context of changes
      `beforeDiff` - diff that is being processed
      `syncType` - type of sync; possible values: `DataChannel.FLUSH_NOCASCADE_SYNC`, `DataChannel.FLUSH_CASCADE_SYNC`, `DataChannel.ROLLBACK_CASCADE_SYNC`
      `filterChain` - chain of sync filters to invoke after this filter
    Returns:
      final context diff
    See Also:
      - `DataChannel.FLUSH_NOCASCADE_SYNC`
      - `DataChannel.FLUSH_CASCADE_SYNC`
      - `DataChannel.ROLLBACK_CASCADE_SYNC`