/** * Creates a response that indicates the request has failed. * * @param message the message to return, which will be truncated to {@link com.atlassian.scheduler.status.RunDetails#MAXIMUM_MESSAGE_LENGTH} if * necessary. The message is <strong>required</strong> when reporting that the job has failed. * @return the response */ public static JobRunnerResponse failed(final String message) { checkArgument(isNotBlank(message), "The message must be specified when reporting a job as failed!"); return new JobRunnerResponse(FAILED, message); }
/** * Creates a response that indicates the request was aborted. In most cases, it will make * more sense to report the job as either having {@link #success() succeeded} with nothing to * do or {@link #failed(String) failed}, instead. * * @param message the message to return, which will be truncated to {@link com.atlassian.scheduler.status.RunDetails#MAXIMUM_MESSAGE_LENGTH} if * necessary. The message is <strong>required</strong> when reporting that the job was aborted. * @return the response */ public static JobRunnerResponse aborted(final String message) { checkArgument(isNotBlank(message), "The message must be specified when reporting a job as aborted!"); return new JobRunnerResponse(ABORTED, message); }