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 Wed, 23 Sep 2015 07:55:22 GMT
This looks really great! Would you mind sharing how the class A2PropertyChange looks? 

Cheers,
- hugi



> On 22. sep. 2015, at 19:57, Andrus Adamchik <andrus@objectstyle.org> wrote:
> 
> Here is the design of the audit framework for everyone's review:
> 
> https://issues.apache.org/jira/browse/CAY-2030
> 
> The way it will work from the user perspective is this:
> 
>  // bootstrap the filter by adding an extra Cayenne-provided module to 
>  // runtime. Optionally add your own module that overrides context provider 
>  // (e.g. to store request IP address and user name).
>  ServerRuntime r = ServerRuntimeBuilder.builder().addModule(new WhateverModuleNameWeUse()).build();
> 
>  // register listener
>  r.getDataDomain().addListener(new MyListener());
> 
> 
>  // listener code
>  class MyListener {
> 
> 
>    @PostCommit
>    void processAsChangeset(Map<ObjectId, ObjectChangeSet> map) {..}
> 
>    // optionally can take a changeset serialized to JSON
>    @PostCommit
>    void processAsJSON(Map<ObjectId, String> map) {..}
>  }
> 
> Andrus


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