Tracks the progress of a long running background job so a user interface can poll it and show state. A job is keyed to whatever it is working on by its general id, and only one job status row is kept per general id: starting a new job for the same general id resets the existing row rather than adding another. The state moves through PENDING, PROCESSING and then either COMPLETED or STOPPED, and job details carries a free-text progress or error message set by the process doing the work.

Group: Database Entities

Implements: Serializable


Properties

PropertyReturnsDescription
generalIdlongIdentifier of the thing the job is working on, for example the id of the record being imported. It is the job's natural key, so a second job for the same general id reuses this row.
idlongUnique database identifier for this job status record, and the id used to update the job as it runs.
jobDetailsStringFree-text progress or error message written by the process running the job. Cleared when the job is restarted, and may be null when there is nothing to report.
jobStateStringCurrent state of the job, one of the constants PENDING, PROCESSING, COMPLETED or STOPPED. Never null.
jobTypeStringShort code naming the kind of work this job does, set by whichever process created it. Never null.
startedUserStringName of the user who started the job, stored as text rather than as a link to a profile.
startTimeDateWhen this job status record was first created. Note that it is not reset when an existing record is reused for a new run, so it is the time of the first run for that general id.
updateTimeDateWhen the job state or details were last changed. Every state transition and progress update sets this, so it doubles as a heartbeat for detecting stalled jobs.

Methods

getId()

Returns: long

Unique database identifier for this job status record, and the id used to update the job as it runs.

getGeneralId()

Returns: long

Identifier of the thing the job is working on, for example the id of the record being imported. It is the job's natural key, so a second job for the same general id reuses this row.

getJobType()

Returns: String

Short code naming the kind of work this job does, set by whichever process created it. Never null.

getJobDetails()

Returns: String

Free-text progress or error message written by the process running the job. Cleared when the job is restarted, and may be null when there is nothing to report.

getJobState()

Returns: String

Current state of the job, one of the constants PENDING, PROCESSING, COMPLETED or STOPPED. Never null.

getStartedUser()

Returns: String

Name of the user who started the job, stored as text rather than as a link to a profile.

getStartTime()

Returns: Date

When this job status record was first created. Note that it is not reset when an existing record is reused for a new run, so it is the time of the first run for that general id.

getUpdateTime()

Returns: Date

When the job state or details were last changed. Every state transition and progress update sets this, so it doubles as a heartbeat for detecting stalled jobs.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.