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

dugan
13.57.2007 b52ab703908a5d76a22169f35781b52e90302591
opends/src/server/org/opends/server/core/GroupManager.java
@@ -104,6 +104,10 @@
  private static final DebugTracer TRACER = getTracer();
  //Used by group instances to determine if new groups have been
  //registered or groups deleted.
  private long refreshToken=0;
  // A mapping between the DNs of the config entries and the associated
  // group implementations.
@@ -711,8 +715,11 @@
        }
      }
    }
    createAndRegisterGroup(entry);
    synchronized (groupInstances)
    {
      createAndRegisterGroup(entry);
      refreshToken++;
    }
  }
@@ -735,8 +742,11 @@
        }
      }
    }
    groupInstances.remove(entry.getDN());
    synchronized (groupInstances)
    {
      groupInstances.remove(entry.getDN());
      refreshToken++;
    }
  }
@@ -773,6 +783,7 @@
        }
        createAndRegisterGroup(newEntry);
        refreshToken++;
      }
    }
  }
@@ -807,6 +818,7 @@
      {
        createAndRegisterGroup(newEntry);
        groupInstances.remove(oldEntry.getDN());
        refreshToken++;
      }
    }
  }
@@ -855,5 +867,30 @@
  {
    groupInstances.clear();
  }
  /**
   * Compare the specified token against the current group manager
   * token value. Can be used to reload cached group instances if there has
   * been a group instance change.
   *
   * @param token The current token that the group class holds.
   *
   * @return {@code true} if the group class should reload its nested groups,
   *         or {@code false} if it shouldn't.
   */
  public boolean hasInstancesChanged(long token)  {
    return token != this.refreshToken;
  }
  /**
   * Return the current refresh token value. Can be used to
   * reload cached group instances if there has been a group instance change.
   *
   * @return The current token value.
   */
  public long refreshToken() {
    return this.refreshToken;
  }
}