|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.scheduler.compat.JobHandlerKey
@Immutable @PublicApi public final class JobHandlerKey
A wrapper to distinguish job handler keys from simple strings and to make it easier to avoid confusing them with Job IDs.
This class is the compatibility layer's equivalent for the JobRunnerKey.
| Method Summary | |
|---|---|
int |
compareTo(JobHandlerKey o)
|
boolean |
equals(Object o)
|
int |
hashCode()
|
static JobHandlerKey |
of(String key)
Wraps the provided string as a JobHandlerKey. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static JobHandlerKey of(@Nonnull
String key)
JobHandlerKey.
Although it is not necessary for correctness, it will usually make sense to create a single instance of
the JobHandlerKey and reuse it as a constant, as in:
private static final JobHandlerKey POP3_SERVICE = JobHandlerKey.of("com.example.plugin.Pop3Service");
// ...
private void registerJobHandler()
{
compatibilityPluginScheduler.registerJobHandler(POP3_SERVICE, new Pop3JobHandler());
}
private void scheduleJob(String jobId, long intervalInMillis, Date firstRun)
{
compatibilityPluginScheduler.scheduleJob(jobKey, POP3_SERVICE, null, intervalInMillis, firstRun);
}
key - the job handler key, as a string
public boolean equals(Object o)
equals in class Objectpublic int compareTo(JobHandlerKey o)
compareTo in interface Comparable<JobHandlerKey>public 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 | |||||||||