From 7adb93986ace907531875e25be1f94d735fbb068 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Mon, 08 Dec 2008 08:03:33 +0000
Subject: [PATCH] Merge the replication-service branch with the OpenDS trunk

---
 opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerStatus.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerStatus.java b/opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerStatus.java
index d46ab82..563c4b9 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerStatus.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerStatus.java
@@ -131,4 +131,31 @@
   {
     return value;
   }
+
+  /**
+   * Get a user readable string representing this status (User friendly string
+   * for monitoring purpose).
+   * @return A user readable string representing this status.
+   */
+  public String toString()
+  {
+    switch (value)
+    {
+      case -1:
+        return "Invalid";
+      case 0:
+        return "Not connected";
+      case 1:
+        return "Normal";
+      case 2:
+        return "Degraded";
+      case 3:
+        return "Full update";
+      case 4:
+        return "Bad generation id";
+      default:
+        throw new IllegalArgumentException("Wrong status numeric value: " +
+          value);
+    }
+  }
 }

--
Gitblit v1.10.0