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

Fabio Pistolesi
07.27.2015 36e213444660f0a74ed415adeab490a5f3d50a6f
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
@@ -209,6 +209,31 @@
    return nbSeparator == 1;
  }
  @Override
  public String keyToString(ByteString key)
  {
    return key.length() > 0 ? keyToDNString(key) : baseDN.toString();
  }
  @Override
  public String valueToString(ByteString value)
  {
    return new EntryID(value).toString();
  }
  @Override
  public ByteString generateKey(String key)
  {
    try
    {
      return toKey(DN.valueOf(key));
    }
    catch (Exception e)
    {
      return ByteString.valueOf(key.getBytes());
    }
  }
  /**
   * Decorator overriding the next() behavior to iterate through children of the entry pointed by the given cursor at
   * creation.