Package net.solarnetwork.central.domain
Class BaseClaimableJob<C,R,S extends ClaimableJobState,PK extends Comparable<PK> & Serializable>
java.lang.Object
net.solarnetwork.central.domain.BaseObjectIdentity<PK>
net.solarnetwork.central.dao.BaseObjectEntity<PK>
net.solarnetwork.central.domain.BaseClaimableJob<C,R,S,PK>
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<PK>,ClaimableJob<C,,R, S, PK> net.solarnetwork.dao.Entity<PK>,net.solarnetwork.domain.Identity<PK>
public abstract class BaseClaimableJob<C,R,S extends ClaimableJobState,PK extends Comparable<PK> & Serializable>
extends BaseObjectEntity<PK>
implements ClaimableJob<C,R,S,PK>
Abstract implementation support for
ClaimableJob.- Since:
- 1.44
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the completed date.Get the job configuration details.Get a job group key.Get the job state.charGet the job state key value.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.Get the authorization token associated with this job, if any.booleanGet the success flag.voidsetCompleted(Instant completed) voidsetConfiguration(C configuration) voidsetGroupKey(String groupKey) voidsetJobState(S jobState) voidsetJobSuccess(Boolean jobSuccess) voidsetMessage(String message) voidsetPercentComplete(double percentComplete) voidvoidsetStarted(Instant started) voidsetTokenId(String tokenId) Set the authorization token ID.Methods inherited from class net.solarnetwork.central.dao.BaseObjectEntity
getCreated, getModified, setCreated, setModifiedMethods inherited from class net.solarnetwork.central.domain.BaseObjectIdentity
clone, compareTo, equals, getId, hashCode, setIdMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.central.domain.ClaimableJob
getJobDurationMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.solarnetwork.dao.Entity
getCreatedMethods inherited from interface net.solarnetwork.domain.Identity
getId, hasId
-
Constructor Details
-
BaseClaimableJob
public BaseClaimableJob()
-
-
Method Details
-
getJobState
Description copied from interface:ClaimableJobGet the job state.- Specified by:
getJobStatein interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- the job state
-
getJobStateKey
public char getJobStateKey()Get the job state key value.- Returns:
- the key value, or
ClaimableJobState.UNKNOWN_KEYif not known
-
setJobState
-
getConfiguration
Description copied from interface:ClaimableJobGet the job configuration details.- Specified by:
getConfigurationin interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- the job configuration
-
setConfiguration
-
getResult
Description copied from interface:ClaimableJobGet the number of datum successfully loaded.Note that even if
ClaimableJob.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.- Specified by:
getResultin interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- the number of successfully loaded datum
-
setResult
-
getTokenId
Description copied from interface:ClaimableJobGet the authorization token associated with this job, if any.- Specified by:
getTokenIdin interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- the authorization token, or null if none
-
setTokenId
Set the authorization token ID.- Parameters:
tokenId- the token ID to set- Since:
- 2.1
-
getJobSuccess
Description copied from interface:ClaimableJobGet a success flag.- Specified by:
getJobSuccessin interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- the success flag, or null if not known
-
setJobSuccess
-
isSuccess
public boolean isSuccess()Get the success flag.- Returns:
- true if
getJobSuccess()is true
-
getMessage
Description copied from interface:ClaimableJobGet a message about the result.If
ClaimableJob.getJobSuccess()returns false, this method will return a message about the error.- Specified by:
getMessagein interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- a message
-
setMessage
-
getStarted
Description copied from interface:ClaimableJobGet the date the job started execution.- Specified by:
getStartedin interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- the started date or null if not started
-
setStarted
-
getCompleted
Description copied from interface:ClaimableJobGet the completed date.- Specified by:
getCompletedin interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- the completed date, or null if not complete
-
setCompleted
-
getPercentComplete
public double getPercentComplete()Description copied from interface:ClaimableJobGet a percentage complete for the job overall.- Specified by:
getPercentCompletein interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- a percentage complete, or -1 if not known
-
setPercentComplete
public void setPercentComplete(double percentComplete) -
getGroupKey
Description copied from interface:ClaimableJobGet 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.
- Specified by:
getGroupKeyin interfaceClaimableJob<C,R, S extends ClaimableJobState, PK extends Comparable<PK> & Serializable> - Returns:
- the group key, or null for the "default" group
-
setGroupKey
-