mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
03.02.2009 02af74d1ee6e4fe9e1279d1f56bcbff8d1cf0e48
Fix for issue 3528 (A scheduled task should check that the start time has not passed)

Compare the current date with the date provided by the user, if the date provided by the user has passed, display an error message.
2 files modified
14 ■■■■■ changed files
opendj-sdk/opends/src/messages/messages/tools.properties 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/tools.properties
@@ -2467,3 +2467,8 @@
SEVERE_ERR_LDAPCOMPARE_ERROR_READING_FILE_1668=An error occurred reading file \
 '%s'.  Check that the file exists and that you have read access rights to \
 it.  Details: %s
SEVERE_ERR_STOPDS_DATETIME_ALREADY_PASSED_1669=The specified stop time '%s' \
 has already passed
opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java
@@ -517,6 +517,15 @@
          err.println(wrapText(message, MAX_LINE_WIDTH));
          return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
        }
        // Check that the provided date is not previous to the current date.
        Date currentDate = new Date(System.currentTimeMillis());
        if (currentDate.after(stopTime))
        {
          Message message = ERR_STOPDS_DATETIME_ALREADY_PASSED.get(
              timeStr);
          err.println(wrapText(message, MAX_LINE_WIDTH));
          return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
        }
      }
    }