From b506a6cd184bd8cf477f7d9a7f968c990f153528 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Mon, 23 Mar 2015 23:03:19 +0000
Subject: [PATCH] OPENDJ-1848 CR-6383: Remove Storage getRMW and putIfAbsent methods
---
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java | 19 +++----------------
1 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
index a008590..46bd605 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
@@ -58,21 +58,19 @@
}
/**
- * Insert a new record into the DN database.
+ * Adds a new record into the DN database replacing any existing record having the same DN.
* @param txn A JE database transaction to be used for the database operation,
* or null if none.
* @param dn The entry DN, which is the key to the record.
* @param id The entry ID, which is the value of the record.
- * @return true if the record was inserted, false if a record with that key
- * already exists.
* @throws StorageRuntimeException If an error occurred while attempting to insert
* the new record.
*/
- boolean insert(WriteableStorage txn, DN dn, EntryID id) throws StorageRuntimeException
+ void put(WriteableStorage txn, DN dn, EntryID id) throws StorageRuntimeException
{
ByteString key = dnToDNKey(dn, prefixRDNComponents);
ByteString value = id.toByteString();
- return txn.putIfAbsent(getName(), key, value);
+ txn.create(getName(), key, value);
}
/**
@@ -109,15 +107,4 @@
}
return null;
}
-
- EntryID getRMW(ReadableStorage txn, DN dn) throws StorageRuntimeException
- {
- ByteString key = dnToDNKey(dn, prefixRDNComponents);
- ByteString value = txn.getRMW(getName(), key);
- if (value != null)
- {
- return new EntryID(value);
- }
- return null;
- }
}
--
Gitblit v1.10.0