From 08cb78a98bc35e0c625917d63de381b0093711f2 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 08 Aug 2016 07:31:26 +0000
Subject: [PATCH] Partial OPENDJ-3106 Migrate Entry

---
 opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java                             |    2 +-
 opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java                            |    6 +++---
 opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java                                              |   10 +++++-----
 opendj-server-legacy/src/test/java/org/opends/server/core/PasswordPolicyTestCase.java                              |    2 +-
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyReplaySingleValuedAttributeTest.java |    4 ++--
 opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java |    2 +-
 opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java                                       |    2 +-
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java                        |    2 +-
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java                    |    2 +-
 opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java                       |    2 +-
 opendj-server-legacy/src/test/java/org/opends/server/schema/FakeEntryIndex.java                                    |    2 +-
 opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java                         |    2 +-
 12 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
index 7b4d642..3ca0915 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
@@ -824,7 +824,7 @@
       logMessages.add(messageString);
 
       final AttributeType type = DirectoryServer.getSchema().getAttributeType(ATTR_TASK_LOG_MESSAGES);
-      final Attribute attr = taskEntry.getExactAttribute(AttributeDescription.create(type));
+      final Attribute attr = taskEntry.getAttribute(AttributeDescription.create(type));
       final AttributeBuilder builder = attr != null ? new AttributeBuilder(attr) : new AttributeBuilder(type);
       builder.add(messageString);
       taskEntry.putAttribute(type, builder.toAttributeList());
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
index 3a6d272..804cbc6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -1006,7 +1006,7 @@
         break;
       }
 
