cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugi Thordarson <h...@karlmenn.is>
Subject Re: Change audit framework
Date Tue, 29 Sep 2015 10:25:52 GMT
Looks great, can't wait to try it out :)

- hugi



> On 29. sep. 2015, at 09:46, Andrus Adamchik <andrus@objectstyle.org> wrote:
> 
> I just sent a pull request with the first cut of the implementation. My plan is to try
this new implementation with my audit system and if it works well, apply it to master (hopefully
by then CAY-2028 will also be ready). The implementation I ended up with does not have JSON
serialization. Just pure objects. Here is how it works:
> 
> 1. Write a listener (currently requires an interface, but if needed we can easily switch
to annotations) :
> 
> public class L implements PostCommitListener {
> 
>   @Override
>   public void onPostCommit(ObjectContext originatingContext, ChangeMap changes) {
>      // do something with your changes
>   }
> }
> 
> 2. Configure Cayenne stack with "PostCommit" module:
> 
> Module m = PostCommitModuleBuilder.builder().listener(L1.class);
> ServerRuntime r = ServerRuntimeBuilder
>   .builder()
>   .addConfig("cayenne-lifecycle.xml")
>   .addModule(m)
>   .build();
> 
> 
> PostCommitModuleBuilder supports a few non-default options, such as excluding entities,
entity properties, and hiding "confidential" property values, such as passwords using the
existing @Auditable annotation. Or you can write a custom PostCommitEntityFactory to support
your own annotations.
> 
> TODO: there is not support for @AuditableChild yet. Need to think how to better handle
this one.
> 
> Comments are welcomed.
> 
> Andrus


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message