|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.scheduler.JobRunnerResponse
@PublicApi @Immutable public final class JobRunnerResponse
An object that represents the result of a call to 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.
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
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 necessary
public 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()
@Nullable public String getMessage()
public boolean equals(@Nullable
Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||