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

abobrov
10.43.2009 d0fa149bb033b08cd0e14c28beb5c1a4d2a7ed06
opends/src/server/org/opends/server/backends/ndb/BackendImpl.java
@@ -1116,11 +1116,11 @@
         throws DirectoryException
  {
    long ret = numSubordinates(entryDN, false);
    if(ret < 0)
    if (ret < 0)
    {
      return ConditionResult.UNDEFINED;
    }
    else if(ret == 0)
    else if (ret == 0)
    {
      return ConditionResult.FALSE;
    }
@@ -1139,8 +1139,42 @@
  public long numSubordinates(DN entryDN, boolean subtree)
      throws DirectoryException
  {
    // NYI.
    return -1;
    EntryContainer ec;
    if (rootContainer != null)
    {
      ec = rootContainer.getEntryContainer(entryDN);
    }
    else
    {
      Message message = ERR_ROOT_CONTAINER_NOT_INITIALIZED.get(getBackendID());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
              message);
    }
    if (ec == null)
    {
      return -1;
    }
    readerBegin();
    ec.sharedLock.lock();
    try
    {
      return ec.getNumSubordinates(entryDN, subtree);
    }
    catch (NdbApiException e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      throw createDirectoryException(e);
    }
    finally
    {
      ec.sharedLock.unlock();
      readerEnd();
    }
  }