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

Jean-Noel Rouvignac
04.09.2014 692dd815da23d7fce14dff285f8ade9df6214a2a
OPENDJ-1602 (CR-5566) New pluggable storage based backend

Follow up of r11387.

PersistitSuffixContainer.java:
Implemented SuffixContainer.getEntry(EntryID).
1 files modified
24 ■■■■■ changed files
opendj3-server-dev/src/server/org/opends/server/backends/persistit/PersistitSuffixContainer.java 24 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/persistit/PersistitSuffixContainer.java
@@ -40,6 +40,7 @@
import com.sleepycat.je.DatabaseException;
import static org.opends.messages.JebMessages.*;
import static org.opends.server.core.DirectoryServer.*;
/**
 * Persistit implementation of a {@link SuffixContainer}.
@@ -209,6 +210,29 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public Entry getEntry(EntryID entryID) throws DirectoryException
  {
    // Try the entry cache first.
    final EntryCache entryCache = getEntryCache();
    final PersistitBackend backend = rootContainer.getBackend();
    final Entry cacheEntry = entryCache.getEntry(backend, entryID.longValue());
    if (cacheEntry != null)
    {
      return cacheEntry;
    }
    final Entry entry = id2entry.get(null, entryID, null);
    if (entry != null)
    {
      // Put the entry in the cache making sure not to overwrite a newer copy
      // that may have been inserted since the time we read the cache.
      entryCache.putEntryIfAbsent(entry, backend, entryID.longValue());
    }
    return entry;
  }
  /**
   * Indicates whether an entry with the specified DN exists.
   *