mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Fabio Pistolesi
07.31.2016 b29370429ba8360cbc0c048db95c80f3fae88c15
Cache ldap specific object when building CAUD events.

Some operations on json values are slow. Avoid creating temporary JsonValue wrappers for the ldap object.
1 files modified
10 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJAccessEventBuilder.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJAccessEventBuilder.java
@@ -44,6 +44,9 @@
class OpenDJAccessAuditEventBuilder<T extends OpenDJAccessAuditEventBuilder<T>> extends AccessAuditEventBuilder<T>
{
  private static final String LDAP_VALUE_KEY = "ldap";
  private JsonValue ldapValue;
  private OpenDJAccessAuditEventBuilder()
  {
    super();
@@ -247,10 +250,11 @@
  private JsonValue getLdapValue()
  {
    if (!jsonValue.isDefined("ldap"))
    if (ldapValue == null)
    {
      jsonValue.put("ldap", object());
      jsonValue.put(LDAP_VALUE_KEY, object());
      ldapValue = jsonValue.get(LDAP_VALUE_KEY);
    }
    return jsonValue.get("ldap");
    return ldapValue;
  }
}