From 72c939b50428a2aa1f924a04ecdedee93e1383f4 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 13 Sep 2007 21:14:20 +0000
Subject: [PATCH] Introduces a utility 'manage-tasks' for monitoring and some management of tasks called 'manage-tasks'. It can be used in either one-time or menu-driven execution mode to print a summary of task information, print verbose information about a particular task, or cancel a running or pending task.

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

diff --git a/opends/src/server/org/opends/server/backends/task/Task.java b/opends/src/server/org/opends/server/backends/task/Task.java
index 1a83f2d..fde6022 100644
--- a/opends/src/server/org/opends/server/backends/task/Task.java
+++ b/opends/src/server/org/opends/server/backends/task/Task.java
@@ -144,7 +144,34 @@
   // The scheduler with which this task is associated.
   private TaskScheduler taskScheduler;
 
+  /**
+   * Gets a message that identifies this type of task suitable for
+   * presentation to humans in monitoring tools.
+   *
+   * @return name of task
+   */
+  public Message getDisplayName() {
+    // NOTE: this method is invoked via reflection.  If you rename
+    // it be sure to modify the calls.
+    return null;
+  };
 
+  /**
+   * Given an attribute type name returns and locale sensitive
+   * representation.
+   *
+   * @param name of an attribute type associated with the object
+   *        class that represents this entry in the directory
+   * @return Message diaplay name
+   */
+  public Message getAttributeDisplayName(String name) {
+    // Subclasses that are schedulable from the task interface
+    // should override this
+
+    // NOTE: this method is invoked via reflection.  If you rename
+    // it be sure to modify the calls.
+    return null;
+  }
 
   /**
    * Performs generic initialization for this task based on the information in
@@ -1224,6 +1251,21 @@
   public void interruptTask(TaskState interruptState, Message interruptReason)
   {
     // No action is performed by default.
+
+    // NOTE:  if you implement this make sure to override isInterruptable
+    //        to return 'true'
   }
+
+
+
+  /**
+   * Indicates whether or not this task is interruptable or not.
+   *
+   * @return boolean where true indicates that this task can be interrupted.
+   */
+  public boolean isInterruptable() {
+    return false;
+  }
+
 }
 

--
Gitblit v1.10.0