Interface ClaimableJob<C,R,S extends ClaimableJobState,PK>

Type Parameters:
C - the job configuration type
R - the job result type
S - the job state type
PK - 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

public interface ClaimableJob<C,R,S extends ClaimableJobState,PK> extends net.solarnetwork.dao.Entity<PK>
A "claimable job" entity.
Since:
1.44
  • 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

      default String 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

      default Duration getJobDuration()
      Get the job execution duration.

      This will return the overall job execution duration, based on the started and completed dates. If both are available, the duration returned is the difference between the two. If just started is 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