@Entity public class JobEntity extends CommonFieldsEntity
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DEFAULT_VERSION
Used as default version when one not entered.
|
static java.lang.String |
QUERY_GET_STATUS_BY_ID
Query name to get job status.
|
GENIE_ID_TAG_NAMESPACE, GENIE_NAME_TAG_NAMESPACE, GENIE_TAG_NAMESPACE, TAG_DELIMITER, TAG_DELIMITER_REGEX
Constructor and Description |
---|
JobEntity()
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.String> |
getArchiveLocation()
Get location where logs are archived.
|
java.util.Optional<java.lang.String> |
getClusterName()
Gets the name of the cluster on which this job was run.
|
java.util.Optional<java.lang.String> |
getCommandName()
Gets the command name for this job.
|
Job |
getDTO()
Get a DTO representing this job.
|
java.util.Optional<java.util.Date> |
getFinished()
Gets the finish time for this job.
|
protected JobRequestEntity |
getRequest()
Get the job request for this job.
|
java.util.Optional<java.util.Date> |
getStarted()
Gets the start time for this job.
|
java.util.Optional<java.lang.String> |
getStatusMsg()
Gets the status message or this job.
|
void |
setApplications(java.util.List<ApplicationEntity> applications)
Set the applications used to run this job.
|
void |
setCluster(ClusterEntity cluster)
Set the cluster this job ran on.
|
protected void |
setClusterName(java.lang.String clusterName)
Sets the name of the cluster on which this job is run.
|
void |
setCommand(CommandEntity command)
Set the command used to run this job.
|
protected void |
setCommandName(java.lang.String commandName)
Set command Name with which this job is run.
|
void |
setFinished(java.util.Date finished)
Set the finishTime for the job.
|
void |
setJobStatus(JobStatus jobStatus)
Set job status, and update start/update/finish times, if needed.
|
void |
setJobStatus(JobStatus newStatus,
java.lang.String msg)
Sets job status and human-readable message.
|
void |
setRequest(JobRequestEntity request)
Set the job request for this job.
|
void |
setStarted(java.util.Date started)
Set the startTime for the job.
|
getDescription, getFinalTags, getTags, setTags
getCreated, getEntityVersion, getId, getUpdated, onCreateBaseEntity, onUpdateBaseEntity, setCreated, setEntityVersion, setId, setUpdated
public static final java.lang.String QUERY_GET_STATUS_BY_ID
protected static final java.lang.String DEFAULT_VERSION
public java.util.Optional<java.lang.String> getClusterName()
protected void setClusterName(java.lang.String clusterName)
clusterName
- Name of the cluster on which job was executed.public java.util.Optional<java.lang.String> getCommandName()
protected void setCommandName(java.lang.String commandName)
commandName
- Name of the command used to run the jobpublic java.util.Optional<java.lang.String> getStatusMsg()
public java.util.Optional<java.util.Date> getStarted()
public void setStarted(@Nullable java.util.Date started)
started
- epoch time as java.util.Date or nullpublic java.util.Optional<java.util.Date> getFinished()
public void setFinished(@Nullable java.util.Date finished)
finished
- The finished time.public java.util.Optional<java.lang.String> getArchiveLocation()
public void setJobStatus(@NotNull JobStatus jobStatus)
jobStatus
- status for jobpublic void setJobStatus(JobStatus newStatus, java.lang.String msg)
newStatus
- predefined statusmsg
- human-readable messageprotected JobRequestEntity getRequest()
public void setRequest(JobRequestEntity request)
request
- The job request. Not null.public void setCluster(ClusterEntity cluster)
cluster
- The cluster this job ran onpublic void setCommand(CommandEntity command)
command
- The commandpublic void setApplications(java.util.List<ApplicationEntity> applications)
applications
- The applicationspublic Job getDTO()