From f73b655466092169abac34833fb628fce1fcdebe Mon Sep 17 00:00:00 2001
From: jcduff <jcduff@localhost>
Date: Thu, 23 Oct 2008 14:04:24 +0000
Subject: [PATCH] The commit will bring the following features : - An updated version of the underlying database. BDB JE 3.3 is now used. - Attribute API refactoring providing a better abstraction and offering improved performances. - A new GUI called the Control-Panel to replace the Status-Panel: the specifications for this GUI are available on OpenDS Wiki and contains a link to a mockup. See <https://www.opends.org/wiki/page/ControlPanelUISpecification>. - Some changes in the replication protocol to implement "Assured Replication Mode". The specifications are on OpenDS Wiki at <https://www.opends.org/wiki/page/AssuredMode> and section 7 described some of the replication changes required to support this. Assured Replication is not finished, but the main replication protocol changes to support it are done. As explained by Gilles on an email on the Dev mailing list (http://markmail.org/message/46rgo3meq3vriy4a), with these changes the newer versions of OpenDS may not be able to replicate with OpenDS 1.0 instances. - Support for Service Tags on the platforms where the functionality is available and enabled. Specifications are published at <https://www.opends.org/wiki/page/OpenDSServiceTagEnabled>. For more information on Service Tags see <http://wikis.sun.com/display/ServiceTag/Sun+Service+Tag+FAQ>. - The Admin Connector service. In order to provide agentry of the OpenDS server at any time, a new service has been added, dedicated to the administration, configuration and monitoring of the server. An overview of the Admin Connector service and it's use is available on the OpenDS wiki <https://www.opends.org/wiki/page/ManagingAdministrationTrafficToTheServer> - Updates to the various command line tools to support the Admin Connector service. - Some internal re-architecting of the server to put the foundation of future developments such as virtual directory services. The new NetworkGroups and WorkFlow internal services which have been specified in <https://www.opends.org/wiki/page/BasicOperationRoutingThroughNetworkGroup> are now implemented. - Many bug fixes...
---
opends/src/server/org/opends/server/backends/jeb/EntryContainer.java | 65 ++++++++++++--------------------
1 files changed, 24 insertions(+), 41 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java b/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
index ca77bc3..ac18901 100644
--- a/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
+++ b/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
@@ -1112,17 +1112,8 @@
debugBuffer.append(" final=");
entryIDList.toString(debugBuffer);
- AttributeSyntax syntax =
- DirectoryServer.getDefaultStringSyntax();
- AttributeType attrType =
- DirectoryServer.getDefaultAttributeType(ATTR_DEBUG_SEARCH_INDEX,
- syntax);
- ASN1OctetString valueString =
- new ASN1OctetString(debugBuffer.toString());
- LinkedHashSet<AttributeValue> values =
- new LinkedHashSet<AttributeValue>();
- values.add(new AttributeValue(valueString, valueString));
- Attribute attr = new Attribute(attrType, ATTR_DEBUG_SEARCH_INDEX, values);
+ Attribute attr = Attributes.create(ATTR_DEBUG_SEARCH_INDEX,
+ debugBuffer.toString());
Entry debugEntry;
debugEntry = new Entry(DN.decode("cn=debugsearch"), null, null, null);
@@ -1840,7 +1831,7 @@
EntryContainer.transactionCommit(txn);
// Update the entry cache.
- EntryCache entryCache = DirectoryServer.getEntryCache();
+ EntryCache<?> entryCache = DirectoryServer.getEntryCache();
if (entryCache != null)
{
entryCache.putEntry(entry, backend, entryID.longValue());
@@ -2200,7 +2191,7 @@
}
// Remove the entry from the entry cache.
- EntryCache entryCache = DirectoryServer.getEntryCache();
+ EntryCache<?> entryCache = DirectoryServer.getEntryCache();
if (entryCache != null)
{
entryCache.removeEntry(leafDN);
@@ -2221,7 +2212,7 @@
public boolean entryExists(DN entryDN)
throws DirectoryException
{
- EntryCache entryCache = DirectoryServer.getEntryCache();
+ EntryCache<?> entryCache = DirectoryServer.getEntryCache();
// Try the entry cache first.
if (entryCache != null)
@@ -2265,7 +2256,7 @@
public Entry getEntry(DN entryDN)
throws DatabaseException, DirectoryException
{
- EntryCache entryCache = DirectoryServer.getEntryCache();
+ EntryCache<?> entryCache = DirectoryServer.getEntryCache();
Entry entry = null;
// Try the entry cache first.
@@ -2315,7 +2306,8 @@
* The simplest case of replacing an entry in which the entry DN has
* not changed.
*
- * @param entry The new contents of the entry
+ * @param oldEntry The old contents of the entry
+ * @param newEntry The new contents of the entry
* @param modifyOperation The modify operation with which this action is
* associated. This may be <CODE>null</CODE> for
* modifications performed internally.
@@ -2323,39 +2315,30 @@
* @throws DirectoryException If a Directory Server error occurs.
* @throws CanceledOperationException if this operation should be cancelled.
*/
- public void replaceEntry(Entry entry, ModifyOperation modifyOperation)
- throws DatabaseException, DirectoryException, CanceledOperationException
+ public void replaceEntry(Entry oldEntry, Entry newEntry,
+ ModifyOperation modifyOperation) throws DatabaseException,
+ DirectoryException, CanceledOperationException
{
Transaction txn = beginTransaction();
try
{
// Read dn2id.
- EntryID entryID = dn2id.get(txn, entry.getDN(), LockMode.RMW);
+ EntryID entryID = dn2id.get(txn, newEntry.getDN(), LockMode.RMW);
if (entryID == null)
{
// The entry does not exist.
Message message =
- ERR_JEB_MODIFY_NO_SUCH_OBJECT.get(entry.getDN().toString());
+ ERR_JEB_MODIFY_NO_SUCH_OBJECT.get(newEntry.getDN().toString());
DN matchedDN = getMatchedDN(baseDN);
throw new DirectoryException(ResultCode.NO_SUCH_OBJECT,
message, matchedDN, null);
}
- // Read id2entry for the original entry.
- Entry originalEntry = id2entry.get(txn, entryID, LockMode.RMW);
- if (originalEntry == null)
- {
- // The entry does not exist.
- Message msg = ERR_JEB_MISSING_ID2ENTRY_RECORD.get(entryID.toString());
- throw new DirectoryException(
- DirectoryServer.getServerErrorResultCode(), msg);
- }
-
if (!isManageDsaITOperation(modifyOperation))
{
// Check if the entry is a referral entry.
- dn2uri.checkTargetForReferral(originalEntry, null);
+ dn2uri.checkTargetForReferral(oldEntry, null);
}
// Update the referral database.
@@ -2363,28 +2346,28 @@
{
// In this case we know from the operation what the modifications were.
List<Modification> mods = modifyOperation.getModifications();
- dn2uri.modifyEntry(txn, originalEntry, entry, mods);
+ dn2uri.modifyEntry(txn, oldEntry, newEntry, mods);
}
else
{
- dn2uri.replaceEntry(txn, originalEntry, entry);
+ dn2uri.replaceEntry(txn, oldEntry, newEntry);
}
// Replace id2entry.
- id2entry.put(txn, entryID, entry);
+ id2entry.put(txn, entryID, newEntry);
// Update the indexes.
if (modifyOperation != null)
{
// In this case we know from the operation what the modifications were.
List<Modification> mods = modifyOperation.getModifications();
- indexModifications(txn, originalEntry, entry, entryID, mods);
+ indexModifications(txn, oldEntry, newEntry, entryID, mods);
}
else
{
// The most optimal would be to figure out what the modifications were.
- indexRemoveEntry(txn, originalEntry, entryID);
- indexInsertEntry(txn, entry, entryID);
+ indexRemoveEntry(txn, oldEntry, entryID);
+ indexInsertEntry(txn, newEntry, entryID);
}
if(modifyOperation != null)
@@ -2397,10 +2380,10 @@
EntryContainer.transactionCommit(txn);
// Update the entry cache.
- EntryCache entryCache = DirectoryServer.getEntryCache();
+ EntryCache<?> entryCache = DirectoryServer.getEntryCache();
if (entryCache != null)
{
- entryCache.putEntry(entry, backend, entryID.longValue());
+ entryCache.putEntry(newEntry, backend, entryID.longValue());
}
}
catch (DatabaseException databaseException)
@@ -2790,7 +2773,7 @@
}
// Remove the entry from the entry cache.
- EntryCache entryCache = DirectoryServer.getEntryCache();
+ EntryCache<?> entryCache = DirectoryServer.getEntryCache();
if (entryCache != null)
{
entryCache.removeEntry(oldDN);
@@ -2939,7 +2922,7 @@
}
// Remove the entry from the entry cache.
- EntryCache entryCache = DirectoryServer.getEntryCache();
+ EntryCache<?> entryCache = DirectoryServer.getEntryCache();
if (entryCache != null)
{
entryCache.removeEntry(oldDN);
--
Gitblit v1.10.0