| | |
| | | { |
| | | ByteString key = toKey(dn); |
| | | |
| | | ByteString oldValue = read(txn, key, true); |
| | | ByteString oldValue = txn.getRMW(getName(), key); |
| | | if (oldValue != null) |
| | | { |
| | | final Pair<DN, List<String>> dnAndUris = decode(oldValue); |
| | | final Collection<String> newUris = dnAndUris.getSecond(); |
| | | if (newUris.addAll(labeledURIs)) |
| | | { |
| | | put(txn, key, encode(dn, newUris)); |
| | | txn.create(getName(), key, encode(dn, newUris)); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | txn.putIfAbsent(treeName, key, encode(dn, labeledURIs)); |
| | | txn.putIfAbsent(getName(), key, encode(dn, labeledURIs)); |
| | | } |
| | | containsReferrals = ConditionResult.TRUE; |
| | | } |
| | |
| | | { |
| | | ByteString key = toKey(dn); |
| | | |
| | | if (delete(txn, key)) |
| | | if (txn.delete(getName(), key)) |
| | | { |
| | | containsReferrals = containsReferrals(txn); |
| | | return true; |
| | |
| | | { |
| | | ByteString key = toKey(dn); |
| | | |
| | | ByteString oldValue = read(txn, key, true); |
| | | ByteString oldValue = txn.getRMW(getName(), key); |
| | | if (oldValue != null) |
| | | { |
| | | final Pair<DN, List<String>> dnAndUris = decode(oldValue); |
| | | final Collection<String> oldUris = dnAndUris.getSecond(); |
| | | if (oldUris.removeAll(labeledURIs)) |
| | | { |
| | | put(txn, key, encode(dn, oldUris)); |
| | | txn.create(getName(), key, encode(dn, oldUris)); |
| | | containsReferrals = containsReferrals(txn); |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | private ConditionResult containsReferrals(ReadableStorage txn) |
| | | { |
| | | Cursor cursor = txn.openCursor(treeName); |
| | | Cursor cursor = txn.openCursor(getName()); |
| | | try |
| | | { |
| | | return ConditionResult.valueOf(cursor.next()); |
| | |
| | | |
| | | try |
| | | { |
| | | final Cursor cursor = txn.openCursor(treeName); |
| | | final Cursor cursor = txn.openCursor(getName()); |
| | | try |
| | | { |
| | | // Go up through the DIT hierarchy until we find a referral. |
| | |
| | | |
| | | try |
| | | { |
| | | final Cursor cursor = txn.openCursor(treeName); |
| | | final Cursor cursor = txn.openCursor(getName()); |
| | | try |
| | | { |
| | | // Initialize the cursor very close to the starting value then |