cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Change audit framework
Date Tue, 22 Sep 2015 19:57:42 GMT
Here is the design of the audit framework for everyone's review:

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 {

    void processAsChangeset(Map<ObjectId, ObjectChangeSet> map) {..}

    // optionally can take a changeset serialized to JSON
    void processAsJSON(Map<ObjectId, String> map) {..}

View raw message