@FunctionalInterface public interface DataChannelSyncFilter
Example:
public class MySyncFilter implements DataChannelSyncFilter {
public GraphDiff onSync(ObjectContext originatingContext,
GraphDiff changes,
int syncType,
DataChannelSyncFilterChain filterChain) {
System.out.println("Do something before sync");
// process changes or return some custom diff
GraphDiff diff = filterChain.onSync(originatingContext, changes, syncType);
System.out.println("Do something after sync");
return diff;
}
}
DataChannelQueryFilter
,
ServerModule.contributeDomainSyncFilters(org.apache.cayenne.di.Binder)
Modifier and Type | Method and Description |
---|---|
GraphDiff |
onSync(ObjectContext originatingContext,
GraphDiff changes,
int syncType,
DataChannelSyncFilterChain filterChain) |
GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelSyncFilterChain filterChain)
originatingContext
- originating context of changeschanges
- diff that is being processedsyncType
- 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 filterDataChannel.FLUSH_NOCASCADE_SYNC
,
DataChannel.FLUSH_CASCADE_SYNC
,
DataChannel.ROLLBACK_CASCADE_SYNC
Copyright © 2001–2019 Apache Cayenne. All rights reserved.