Interface ClaimableJob<C,R,S extends ClaimableJobState,PK>
- Type Parameters:
C- the job configuration typeR- the job result typeS- the job state typePK- the job entity primary key type
- All Superinterfaces:
Comparable<PK>,net.solarnetwork.dao.Entity<PK>,net.solarnetwork.domain.Identity<PK>
- All Known Implementing Classes:
BaseClaimableJob
- Since:
- 1.44
-
Method Summary
Modifier and TypeMethodDescriptionGet the completed date.Get the job configuration details.Get a job group key.default DurationGet the job execution duration.Get the job state.Get a success flag.Get a message about the result.doubleGet a percentage complete for the job overall.Get the number of datum successfully loaded.Get the date the job started execution.default StringGet the authorization token associated with this job, if any.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.solarnetwork.dao.Entity
getCreatedMethods inherited from interface net.solarnetwork.domain.Identity
getId, hasId
-
Method Details
-
getConfiguration
C getConfiguration()Get the job configuration details.- Returns:
- the job configuration
-
getJobState
S getJobState()Get the job state.- Returns:
- the job state
-
getTokenId
Get the authorization token associated with this job, if any.- Returns:
- the authorization token, or null if none
- Since:
- 2.1
-
getGroupKey
String getGroupKey()Get a job group key.A group key represents a grouping of related jobs, such that only one job within a given group should be allowed to execute at a time. This provides a way to synchronize multiple related jobs in a reliable manner.
- Returns:
- the group key, or null for the "default" group
- Since:
- 1.1
-
getPercentComplete
double getPercentComplete()Get a percentage complete for the job overall.- Returns:
- a percentage complete, or -1 if not known
-
getStarted
Instant getStarted()Get the date the job started execution.- Returns:
- the started date or null if not started
-
getCompleted
Instant getCompleted()Get the completed date.- Returns:
- the completed date, or null if not complete
-
getJobDuration
Get the job execution duration.This will return the overall job execution duration, based on the
startedandcompleteddates. If both are available, the duration returned is the difference between the two. If juststartedis available, the difference between now and then is returned. Otherwise a zero-duration value is returned.- Returns:
- the duration, never null
-
getJobSuccess
Boolean getJobSuccess()Get a success flag.- Returns:
- the success flag, or null if not known
-
getMessage
String getMessage()Get a message about the result.If
getJobSuccess()returns false, this method will return a message about the error.- Returns:
- a message
-
getResult
R getResult()Get the number of datum successfully loaded.Note that even if
getJobSuccess()is false this method can return a value greater than 0, if partial results are supported by the transaction mode of the import process.- Returns:
- the number of successfully loaded datum
-