public void updateChangeLog( final Principal user, final Verb verb, final PropertyKey key, final Object previousValue, final Object newValue) { if (changeLogEnabled && changeLog != null && key != null) { final String name = key.jsonName(); if (!hiddenPropertiesInAuditLog.contains(name) && !(key.isUnvalidated() || key.isReadOnly())) { final JsonObject obj = new JsonObject(); obj.add("time", toElement(System.currentTimeMillis())); obj.add("userId", toElement(user.getUuid())); obj.add("userName", toElement(user.getName())); obj.add("verb", toElement(verb)); obj.add("key", toElement(key.jsonName())); obj.add("prev", toElement(previousValue)); obj.add("val", toElement(newValue)); changeLog.append(obj.toString()); changeLog.append("\n"); } } }
public void updateChangeLog(final Principal user, final Verb verb, final String object) { if (changeLogEnabled && changeLog != null) { final JsonObject obj = new JsonObject(); obj.add("time", toElement(System.currentTimeMillis())); obj.add("userId", toElement(user.getUuid())); obj.add("userName", toElement(user.getName())); obj.add("verb", toElement(verb)); obj.add("target", toElement(object)); changeLog.append(obj.toString()); changeLog.append("\n"); } }