From ffb9044301d1c169f934e0adf4f473e99da39a47 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Mon, 27 Aug 2007 18:58:10 +0000
Subject: [PATCH] This adds the numSubordinates and hasSubordinates operational attribute support in OpenDS.    - Implemented as virtual attributes    - They are enabled by default    - numSubordinates and hasSubordinates methods added to the backend API and implemented for all existing backends    - JE implementation uses the id2children index to keep count of the number of subordinates for each entry.    - The behavior of exceeding the index-entry-limit (ALL-IDs) has changed to store a 8 byte entry ID set count with the most significant bit  set to 1 instead of a 0 byte array to signify the index-entry-limit has been exceeded. The previous format is still compatible but all requests  for numSubordinates will return undefined (-1).    - The DBTest tool is also included in this fix. This can be used to list root containers, entry containers, database containers, index  status, as well as dumping a database with or without decoding the data. 

---
 opends/src/server/org/opends/server/backends/task/TaskScheduler.java |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/task/TaskScheduler.java b/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
index d49d73f..285c8da 100644
--- a/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
+++ b/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
@@ -1323,6 +1323,46 @@
     }
   }
 
+  /**
+   * Retrieves the number of scheduled tasks in the task backend.
+   *
+   * @return  The total number of entries in the task backend.
+   */
+  public long getScheduledTaskCount()
+  {
+    schedulerLock.lock();
+
+    try
+    {
+      return tasks.size();
+    }
+    finally
+    {
+      schedulerLock.unlock();
+    }
+  }
+
+
+
+  /**
+   * Retrieves the number of recurring tasks in the task backend.
+   *
+   * @return  The total number of entries in the task backend.
+   */
+  public long getRecurringTaskCount()
+  {
+    schedulerLock.lock();
+
+    try
+    {
+      return recurringTasks.size();
+    }
+    finally
+    {
+      schedulerLock.unlock();
+    }
+  }
+
 
 
   /**

--
Gitblit v1.10.0