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

boli
22.47.2007 9a72955d0b08a0a1b3116d9eaba993c77c84d8c1
opends/src/server/org/opends/server/backends/BackupBackend.java
@@ -357,7 +357,7 @@
  @Override()
  public ConditionResult hasSubordinates(DN entryDN) throws DirectoryException
  {
    long ret = numSubordinates(entryDN);
    long ret = numSubordinates(entryDN, false);
    if(ret < 0)
    {
      return ConditionResult.UNDEFINED;
@@ -378,7 +378,8 @@
   * {@inheritDoc}
   */
  @Override()
  public long numSubordinates(DN entryDN) throws DirectoryException
  public long numSubordinates(DN entryDN, boolean subtree)
      throws DirectoryException
  {
    // If the requested entry was null, then return undefined.
    if (entryDN == null)
@@ -400,6 +401,23 @@
        {
          continue;
        }
        // If subtree is included, count the number of entries for each
        // backup directory.
        if (subtree)
        {
          try
          {
            BackupDirectory backupDirectory =
                BackupDirectory.readBackupDirectoryDescriptor(f.getPath());
            count += backupDirectory.getBackups().keySet().size();
          }
          catch (Exception e)
          {
            return -1;
          }
        }
        count ++;
      }
      return count;