Permalink
Browse files

[[HHQ-3144] Updated data validation logic for some server config prop…

…erties
  • Loading branch information...
pnguyen
pnguyen committed Jul 8, 2010
1 parent f3f86e0 commit 0237773b62a19c6fee5955255812692ee05ce666
@@ -114,12 +114,15 @@ class ServerconfigController extends ApiController {
minVal = 24*oneHourInMillis
maxVal = 7*24*oneHourInMillis
multiple = 24*oneHourInMillis
- } else if (key.equals(HQConstants.DataMaintenance)
- || key.equals(HQConstants.AlertPurge)
- || key.equals(HQConstants.EventLogPurge)) {
+ } else if (key.equals(HQConstants.DataMaintenance)) {
minVal = oneHourInMillis
maxVal = 9999*oneHourInMillis
multiple = oneHourInMillis
+ } else if (key.equals(HQConstants.AlertPurge)
+ || key.equals(HQConstants.EventLogPurge)) {
+ minVal = 24*oneHourInMillis
+ maxVal = 9999*24*oneHourInMillis
+ multiple = 24*oneHourInMillis
}
if (minVal && maxVal && multiple) {
@@ -132,7 +132,7 @@ public void testSetConfigAtMax() throws Exception {
String configName = "ALERT_PURGE";
String serverValue = getConfigValue(configName);
- long maxValue = 9999 * 60 * 60 * 1000L;
+ long maxValue = 9999 * 24 * 60 * 60 * 1000L;
ServerConfig c = new ServerConfig();
c.setKey(configName);
c.setValue(Long.toString(maxValue));
@@ -171,7 +171,7 @@ public void testSetConfigValidMultiple() throws Exception {
String configName = "EVENT_LOG_PURGE";
String serverValue = getConfigValue(configName);
- long multipleValue = 50 * 60 * 60 * 1000L;
+ long multipleValue = 50 * 24 * 60 * 60 * 1000L;
ServerConfig c = new ServerConfig();
c.setKey(configName);
c.setValue(Long.toString(multipleValue));

0 comments on commit 0237773

Please sign in to comment.