mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
06.29.2016 08cb78a98bc35e0c625917d63de381b0093711f2
Partial OPENDJ-3106 Migrate Entry

Entry.java:
Renamed `getExactAttribute()` to `getAttribute()`
12 files modified
38 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/core/PasswordPolicyTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyReplaySingleValuedAttributeTest.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/schema/FakeEntryIndex.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java 2 ●●● patch | view | raw | blame | history
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());
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 =
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)
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)
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,
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);
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;
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();
  }
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)
    {
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");
  }
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);
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());