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

jvergara
13.32.2008 5eb4ee3a50c6ed6b3c38a2ce37e116768a357ebf
Fix for issue 2652 (stop-ds should provide the -t 0 option)

The t option now supports the "0" value.

I have updated the usage of the stopTime argument to be consistent with the usage of the startTime argument of the other command-lines.

I have fixed a typo in the startTime argument usage.
2 files modified
30 ■■■■■ changed files
opendj-sdk/opends/src/messages/messages/tools.properties 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java 20 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/tools.properties
@@ -667,8 +667,12 @@
 control with the given authorization ID
INFO_STOPDS_DESCRIPTION_STOP_REASON_383=Reason the server is being stopped or \
 restarted
INFO_STOPDS_DESCRIPTION_STOP_TIME_384=Time to begin the shutdown in \
 YYYYMMDDhhmmss format (local time)
INFO_STOPDS_DESCRIPTION_STOP_TIME_384=Indicates the date/time at which the \
 shutdown operation will begin as a server task expressed in format \
 'YYYYMMDDhhmmss'.  A value of '0' will cause the shutdown to be scheduled for \
 immediate execution.  When this option is specified the operation will be \
 scheduled to start at the specified time after which this utility will exit \
 immediately
INFO_STOPDS_DESCRIPTION_TRUST_ALL_385=Trust all server SSL certificates
INFO_STOPDS_DESCRIPTION_KSFILE_386=Certificate key store path
INFO_STOPDS_DESCRIPTION_KSPW_387=Certificate key store PIN
@@ -2136,7 +2140,7 @@
  cannot be canceled
SEVERE_ERR_TASK_CLIENT_TASK_STATE_UNKNOWN_1455=State for task '%s' cannot be \
  determined
INFO_DESCRIPTION_START_DATETIME_1456=Indicates the date/time at which the this \
INFO_DESCRIPTION_START_DATETIME_1456=Indicates the date/time at which this \
  operation will start when scheduled as a server task expressed in format \
  'YYYYMMDDhhmmss'.  A value of '0' will cause the task to be scheduled for \
  immediate execution.  When this option is specified the operation will be \
opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java
@@ -54,6 +54,7 @@
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.tasks.ShutdownTask;
import org.opends.server.tools.tasks.TaskTool;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.types.NullOutputStream;
@@ -519,15 +520,18 @@
    if (stopTimeStr.isPresent())
    {
      String timeStr = stopTimeStr.getValue();
      try
      if (!TaskTool.NOW.equals(timeStr))
      {
        stopTime = parseDateTimeString(timeStr);
      }
      catch (Exception e)
      {
        Message message = ERR_STOPDS_CANNOT_DECODE_STOP_TIME.get();
        err.println(wrapText(message, MAX_LINE_WIDTH));
        return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
        try
        {
          stopTime = parseDateTimeString(timeStr);
        }
        catch (Exception e)
        {
          Message message = ERR_STOPDS_CANNOT_DECODE_STOP_TIME.get();
          err.println(wrapText(message, MAX_LINE_WIDTH));
          return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
        }
      }
    }