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

abobrov
09.48.2007 fbe83410829a01a58ee9ffb68b5f13086fdecee1
opendj-sdk/opends/src/server/org/opends/server/api/EntryCache.java
@@ -33,6 +33,8 @@
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicLong;
import org.opends.server.core.DirectoryServer;
import org.opends.server.config.ConfigException;
@@ -43,6 +45,7 @@
import org.opends.server.types.LockManager;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.Attribute;
import org.opends.server.admin.std.server.EntryCacheCfg;
import org.opends.server.loggers.debug.DebugTracer;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -105,6 +108,16 @@
  // up.
  private long lockTimeout = LockManager.DEFAULT_TIMEOUT;
  /**
   * Arbitrary number of cache hits for monitoring.
   */
  protected AtomicLong cacheHits = new AtomicLong(0);
  /**
   * Arbitrary number of cache misses for monitoring.
   */
  protected AtomicLong cacheMisses = new AtomicLong(0);
  /**
@@ -239,6 +252,9 @@
                        List<Lock> lockList) {
    if (!containsEntry(entryDN)) {
      // Indicate cache miss.
      cacheMisses.set(cacheMisses.incrementAndGet());
      return null;
    }
@@ -391,6 +407,9 @@
    // Translate given backend/entryID pair to entryDN.
    DN entryDN = getEntryDN(backend, entryID);
    if (entryDN == null) {
      // Indicate cache miss.
      cacheMisses.set(cacheMisses.incrementAndGet());
      return null;
    }
@@ -526,6 +545,19 @@
  /**
   * Retrieves a set of attributes containing monitor data that should
   * be returned to the client if the corresponding monitor entry is
   * requested.
   *
   * @return  A set of attributes containing monitor data that should
   *          be returned to the client if the corresponding monitor
   *          entry is requested.
   */
  public abstract ArrayList<Attribute> getMonitorData();
  /**
   * Retrieves the maximum length of time in milliseconds to wait for
   * a lock before giving up.
   *