-      Attribute modifiedAttribute = entry.getExactAttribute(mod.getAttribute().getAttributeDescription());
+      Attribute modifiedAttribute = entry.getAttribute(mod.getAttribute().getAttributeDescription());
       if (modifiedAttribute != null)
       {
         PluginResult.PreOperation result =
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java
index c415438..97fab62 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java
@@ -259,7 +259,7 @@
 
         case INCREMENT:
           // We could calculate the new value, but we'll just take it from the updated entry.
-          Attribute updatedAttr = modifyOperation.getModifiedEntry().getExactAttribute(a.getAttributeDescription());
+          Attribute updatedAttr = modifyOperation.getModifiedEntry().getAttribute(a.getAttributeDescription());
           if (updatedAttr != null)
           {
             for (ByteString v : updatedAttr)
@@ -441,7 +441,7 @@
 
         case INCREMENT:
           // We could calculate the new value, but we'll just take it from the updated entry.
-          Attribute updatedAttr = modifyOperation.getModifiedEntry().getExactAttribute(a.getAttributeDescription());
+          Attribute updatedAttr = modifyOperation.getModifiedEntry().getAttribute(a.getAttributeDescription());
           if (updatedAttr != null)
           {
             for (ByteString v : updatedAttr)
@@ -813,7 +813,7 @@
 
         case INCREMENT:
           // We could calculate the new value, but we'll just take it from the updated entry.
-          Attribute updatedAttr = modifyOperation.getModifiedEntry().getExactAttribute(a.getAttributeDescription());
+          Attribute updatedAttr = modifyOperation.getModifiedEntry().getAttribute(a.getAttributeDescription());
           if (updatedAttr != null)
           {
             for (ByteString v : updatedAttr)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
index 6acead6..402b8f1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
@@ -535,7 +535,7 @@
     {
       // It's possible that there could be an attribute without any
       // values, which we should treat as not having the requested attribute.
-      Attribute attribute = getExactAttribute(attributeDescription);
+      Attribute attribute = getAttribute(attributeDescription);
       return attribute != null && !attribute.isEmpty();
     }
 
@@ -1069,7 +1069,7 @@
   public void incrementAttribute(Attribute attribute) throws DirectoryException
   {
     AttributeDescription attrDesc = attribute.getAttributeDescription();
-    Attribute a = getExactAttribute(attrDesc);
+    Attribute a = getAttribute(attrDesc);
     if (a == null)
     {
       LocalizableMessage message = ERR_ENTRY_INCREMENT_NO_SUCH_ATTRIBUTE.get(attrDesc);
@@ -1306,7 +1306,7 @@
    */
   public boolean hasValue(AttributeDescription attributeDescription, ByteString value)
   {
-    Attribute attr = getExactAttribute(attributeDescription);
+    Attribute attr = getAttribute(attributeDescription);
     return attr != null && attr.contains(value);
   }
 
@@ -2929,7 +2929,7 @@
           {
             if (inheritFromEntry != null)
             {
-              collectiveAttr = inheritFromEntry.getExactAttribute(collectiveAttr.getAttributeDescription());
+              collectiveAttr = inheritFromEntry.getAttribute(collectiveAttr.getAttributeDescription());
               if (collectiveAttr == null || collectiveAttr.isEmpty())
               {
                 continue;
@@ -4152,7 +4152,7 @@
    *         specified attribute type is not present in this entry
    *         with the provided set of options.
    */
-  public Attribute getExactAttribute(AttributeDescription attributeDescription)
+  public Attribute getAttribute(AttributeDescription attributeDescription)
   {
     List<Attribute> attributes = getAllAttributes0(attributeDescription.getAttributeType());
     if (attributes != null)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
index d355b1c..00e61f7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -1399,7 +1399,7 @@
     }
 
     // Get the attribute that is to be incremented.
-    Attribute modifiedAttr = modifiedEntry.getExactAttribute(attrDesc);
+    Attribute modifiedAttr = modifiedEntry.getAttribute(attrDesc);
     if (modifiedAttr == null)
     {
       throw newDirectoryException(modifiedEntry,
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/PasswordPolicyTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/PasswordPolicyTestCase.java
index 8412377..1327b27 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/PasswordPolicyTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/PasswordPolicyTestCase.java
@@ -4300,7 +4300,7 @@
     assertNotNull(entry);
     AttributeType pwdHistory = DirectoryServer.getSchema().getAttributeType("pwdhistory");
     assertNotNull(pwdHistory);
-    Attribute historyAttr = entry.getExactAttribute(AttributeDescription.create(pwdHistory));
+    Attribute historyAttr = entry.getAttribute(AttributeDescription.create(pwdHistory));
     assertNotNull(historyAttr);
     assertThat(historyAttr).hasSize(3);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
index eec9342..5b32d27 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
@@ -469,7 +469,7 @@
       debugInfo("Entry found <" + baseDN + ">");
 
       AttributeType synchronizationGenIDType = DirectoryServer.getSchema().getAttributeType(REPLICATION_GENERATION_ID);
-      Attribute attr = resultEntry.getExactAttribute(AttributeDescription.create(synchronizationGenIDType));
+      Attribute attr = resultEntry.getAttribute(AttributeDescription.create(synchronizationGenIDType));
       return Long.valueOf(attr.iterator().next().toString());
     }
     return -1;
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java
index 6cde79c..eaa8563 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java
@@ -332,7 +332,7 @@
   private String getEntryValue(final DN dn, AttributeDescription attrDesc) throws DirectoryException
   {
     Entry entry = DirectoryServer.getEntry(dn);
-    Attribute attr = entry.getExactAttribute(attrDesc);
+    Attribute attr = entry.getAttribute(attrDesc);
     Assertions.assertThat(attr).hasSize(1);
     return attr.iterator().next().toString();
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
index 575f779..1712281 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
@@ -1195,7 +1195,7 @@
 
   private void assertContainsOnlyValues(Entry entry, String attrName, String... expectedValues)
   {
-    Attribute attr = entry.getExactAttribute(AttributeDescription.create(getSchema().getAttributeType(attrName)));
+    Attribute attr = entry.getAttribute(AttributeDescription.create(getSchema().getAttributeType(attrName)));
     assertThat(attr).hasSize(expectedValues.length);
     for (String value : expectedValues)
     {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyReplaySingleValuedAttributeTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyReplaySingleValuedAttributeTest.java
index cb5d91b..fe64c0b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyReplaySingleValuedAttributeTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyReplaySingleValuedAttributeTest.java
@@ -365,7 +365,7 @@
     entryHistorical.replayOperation(op, entry);
     entry.applyModification(new Modification(REPLACE, entryHistorical.encodeAndPurge()));
 
-    Attribute actual = entry.getExactAttribute(expectedDsSyncHist.getAttributeDescription());
+    Attribute actual = entry.getAttribute(expectedDsSyncHist.getAttributeDescription());
     Assert.assertEquals(actual, expectedDsSyncHist, "wrong final value for ds-sync-hist attribute");
   }
 
@@ -401,7 +401,7 @@
       entry.applyModification(new Modification(REPLACE, entryHistorical.encodeAndPurge()));
     }
 
-    Attribute actual = entry.getExactAttribute(expectedDsSyncHist.getAttributeDescription());
+    Attribute actual = entry.getAttribute(expectedDsSyncHist.getAttributeDescription());
     Assert.assertEquals(actual, expectedDsSyncHist, "wrong final value for ds-sync-hist attribute");
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/FakeEntryIndex.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/FakeEntryIndex.java
index a7a1a08..a65e6fd 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/FakeEntryIndex.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/FakeEntryIndex.java
@@ -72,7 +72,7 @@
 
   void add(Entry entry) throws DecodeException
   {
-    Attribute attribute = entry.getExactAttribute(AttributeDescription.create(attrType));
+    Attribute attribute = entry.getAttribute(AttributeDescription.create(attrType));
     for (ByteString key : index(attribute))
     {
       Set<Entry> entries = index.get(key);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
index 83a0465..35049bd 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
@@ -158,7 +158,7 @@
     Collection<DN> results = new ArrayList<>();
     for (Entry entry : makeEntries())
     {
-      Attribute attribute = entry.getExactAttribute(AttributeDescription.create(attrType));
+      Attribute attribute = entry.getAttribute(AttributeDescription.create(attrType));
       if (attribute != null)
       {
         ByteString attrValue = rule.normalizeAttributeValue(attribute.iterator().next());

--
Gitblit v1.10.0