From 461b1f6784e6cf1483dc29fdcbef14ccfe6bc849 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 04 Aug 2006 23:17:58 +0000
Subject: [PATCH] Update the configuration and the associated code to be more consistent in the time and size units used for various purposes. A new set of constants have been added to allow the same units to be used throughout the code, including providing both full and abbreviated unit names.
---
opends/src/server/org/opends/server/backends/task/TaskBackend.java | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/task/TaskBackend.java b/opends/src/server/org/opends/server/backends/task/TaskBackend.java
index 7096611..c87ce00 100644
--- a/opends/src/server/org/opends/server/backends/task/TaskBackend.java
+++ b/opends/src/server/org/opends/server/backends/task/TaskBackend.java
@@ -68,6 +68,7 @@
import static org.opends.server.loggers.Error.*;
import static org.opends.server.messages.BackendMessages.*;
import static org.opends.server.messages.MessageHandler.*;
+import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -136,11 +137,16 @@
static
{
- timeUnits.put("seconds", 1.0);
- timeUnits.put("minutes", 60.0);
- timeUnits.put("hours", (60.0*60.0));
- timeUnits.put("days", (24.0*60.0*60.0));
- timeUnits.put("weeks", (7.0*24.0*60.0*60.0));
+ timeUnits.put(TIME_UNIT_SECONDS_ABBR, 1D);
+ timeUnits.put(TIME_UNIT_SECONDS_FULL, 1D);
+ timeUnits.put(TIME_UNIT_MINUTES_ABBR, 60D);
+ timeUnits.put(TIME_UNIT_MINUTES_FULL, 60D);
+ timeUnits.put(TIME_UNIT_HOURS_ABBR, (double) (60 * 60));
+ timeUnits.put(TIME_UNIT_HOURS_FULL, (double) (60 * 60));
+ timeUnits.put(TIME_UNIT_DAYS_ABBR, (double) (60 * 60 * 24));
+ timeUnits.put(TIME_UNIT_DAYS_FULL, (double) (60 * 60 * 24));
+ timeUnits.put(TIME_UNIT_WEEKS_ABBR, (double) (60 * 60 * 24 * 7));
+ timeUnits.put(TIME_UNIT_WEEKS_FULL, (double) (60 * 60 * 24 * 7));
}
@@ -1286,7 +1292,7 @@
description, false,
timeUnits, true, 0, false,
0, retentionTime,
- "seconds"));
+ TIME_UNIT_SECONDS_FULL));
return attrList;
}
--
Gitblit v1.10.0