| | |
| | | |
| | | /** |
| | | * Returns the entry corresponding to the provided entryID. |
| | | * |
| | | * |
| | | * @param entryID |
| | | * the id of the entry to retrieve |
| | | * @return the entry corresponding to the provided entryID |
| | |
| | | // The cookie contains the ID of the next entry to be returned. |
| | | try |
| | | { |
| | | begin = new EntryID(pageRequest.getCookie().toLong()); |
| | | begin = new EntryID(pageRequest.getCookie()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | indexRemoveEntry(indexBuffer, entry, leafID); |
| | | |
| | | // Remove the id2c and id2s records for this entry. |
| | | final ByteString leafIDKeyBytes = ByteString.valueOf(leafID.longValue()); |
| | | final ByteString leafIDKeyBytes = leafID.toByteString(); |
| | | id2children.delete(indexBuffer, leafIDKeyBytes); |
| | | id2subtree.delete(indexBuffer, leafIDKeyBytes); |
| | | |
| | |
| | | throw new JebException(ERR_JEB_MISSING_DN2ID_RECORD.get(parentDN)); |
| | | } |
| | | |
| | | ByteString parentIDBytes = ByteString.valueOf(parentID.longValue()); |
| | | ByteString parentIDBytes = parentID.toByteString(); |
| | | // Remove from id2children. |
| | | if (isParent) |
| | | { |
| | |
| | | { |
| | | logger.trace("Move of target entry requires renumbering" + "all entries in the subtree. " |
| | | + "Old DN: %s " + "New DN: %s " + "Old entry ID: %d " + "New entry ID: %d " |
| | | + "New Superior ID: %d" + oldApexEntry.getName(), entry.getName(), oldApexID.longValue(), |
| | | newApexID.longValue(), newSuperiorID.longValue()); |
| | | + "New Superior ID: %d" + oldApexEntry.getName(), entry.getName(), oldApexID, |
| | | newApexID, newSuperiorID); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("Move of subordinate entry requires " + "renumbering. " + "Old DN: %s " |
| | | + "New DN: %s " + "Old entry ID: %d " + "New entry ID: %d", oldEntry.getName(), newDN, oldID |
| | | .longValue(), newID.longValue()); |
| | | logger.trace("Move of subordinate entry requires renumbering. " |
| | | + "Old DN: %s New DN: %s Old entry ID: %d New entry ID: %d", |
| | | oldEntry.getName(), newDN, oldID, newID); |
| | | } |
| | | } |
| | | |
| | |
| | | dn = getParentWithinBase(dn)) |
| | | { |
| | | EntryID parentID = dn2id.get(txn, dn, false); |
| | | ByteString parentIDKeyBytes = ByteString.valueOf(parentID.longValue()); |
| | | ByteString parentIDKeyBytes = parentID.toByteString(); |
| | | if(isParent) |
| | | { |
| | | id2children.insertID(buffer, parentIDKeyBytes, newID); |
| | |
| | | for (DN dn = oldSuperiorDN; dn != null; dn = getParentWithinBase(dn)) |
| | | { |
| | | EntryID parentID = dn2id.get(txn, dn, false); |
| | | ByteString parentIDKeyBytes = ByteString.valueOf(parentID.longValue()); |
| | | ByteString parentIDKeyBytes = parentID.toByteString(); |
| | | if(isParent) |
| | | { |
| | | id2children.removeID(buffer, parentIDKeyBytes, oldID); |
| | |
| | | { |
| | | // All the subordinates will be renumbered so we have to rebuild |
| | | // id2c and id2s with the new ID. |
| | | ByteString oldIDKeyBytes = ByteString.valueOf(oldID.longValue()); |
| | | ByteString oldIDKeyBytes = oldID.toByteString(); |
| | | id2children.delete(buffer, oldIDKeyBytes); |
| | | id2subtree.delete(buffer, oldIDKeyBytes); |
| | | |
| | |
| | | for (DN dn = oldSuperiorDN; dn != null; dn = getParentWithinBase(dn)) |
| | | { |
| | | EntryID parentID = dn2id.get(txn, dn, false); |
| | | ByteString parentIDKeyBytes = ByteString.valueOf(parentID.longValue()); |
| | | ByteString parentIDKeyBytes = parentID.toByteString(); |
| | | id2subtree.removeID(buffer, parentIDKeyBytes, oldID); |
| | | } |
| | | } |
| | |
| | | { |
| | | // All the subordinates will be renumbered so we have to rebuild |
| | | // id2c and id2s with the new ID. |
| | | ByteString oldIDKeyBytes = ByteString.valueOf(oldID.longValue()); |
| | | ByteString oldIDKeyBytes = oldID.toByteString(); |
| | | id2children.delete(buffer, oldIDKeyBytes); |
| | | id2subtree.delete(buffer, oldIDKeyBytes); |
| | | |
| | |
| | | EntryID entryID = dn2id.get(null, baseDN, false); |
| | | if (entryID != null) |
| | | { |
| | | ByteString key = entryIDToDatabase(entryID.longValue()); |
| | | EntryIDSet entryIDSet = id2subtree.readKey(key, null); |
| | | EntryIDSet entryIDSet = id2subtree.readKey(entryID.toByteString(), null); |
| | | |
| | | long count = entryIDSet.size(); |
| | | if(count != Long.MAX_VALUE) |