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

neil_a_wilson
13.04.2007 414f070c4a49c7e6ff2f0bc69497352bf613bfe2
Fix a problem in the memory backend in that it stores entries with virtual
attributes, which doesn't properly handle changes to virtual attribute rules.
Update the backend so that it stores the entries without the virtual attributes
and then computes them in a copy whenever the entries are accessed.
1 files modified
20 ■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/backends/MemoryBackend.java 20 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/MemoryBackend.java
@@ -271,7 +271,13 @@
   */
  public synchronized Entry getEntry(DN entryDN)
  {
    return entryMap.get(entryDN);
    Entry entry = entryMap.get(entryDN);
    if (entry != null)
    {
      entry = entry.duplicate(true);
    }
    return entry;
  }
@@ -292,7 +298,7 @@
  public synchronized void addEntry(Entry entry, AddOperation addOperation)
         throws DirectoryException
  {
    Entry e = entry.duplicate(true);
    Entry e = entry.duplicate(false);
    // See if the target entry already exists.  If so, then fail.
    DN entryDN = e.getDN();
@@ -438,7 +444,7 @@
                                        ModifyOperation modifyOperation)
         throws DirectoryException
  {
    Entry e = entry.duplicate(true);
    Entry e = entry.duplicate(false);
    // Make sure the entry exists.  If not, then throw an exception.
    DN entryDN = e.getDN();
@@ -463,7 +469,7 @@
                                       ModifyDNOperation modifyDNOperation)
         throws DirectoryException
  {
    Entry e = entry.duplicate(true);
    Entry e = entry.duplicate(false);
    // Make sure that the target entry exists.
    if (! entryMap.containsKey(currentDN))
@@ -573,6 +579,11 @@
                                   matchedDN, null);
    }
    if (baseEntry != null)
    {
      baseEntry = baseEntry.duplicate(true);
    }
    // If it's a base-level search, then just get that entry and return it if it
    // matches the filter.
@@ -588,6 +599,7 @@
      // Walk through all entries and send the ones that match.
      for (Entry e : entryMap.values())
      {
        e = e.duplicate(true);
        if (e.matchesBaseAndScope(baseDN, scope) && filter.matchesEntry(e))
        {
          searchOperation.returnEntry(e, new LinkedList<Control>());