@PublicApi @Immutable public final class JobRunnerResponse extends Object
JobRunner.runJob(JobRunnerRequest).
The job runner can use this to customize the reporting of its status; otherwise it can simply
return null on success and throw an exception on failure.| Modifier and Type | Method and Description |
|---|---|
static JobRunnerResponse |
aborted(String message)
Creates a response that indicates the request was aborted.
|
boolean |
equals(Object o) |
static JobRunnerResponse |
failed(String message)
Creates a response that indicates the request has failed.
|
static JobRunnerResponse |
failed(Throwable cause)
Creates a response that indicates the request has failed.
|
String |
getMessage() |
RunOutcome |
getRunOutcome() |
int |
hashCode() |
static JobRunnerResponse |
success()
Creates a successful response with no additional message.
|
static JobRunnerResponse |
success(String message)
Creates a successful response with the specified message.
|
String |
toString() |
public static JobRunnerResponse success()
public static JobRunnerResponse success(@Nullable String message)
message - the message to return, which is optional and will be truncated to
RunDetails.MAXIMUM_MESSAGE_LENGTH if necessarypublic static JobRunnerResponse aborted(String message)
succeeded with nothing to
do or failed, instead.message - the message to return, which will be truncated to RunDetails.MAXIMUM_MESSAGE_LENGTH if
necessary. The message is required when reporting that the job was aborted.public static JobRunnerResponse failed(String message)
message - the message to return, which will be truncated to RunDetails.MAXIMUM_MESSAGE_LENGTH if
necessary. The message is required when reporting that the job has failed.public static JobRunnerResponse failed(Throwable cause)
message is set to
to an abbreviated representation of the exception and its causes, but the
RunDetails.MAXIMUM_MESSAGE_LENGTH still applies, so this information may be incomplete.
When possible, the JobRunner is encouraged to trap its exceptions and report more specific
diagnostic messages with failed(String), instead.cause - the exception that caused this failure@Nonnull public RunOutcome getRunOutcome()
Copyright © 2017 Atlassian. All rights reserved.