Source:
<code>public ActionResult<Void> resume(@PathKeysParam PathKeys pathKeys, @ActionParam("force") @Optional("false") boolean force) { String datastreamName = pathKeys.getAsString(KEY_NAME); Datastream datastream = _store.getDatastream(datastreamName); LOG.info("Received request to resume datastream {}", datastream); if (datastream == null) { _errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_404_NOT_FOUND, "Datastream to resume does not exist: " + datastreamName); } <START> if (!DatastreamStatus.PAUSED.equals(datastream.getStatus()) && <END> !DatastreamStatus.STOPPED.equals(datastream.getStatus())) { _errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_405_METHOD_NOT_ALLOWED, "Datastream is not paused, cannot resume: " + datastreamName); } List<Datastream> datastreamsToResume = force ? getGroupedDatastreams(datastream) : Collections.singletonList(datastream); LOG.info("Resuming datastreams {}", datastreamsToResume); for (Datastream d : datastreamsToResume) { try { if (DatastreamStatus.PAUSED.equals(datastream.getStatus()) || DatastreamStatus.STOPPED.equals(datastream.getStatus())) { d.setStatus(DatastreamStatus.READY); _store.updateDatastream(d.getName(), d, true); } else { LOG.warn("Will not resume datastream {}, as it is already in PAUSED/STOPPED state", d); } } catch (DatastreamException e) { _errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "Could not update datastream to resume: " + d.getName(), e); } } LOG.info("Completed request for resuming datastream {}", datastream); return new ActionResult<>(HttpStatus.S_200_OK); }</code><technical_language>This a redundant check well, check below</technical_language>

Target:
public ActionResult<Void> resume(@PathKeysParam PathKeys pathKeys, @ActionParam("force") @Optional("false") boolean force) { String datastreamName = pathKeys.getAsString(KEY_NAME); Datastream datastream = _store.getDatastream(datastreamName); LOG.info("Received request to resume datastream {}", datastream); if (datastream == null) { _errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_404_NOT_FOUND, "Datastream to resume does not exist: " + datastreamName); } if (!DatastreamStatus.PAUSED.equals(datastream.getStatus()) && !DatastreamStatus.STOPPED.equals(datastream.getStatus())) { _errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_405_METHOD_NOT_ALLOWED, "Datastream is not paused or stopped, cannot resume: " + datastreamName); } List<Datastream> datastreamsToResume = force ? getGroupedDatastreams(datastream) : Collections.singletonList(datastream); LOG.info("Resuming datastreams {}", datastreamsToResume); for (Datastream d : datastreamsToResume) { try { if (DatastreamStatus.PAUSED.equals(datastream.getStatus()) || DatastreamStatus.STOPPED.equals(datastream.getStatus())) { d.setStatus(DatastreamStatus.READY); _store.updateDatastream(d.getName(), d, true); } else { LOG.warn("Will not resume datastream {}, as it is not already in PAUSED/STOPPED state", d); } } catch (DatastreamException e) { _errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "Could not update datastream to resume: " + d.getName(), e); } } LOG.info("Completed request for resuming datastream {}", datastream); return new ActionResult<>(HttpStatus.S_200_OK); }