Class AccessTracker


  • public class AccessTracker
    extends java.lang.Object
    Use to notify of changes in the data.

    All changes done using MapFacade are tracked automatically. If you changes data using JPA, JDBC, etc. you should call the method in this class to track the database changes.

    Since:
    5.9
    Author:
    Javier Paniza
    • Constructor Summary

      Constructors 
      Constructor Description
      AccessTracker()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void consulted​(java.lang.String modelName, java.util.Map key)  
      static void created​(java.lang.String modelName, java.util.Map key)  
      static void executed​(java.lang.String modelName, java.util.Map key, java.lang.String qualifiedActionName)  
      static void modified​(java.lang.String modelName, java.util.Map key, java.util.Map<java.lang.String,​java.lang.Object> oldChangedValues, java.util.Map<java.lang.String,​java.lang.Object> newChangedValues)
      You have to put the same property in both maps, oldChangeValues and newChangedValues, with old and new value.
      static void removed​(java.lang.String modelName, java.util.Map key)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AccessTracker

        public AccessTracker()
    • Method Detail

      • consulted

        public static void consulted​(java.lang.String modelName,
                                     java.util.Map key)
      • created

        public static void created​(java.lang.String modelName,
                                   java.util.Map key)
      • modified

        public static void modified​(java.lang.String modelName,
                                    java.util.Map key,
                                    java.util.Map<java.lang.String,​java.lang.Object> oldChangedValues,
                                    java.util.Map<java.lang.String,​java.lang.Object> newChangedValues)
        You have to put the same property in both maps, oldChangeValues and newChangedValues, with old and new value. An example:
         Map oldChangedValues = new HashMap();
         oldChangedValues.put("address", "C/. Doctor Pesset"); // The old address
         Map newChangedValues = new HashMap();
         newChangedValues.put("address", "C/. Almudaina"); // The new address
         AccessTracking.modified("Customer", key, oldChangedValues, newChangedValues);
         
        If oldChangeValues and newChangedValues are empty the tracker can ignore the call.
      • removed

        public static void removed​(java.lang.String modelName,
                                   java.util.Map key)
      • executed

        public static void executed​(java.lang.String modelName,
                                    java.util.Map key,
                                    java.lang.String qualifiedActionName)
        Since:
        7.2