[ 
https://issues.apache.org/jira/browse/CAY-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14951058#comment-14951058
 ] 

ASF GitHub Bot commented on CAY-2030:
-------------------------------------

Github user andrus closed the pull request at:

    https://github.com/apache/cayenne/pull/75


> Capturing a stream of commit changes
> ------------------------------------
>
>                 Key: CAY-2030
>                 URL: https://issues.apache.org/jira/browse/CAY-2030
>             Project: Cayenne
>          Issue Type: Task
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>
> Per http://www.mail-archive.com/dev@cayenne.apache.org/msg07968.html trying 
> to implement a proper transaction audit. After some thought, I think it 
> should work as follows:
> 0. A new object design for change tracking: ChangeMap/ ObjectChange / 
> ObjectPropertyChange
> 1. PostCommitFilter : A filter that captures all changes before and after the 
> commit (including generated PKs returned from DB) and generates a ChangeMap. 
> Will notify the listeners after the commit. 
> 2. A Module that registers the filter (once  CAY-2028 is done, the module 
> should also take care of ordering the filter to go inside transaction).
> 3. Listener interface (TODO: eventually switch to annotations?)
> {noformat}public interface PostCommitListener {
>       void onPostCommit(ObjectContext originatingContext, ChangeMap changes);
> }
> {noformat}
> 4. PostCommitModuleBuilder  to add post commit extensions.
> 5. Listeners will be added via PostCommitModuleBuilder. TODO: combine with 
> our normal  listeners and switch to annotations.
> 6. For per-entity filtering and further customization reuse @Auditable 
> annotation . Add "confidential" property to @Auditable to allow to securely 
> log changes for properties like passwords, etc.
> (since most people would want to run this filter within a TX, an effective 
> usage of this is dependent on CAY-2028; however the implementation is not)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to