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
| Property | Returns | Description |
|---|---|---|
| generalId | 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. |
| id | long | Unique database identifier for this job status record, and the id used to update the job as it runs. |
| jobDetails | 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. |
| jobState | String | Current state of the job, one of the constants PENDING, PROCESSING, COMPLETED or STOPPED. Never null. |
| jobType | String | Short code naming the kind of work this job does, set by whichever process created it. Never null. |
| startedUser | String | Name of the user who started the job, stored as text rather than as a link to a profile. |
| startTime | 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. |
| updateTime | 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. |
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.