private ActionStatus checkAndLogDownload(final HttpServletRequest request, final Target target, final Long module) { final Action action = controllerManagement .getActionForDownloadByTargetAndSoftwareModule(target.getControllerId(), module) .orElseThrow(() -> new SoftwareModuleNotAssignedToTargetException(module, target.getControllerId())); final String range = request.getHeader("Range"); String message; if (range != null) { message = RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads range " + range + " of: " + request.getRequestURI(); } else { message = RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads " + request.getRequestURI(); } return controllerManagement.addInformationalActionStatus( entityFactory.actionStatus().create(action.getId()).status(Status.DOWNLOAD).message(message)); }
private ActionStatus checkAndLogDownload(final HttpServletRequest request, final Target target, final Long module) { final Action action = controllerManagement .getActionForDownloadByTargetAndSoftwareModule(target.getControllerId(), module) .orElseThrow(() -> new SoftwareModuleNotAssignedToTargetException(module, target.getControllerId())); final String range = request.getHeader("Range"); String message; if (range != null) { message = RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads range " + range + " of: " + request.getRequestURI(); } else { message = RepositoryConstants.SERVER_MESSAGE_PREFIX + "Target downloads " + request.getRequestURI(); } return controllerManagement.addInformationalActionStatus( entityFactory.actionStatus().create(action.getId()).status(Status.DOWNLOAD).message(message)); }
getTestSchedule(-5), getTestDuration(10), getTestTimeZone()).getActions().get(0); controllerManagement.addInformationalActionStatus( entityFactory.actionStatus().create(actionId).message("Started download").status(Status.DOWNLOAD)); controllerManagement.addInformationalActionStatus(entityFactory.actionStatus().create(actionId) .message("Download failed. ErrorCode #5876745. Retry").status(Status.WARNING)); controllerManagement.addInformationalActionStatus( entityFactory.actionStatus().create(actionId).message("Download done").status(Status.DOWNLOADED)); controllerManagement.addInformationalActionStatus( entityFactory.actionStatus().create(actionId).message("Write firmware").status(Status.RUNNING)); controllerManagement.addInformationalActionStatus( entityFactory.actionStatus().create(actionId).message("Reboot").status(Status.RUNNING));